47. Find the smallest and largest values of the product $y=\cos ^{p} x \sin ^{q} x$ on the segment $0 \leqslant x \leqslant \frac{\pi}{2}$, where $p$ and $q$ are given positive rational numbers.
47. On the segment $0 \leqslant x \leqslant \frac{\pi}{2}$, the values of $\cos x$ and $\sin x$ are positive, which means that $\cos ^{p} x$ and $\sin ^{q} x$ are positive, i.e., $\cos ^{p} x \sin ^{q} x \geqslant 0$. The minimum value $y=0$ is obtained at $x=0, x=\frac{\pi}{2}$. The maximum value of $y$ is the maximum value of $\cos ^{p} x \sin ^{q} x=\left(\cos ^{2} x\right)^{\frac{p}{2}}\left(\sin ^{2} x\right)^{\frac{q}{2}}$

which is achieved under the condition $\frac{\cos ^{2} x}{p}=\frac{\sin ^{2} x}{q}$ (since $\sin ^{2} x+\cos ^{2} x=1$ ).

Thus, $\operatorname{tg}^{2} x=\frac{q}{p}$, from which $x=\operatorname{arctg} \sqrt{\frac{q}{p}}$.