<s>[INST] Prove that $ \int_0^{\pi} \frac{(\cos x)^2}{1 + \cos x \sin x} \,\mathrm{d}x =\int_0^{\pi} \frac{(\sin x)^2}{1 + \cos x \sin x} \,\mathrm{d}x $ In a related question the following integral was evaluated
$$ 
      \int_0^{\pi} \frac{(\cos x)^2}{1 + \cos x \sin x} \,\mathrm{d}x
     =\int_0^{\pi} \frac{\mathrm{d}x/2}{1 + \cos x \sin x} 
     =\int_0^{2\pi}  \frac{\mathrm{d}x/2}{2 + \sin x} \,\mathrm{d}x
     =\int_{-\infty}^\infty \frac{\mathrm{d}x/2}{1+x+x^2}
$$
I noticed something interesting, namely that
$$ 
\begin{align*}
        \int_0^{\pi} \frac{(\cos x)^2}{1 + \cos x \sin x} \,\mathrm{d}x
    & = \int_0^{\pi} \frac{(\sin x)^2}{1 + \cos x \sin x} \,\mathrm{d}x \\
    & = \int_0^{\pi} \frac{(\cos x)^2}{1 - \cos x \sin x} \,\mathrm{d}x
      = \int_0^{\pi} \frac{(\sin x)^2}{1 - \cos x \sin x} \,\mathrm{d}x
\end{align*}
$$
The same trivially holds if the upper limits are changed to $\pi/2$ as well ($x \mapsto \pi/2 -u$).
But I had problems proving the first equality. Does anyone have some quick hints?
 [/INST] A quick hint is noticing the symmetry. A rigorous proof is that $$\int\limits_a^b {\frac{{f(\cos x)}}{{g(\sin x\cos x)}}dx}  = \int\limits_a^b {\frac{{f\left( {\sin \left( {\frac{\pi }{2} - x} \right)} \right)}}{{g\left( {\cos \left( {\frac{\pi }{2} - x} \right)\sin \left( {\frac{\pi }{2} - x} \right)} \right)}}dx}  = \int\limits_{\frac{\pi }{2} - b}^{\frac{\pi }{2} - a} {\frac{{f\left( {\sin u} \right)}}{{g\left( {\cos u\sin u} \right)}}du} $$Hope it helps ;)
</s>