How to 'analyze' problems in analysis; Computing $\int_0^{2\pi}\frac{1}{(a+b\cos(\theta))^2}d\theta$ If $a, b \in \mathbb{R}$ with $a > b > 0$, compute this ungodly thing;
$$\int_0^{2\pi}\frac{1}{(a+b\cos(\theta))^2}d\theta$$
I'm really not a fan of complex analysis... I can't visualize what's going on here. When I look at things from group/number/graph theory I see ideas. When I look at this... all I see a bunch of symbols.
Where to begin with this? Maybe someone with analysis background can offer some intuition on 'analyzing' these things to better see whats going on..
Because right now, I'm lost looking at this.
Thanks guys! 
 A: Hint: Use Euler's formula to rewrite the integrand in terms of $e^{i \theta}$, then rewrite the integral as a contour integral in the complex plane (what kind of shape does $e^{i \theta}$ parameterize?).
As for the intuition...
The $\cos \theta$ brings back fond memories of polar coordinates (remember $x = r \cos \theta$, $y = r \sin \theta$?), and then the $0$ to $2 \pi$ integral sparks the thought that somewhere, somehow, a circle is being parameterized.  The quantity $e^{i \theta}$ does exactly that--it parameterizes the unit circle.
I remember from the hymns of ages past that Euler's formula can be used to rewrite $\cos \theta$ in terms of $e^{i \theta}$, so I follow in the footprints of the ancients and take advantage of this to rewrite the integrand.  Calling upon the dark arts, I make a change of variables which transports me from the realm of the (real) line to the realm of the infinite (complex) plane.  (The substitution $z = e^{i \theta}$ looks nice.)
Now that I'm in my element, I can go at the problem using all the magicks which were, until now, forbidden (Cauchy's theorem, the residue theorem, etc.).  Of course I have my trusty emergency pack ready, as I might need some extra tools along the way (partial fractions).
A: Hint
One method is to use the Weierstrass Substitution:
$$
\begin{align}
\tan\left(\frac t2\right)&=z&\mathrm{d}t&=\frac{2\,\mathrm{d}z}{1+z^2}\\[6pt]
\sin(t)&=\frac{2z}{1+z^2}&\cos(t)&=\frac{1-z^2}{1+z^2}
\end{align}
$$
Apply the substitution:
$$
\begin{align}
\int_0^{2\pi}\frac{\mathrm{d}t}{(a+b\cos(t))^2}
&=\int_{-\infty}^\infty\frac{\frac{2\,\mathrm{d}z}{1+z^2}}{\left(a+b\frac{1-z^2}{1+z^2}\right)^2}\\[6pt]
&=\int_{-\infty}^\infty\frac{2(1+z^2)\,\mathrm{d}z}{((a+b)+(a-b)z^2)^2}\\[6pt]
&=\color{#C00000}{\int_{-\pi/2}^{\pi/2}\frac{2\left(1+\frac{a+b}{a-b}\tan^2(u)\right)\sqrt{\frac{a+b}{a-b}}\sec^2(u)\mathrm{d}u}{(a+b)^2\sec^4(u)}}\\[6pt]
&=\frac{2}{(a^2-b^2)^{3/2}}\int_{-\pi/2}^{\pi/2}\left(a+b-2b\cos^2(u)\right)\,\mathrm{d}u
\end{align}
$$
where we have substituted $z=\color{#C00000}{\sqrt{\frac{a+b}{a-b}}\;\tan(u)}$. The last integral is very easy.
