Definite integral $\int_0^{2\pi}(\cos^2(x)+a^2)^{-1}dx$ How do I prove the following?
$$ I(a)=\int_0^{2\pi} \frac{\mathrm{d}x}{\cos^2(x)+a^2}=\frac{2\pi}{a\sqrt{a^2+1}}$$
 A: HINT
Make the substitution $u=\tan x$.
The identity $1+\tan^2x \equiv \sec^2 x$ tells us that 
$$1+u^2 = \frac{1}{\cos^2x}\implies \cos^2 x = \frac{1}{1+u^2}$$
Moreover, if $u=\tan x$ then $\mathrm{d}u=\sec^2x~\mathrm{d}x$ which, again by $1+\tan^2x \equiv \sec^2 x$, gives
$$\mathrm{d}x=\frac{1}{1+u^2}~\mathrm{d}u$$
If you make these substitutions then you'll get
$$\int \frac{\mathrm{d}x}{\cos^2x+a^2} \longmapsto \int \frac{\mathrm{d}u}{a^2u^2 + 1+a^2}$$
You should be able to integrate this quite easily. Standard integral tables tell us that
$$\int\frac{\mathrm{d}y}{y^2+b^2} = \frac{1}{b}\arctan\left(\frac{y}{b}\right) + C$$
A: If anyone wants to see a complex analysis solution.
Let $\gamma$ be the unit$\require{autoload-all}$ circle. This proof holds for all complex $a$ such that the integral exists.
$$ I(a)=\int_0^{2\pi}\!\!\! \frac{\mathrm{d}t}{\cos^2(t)+a^2}$$
$$
\toggle{ 
\text{Set} \; x = e^{it}\quad\enclose{roundedbox}{\text{ Click for Information }}
}{
\begin{align}
 x &= e^{it}\\
\sin(t) &= \frac{1}{2i}\left(x-\frac{1}{x}\right)\\
\cos(t) &=\frac{1}{2}\left(x+\frac{1}{x}\right)\\
\mathrm{d}t &= \frac{-i \, \mathrm{d}x}{x}
\end{align}
}\endtoggle
$$
$$\begin{align} I(a)&=\int_\gamma \frac{-i\,\mathrm{d}x}{x\frac{x^4+2x^2+4x^2a^2+2}{4x^2}} \\[.2cm] &=\int_\gamma \frac{-4ix\,\mathrm{d}x}{x^4+2x^2+4x^2a^2+2} \end{align}$$
The zeros of the denominator are
$$x= \pm\sqrt{-2 a^2-2\sqrt{a^2} \sqrt{a^2+1}-1},\quad x =  \pm\sqrt{-2 a^2+2\sqrt{a^2}\sqrt{a^2+1}-1}$$
Only the second two roots will be inside the unit circle. Call these roots $x_+$ and $x_-$ and set $\alpha = x_+^2$.
$$I(a) = 2\pi i \left(\lim_{x\to x_+} \frac{-4ix(x-x_+)}{x^4+2x^2+4x^2a^2+2} + \lim_{x\to x_-} \frac{-4ix(x-x_-)}{x^4+2x^2+4x^2a^2+2}\right)$$
Factor out constants and apply L'Hopitals rule for both of the limits
$$\begin{align}I(a) &= 8\pi \left(\lim_{x\to x_+} \frac{2x-x_+}{4x^3+4x+8xa^2} + \lim_{x\to x_-} \frac{2x-x_-}{4x^3+4x+8xa^2}\right)\\ 
&= 8\pi \left(\frac{x_+}{4x_+^3+4x_++8x_+a^2} + \frac{x_-}{4x_-^3+4x_-+8x_-a^2}\right) \\ 
&=8\pi \left(\frac{1}{4x_+^2+4+8a^2} + \frac{1}{4x_-^2+4+8a^2}\right)\end{align}$$
Using the fact that $x_+^2 = x_-^2=\alpha$
$$\begin{align} I(a) &= 4\pi \left(\frac{1}{\alpha+1+2a^2}\right) \\ &= \frac{4\pi}{(-2 a^2+2\sqrt{a^2}\sqrt{a^2+1}-1)+1+2a^2} \\ &= \frac{2\pi}{\sqrt{a^2}\sqrt{a^2+1}}\end{align}$$
This is the result for $a \in \mathbb{C}$. For $a \in \mathbb{R}$ we can say that
$$I(a)=\int_0^{2\pi}\!\!\! \frac{\mathrm{d}t}{\cos^2(t)+a^2} = \frac{2\pi}{a\sqrt{a^2+1}}$$
