= Solution
Set $z=e^{i\theta}$. Then $d\theta=dz/(iz)$ and $\tan\theta=(z^2-1)/[i(z^2+1)]$, so the requested integral is
$$
I=\frac1i\oint_{|z|=1}f(z)\,dz,\qquad f(z)=\frac{(1+z^2)^2}{z[a^2(1+z^2)^2-(1-z^2)^2]}.
$$
The denominator factors as
$$
[(a-1)+(a+1)z^2][(a+1)+(a-1)z^2].
$$
For $0<a<1$, its two inner roots are $z=\pm r$, $r=\sqrt{(1-a)/(1+a)}<1$, and the other two roots have modulus $1/r>1$. There is also a <simple pole> at zero. Their <residues> are
$$
\operatorname{Res}_{0}f=\frac1{a^2-1},\qquad\operatorname{Res}_{\pm r}f=\frac1{2a(1-a^2)}.
$$
The latter values follow by differentiating the quadratic product, or from the supplied hint. The sum of the enclosed <residues> is
$$
-\frac1{1-a^2}+\frac1{a(1-a^2)}=\frac1{a(1+a)}.
$$
The <residue theorem> therefore gives
$$
\boxed{I=\frac{2\pi}{a(1+a)},\qquad\mathcal C=2\pi.}
$$
At the angles where the tangent is undefined, the original reciprocal has a removable zero limit. Its continuous extension gives the same integral; the transformed rational integrand has no <pole> on the <unit circle>.
Back to article page