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?

The integrands are both periodic with period $\pi$, so it suffices to verify the identity over any interval of length $\pi$, including $\left[-\frac{\pi}{2}, \frac{\pi}{2}\right]$. Then, since both integrands are even functions, it suffices to check that the identity holds when integrating over $\left[0, \frac{\pi}{2}\right]$, that is, that
$$ \int_0^{\frac{\pi}{2}} \frac{(\cos x)^2}{1 + \cos x \sin x} \,\mathrm{d}x =\int_0^{\frac{\pi}{2}} \frac{(\sin x)^2}{1 + \cos x \sin x} \,\mathrm{d}x.$$
But one can show this simply by substituting $x = \frac{\pi}{2} - u$ on either side.
