Show $ I = \int_0^{\pi} \frac{\mathrm{d}x}{1+\cos^2 x} = \frac{\pi}{\sqrt 2}$ Show  $$ I = \int_0^{\pi} \frac{\mathrm{d}x}{1+\cos^2 x} = \frac{\pi}{\sqrt 2}$$

If we make the standard "Weierstrass" $t=\tan(x/2)$ substitution, we get $\cos t=\frac{1-t^2}{1+t^2}$ and $dx=\frac{2\,dt}{1+t^2}$. We end up quickly with
$$\int_0^\infty \frac{1+t^2}{1+t^4}\,dt.$$
But $1+t^4=(1-\sqrt{2}t+t^2)(1+\sqrt{2}t +t^2)$, so by partial fractions our integrand is 
$$\frac{1}{2-2\sqrt{2}t+2t^2} +\frac{1}{2+2\sqrt{2}t+2t^2}.$$
Completing the squares, we end up with the integrand
$$\frac{1}{1+(\sqrt{2}t-1)^2}+\frac{1}{1+(\sqrt{2}t+1)^2}.$$
The substitutions $u=\sqrt{2} t-1$ and $u=\sqrt{2}t+1$ give
$$\int_{-1}^\infty \frac{1}{\sqrt{2}}\frac{du}{1+u^2}+\int_{1}^\infty \frac{1}{\sqrt{2}}\frac{du}{1+u^2}.$$
The first integral is $(1/\sqrt{2})(3\pi/4)$ and the second is $(1/\sqrt{2})(\pi/4)$. Add. We get $\pi/\sqrt{2}$.
