(i) We start with the function \(f(x) = 3 \cos^2 x - 2 \sin^2 x\).
Using the identity \(\cos^2 x + \sin^2 x = 1\), we can express \(\sin^2 x\) as \(1 - \cos^2 x\).
Substitute \(\sin^2 x = 1 - \cos^2 x\) into the function:
\(f(x) = 3 \cos^2 x - 2(1 - \cos^2 x)\)
\(= 3 \cos^2 x - 2 + 2 \cos^2 x\)
\(= 5 \cos^2 x - 2\)
Thus, \(a = 5\) and \(b = -2\).
(ii) To find the range of \(f\), note that \(\cos^2 x\) ranges from 0 to 1 for \(0 \leq x \leq \pi\).
Substitute the extreme values of \(\cos^2 x\) into \(f(x) = 5 \cos^2 x - 2\):
When \(\cos^2 x = 0\), \(f(x) = 5(0) - 2 = -2\).
When \(\cos^2 x = 1\), \(f(x) = 5(1) - 2 = 3\).
Therefore, the range of \(f\) is \([-2, 3]\).