Let $a, b, n>0, 0<x<\frac{\pi}{2}$. Find the minimum value of the function
$$
y=\frac{a}{\cos ^{n} x}+\frac{b}{\sin ^{n} x}
$$
Solution: Notice that
$$
\begin{array}{l}
n+2 \\
=\frac{2 a}{y \cos ^{n} x}+n \cos ^{2} x+\frac{2 b}{y \sin ^{n} x}+n \sin ^{2} x \\
\geqslant(n+2) \sqrt[n+2]{\left(\frac{a}{y \cos ^{n} x}\right)^{2}\left(\cos ^{2} x\right)^{n}}+ \\
(n+2) \sqrt[n+2]{\left(\frac{b}{y \sin ^{n} x}\right)^{2}\left(\sin ^{2} x\right)^{n}} \\
=(n+2) \frac{\sqrt[n+2]{a^{2}}+\sqrt[n+2]{b^{2}}}{\sqrt[n+2]{y^{2}}} . \\
\end{array}
$$

Therefore, $y \geqslant\left(a^{\frac{2}{n+2}}+b^{\frac{2}{n+2}}\right)^{\frac{n+2}{2}}$
$$
\begin{array}{l}
\Leftrightarrow \frac{a}{y \cos ^{n} x}=\cos ^{2} x, \text { and } \frac{b}{y \sin ^{n} x}=\sin ^{2} x \\
\Leftrightarrow \tan ^{n+2} x=\frac{b}{a}
\end{array}
$$
$\Leftrightarrow$ when $x=\arctan \sqrt[n+2]{\frac{b}{a}}$,
$$
y_{\text {min }}=\left(a^{\frac{2}{n+2}}+b^{\frac{2}{n+2}}\right)^{\frac{n+2}{2}} \text {. }
$$