Computing $\int_0^{\pi\over2} \frac{dx}{1+\sin^2(x)}$? How would you compute$$\int_0^{\pi\over2} \frac{dx}{1+\sin^2(x)}\, \, ?$$
 A: Put $z=e^{i x}$; then the integral is equal to
$$i \oint_{|z|=1} dz \frac{z}{z^4-6 z^2+1} $$
There are four poles at
$$z = \pm \sqrt{2} \pm 1$$
only two of which are within the unit circle ($z = \pm (\sqrt{2}-1)$).  The residues from each of these poles are equal and are each
$$\frac{i}{4 (\sqrt{2}-1)^2-12} = \frac{-i}{8 \sqrt{2}}$$
The sum of the residues is double that residue.  The integral is then $i 2 \pi$ times that sum; I get
$$\int_0^{\pi/2} \frac{dx}{1+\sin^2{x}} = \frac{\pi}{2 \sqrt{2}}$$
A: HINT:
$$\int_0^{\pi\over2} \frac{dx}{1+\sin^2(x)}= \int_0^{\pi\over2} \frac{\csc^2xdx}{\csc^2x+1}=\int_0^{\pi\over2} \frac{\csc^2xdx}{\cot^2x+2}$$
Put $\cot x=u$
A: $$\int_0^{\frac \pi 2} \frac{1}{1 + \sin^2x}dx = \int_0^{\frac \pi 2} \frac{2}{3 - \cos 2x} dx = \int_0^\pi \frac{d\theta}{3 - \cos \theta } = \frac 12\int_0^{2\pi}\frac{d\theta}{3 - \cos \theta}$$
To evaluate $\displaystyle \int_0^{2\pi}\frac{1}{3 - \cos \theta}d\theta$ let $\displaystyle z = e^{i\theta} \implies \cos \theta = \frac{z^2 + 1}{2z}, d\theta = \frac{1}{iz}dz$
$$\int_0^{2\pi}\frac{1}{3 - \cos \theta}d\theta = \frac 2{i}\oint_{|z| = 1} \frac{1}{-z^2 + 6z - 1}dz $$
The poles are $3 - 2 \sqrt 2$ and $3  + 2 \sqrt 2$, and since $3 + 2 \sqrt 2  > 1$,
$$\frac 2{i}\oint_{|z| = 1} \frac{1 }{-z^2 + 6z - 1}dz = 4\pi \text{Res}\left[ \frac{1}{-z^2 + 6z - 1} , 3 - 2 \sqrt 2\right] = \frac{\pi}{\sqrt 2} $$
So $\displaystyle \int_0^{\frac \pi 2} \frac{1}{1 + \sin^2x}dx = \frac{\pi }{2 \sqrt 2}$
A: \begin{align}
\int_0^{\pi/2} \dfrac{dx}{1+\sin^2(x)} & = \int_0^{\pi/2}\sum_{k=0}^{\infty}(-1)^k \sin^{2k}(x) dx = \sum_{k=0}^{\infty}(-1)^k \int_0^{\pi/2}\sin^{2k}(x) dx\\
& = \sum_{k=0}^{\infty} \dfrac{(-1)^k}{4^k} \dbinom{2k}k\dfrac{\pi}2 = \dfrac1{\sqrt{1-4\times \left(\dfrac{-1}4\right)}} \dfrac{\pi}2 = \dfrac{\pi}{2\sqrt2}
\end{align}
where we used
$\dfrac1{1+r} = \displaystyle \sum_{k=0}^{\infty}(-r)^k$; $\displaystyle \int_0^{\pi/2} \sin^{2k}(x) dx = \dbinom{2k}k \dfrac{\pi}{2^{2k+1}}$; $ \dfrac1{\sqrt{1-4x}} = \displaystyle\sum_{k=0}^{\infty} \dbinom{2k}k x^k \,\, \forall x \in \left[-\dfrac14,\dfrac14 \right)$
