29. Find the maximum and minimum values of the function $f(x)=5 \cos ^{2} x-6 \sin 2 x+20 \sin x-30 \cos x+7$.

 untranslated text remains the same as requested.
29.
$$
\begin{aligned}
y & =\left(9 \cos ^{2} x-12 \sin x \cos x+4 \sin ^{2} x\right)+20 \sin x-30 \cos x+3 \\
& =(3 \cos x-2 \sin x)^{2}+10(2 \sin x-3 \cos x)+3 \\
& =(3 \cos x-2 \sin x-5)^{2}-22=(2 \sin x-3 \cos x+5)^{2}-22 \\
& =[\sqrt{13} \sin (x-\varphi)+5]^{2}-22, \text{ where } \tan \varphi=\frac{3}{2} .
\end{aligned}
$$

When $\sin (x-\alpha)=1$, $y_{\text {max }}=(\sqrt{13}+5)^{2}-22=16+10 \sqrt{13}$;
When $\sin (x-\varphi)=-1$, $y_{\text {min }}=(-\sqrt{13}+5)^{2}-22=16-10 \sqrt{13}$.