Analytical form of an integral I'm trying to find the analytical form of the following integral:
$$\int_0^{2\pi}\left|\frac{(1-i\cos(\phi))}{(1+a-i\cos(\phi))}\right|^2d\phi$$
I've tried in Wolfram Alpha, which ran out of free calculation time, and in Mathematica I get the original expression for the indefinite integral and the program stays in the "Running..." state for several minutes, when evaluating the definite integral, and I stopped it.
However, I am reading a paper, which says there is an analytical expression for this integral, and also to me it seems rather straightforward. Any hints?

We have
\begin{align*}
\int_0^{2\pi} \left| \frac{1- i \cos(\phi)}{1+a-i\cos(\phi)} \right|^2 d\phi &= \int_0^{2\pi} \frac{1+\cos^2\phi}{(1+a)^2 + \cos^2\phi} d\phi\\
& = \int_0^{2\pi} \left[1 - \frac{a^2+2a}{(1+a)^2 + \cos^2\phi}\right]d\phi\\
& = 2\pi - 2(a^2+2a)\int_{-\pi/2}^{\pi/2} \frac{1}{(1+a)^2+\cos^2\phi}d\phi\\
& = 2\pi - 2(a^2+2a)\int_{-\pi/2}^{\pi/2} \frac{1}{(1+a)^2 \sin^2 \phi + [1+(1+a)^2]\cos^2\phi}d\phi\\
& = 2\pi - 2(a^2+2a)\int_{-\pi/2}^{\pi/2} \frac{\sec^2\phi}{(1+a)^2 \tan^2 \phi + [1+(1+a)^2]}d\phi.
\end{align*}
Now let $u=\frac{|1+a|}{\sqrt{a^2+2a+2}}\tan\phi$, getting
$$
2\pi - 2\frac{(a^2+2a)}{|1+a|\sqrt{a^2+2a+2}}\int_{-\infty}^{\infty} \frac{1}{u^2 + 1}du= 2\pi - \frac{2\pi(a^2+2a)}{|1+a|\sqrt{a^2+2a+2}}.
$$
