Compute $\int^{\pi/2}_0 \frac{dx}{(a^2\cos^2 x + b^2 \sin ^2 x)^2}$ I have tried solving this for about an hour and will probably resort to head banging in some time:
$$\int ^{\frac{\pi}{2}}_{0} \dfrac{dx}{(a^2\cos^2 x + b^2 \sin ^2 x)^2}$$
I first divided by $\cos^4 x$ and then subsequently put $\tan x = t$, to get:
$$\int ^{\infty}_{0} \dfrac{1+t^2}{(a^2 + b^2 t^2)^2}dt$$
This has become unmanageable. Neither splitting the numerator, nor Partial fraction (taking t^2 = z and applying partial fraction) seems to work. 
 A: Say that $ a, b >0 .$ From the substitution $t \mapsto \dfrac{a}{b}t$ followed by $ t \mapsto \dfrac{1}{t}$ we get
$$
I = \int_{0}^{\infty}\dfrac{1+t^{2}}{(a^{2}+b^{2}t^{2})^{2}}\, dt = \dfrac{1}{a^{3}b^{3}} \int_{0}^{\infty}\dfrac{b^2+a^2t^{2}}{(1+ t^{2})^{2}}\, dt
$$
and
$$
I = \dfrac{1}{a^{3}b^{3}} \int_{0}^{\infty}\dfrac{b^2t^2+a^2}{(1+ t^{2})^{2}}\, dt .
$$
Consequently
$$
2I = \dfrac{a^2+b^2}{a^3b^3}\int_{0}^{\infty}\dfrac{1}{1+t^2}\, dt = \dfrac{\pi}{2}\dfrac{a^2+b^2}{a^3b^3}
$$
and
$$
I = \dfrac{\pi}{4}\dfrac{a^2+b^2}{a^3b^3}.
$$
A: $f(z)=\frac{1+z^2}{(a^2+b^2 z^2)^2}$ is an even meromorphic function with double poles at $z=\pm\frac{a}{b}i$, that decays like $\frac{1}{|z|^2}$ as $|z|\to +\infty$. It follows that your integral equals
$$\pi i\cdot\text{Res}\left(f(z),z=\frac{a}{b}i\right)=\color{red}{\frac{\pi(a^2+b^2)}{4a^3b^3}} $$
due to the residue theorem and the ML lemma. For practicing headbanging, this is better.
A: $\newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\color{#f00}{\int_{0}^{\infty}
{1 + t^{2} \over \pars{a^{2} + b^{2}t^{2}}^{2}}\,\dd t} =
{1 \over \verts{b}^{3}}\int_{0}^{\infty}
{b^{2} + t^{2} \over \pars{a^{2} + t^{2}}^{2}}\,\dd t
\\[5mm] = &\
{1 \over \verts{b}^{3}}\bracks{\pars{b^{2} - a^{2}}\int_{0}^{\infty}
{\dd t \over \pars{t^{2} + a^{2}}^{2}} +
\int_{0}^{\infty}{\dd t \over t^{2} + a^{2}}}
\\[5mm] = &\
{1 \over \verts{b}^{3}}\bracks{\pars{a^{2} - b^{2}}\partiald{}{{a^{2}}} + 1}
\int_{0}^{\infty}{\dd t \over t^{2} + a^{2}} =
{1 \over \verts{b}^{3}}\bracks{\pars{a^{2} - b^{2}}\partiald{}{{a^{2}}} + 1}
{\pi \over 2}\pars{a^{2}}^{-1/2}
\\[5mm] = &\
{\pi \over 2\verts{b}^{3}}\braces{\pars{a^{2} - b^{2}}
\bracks{-\,{1 \over 2}\pars{a^{2}}^{-3/2}} + \pars{a^{2}}^{-1/2}} =
{\pi \over 4\verts{a}^{3}\verts{b}^{3}}\pars{-a^{2} + b^{2} + 2a^{2}}
\\[5mm] = &\
\color{#f00}{{\pi \over 4}\,{a^{2} + b^{2} \over \verts{a}^{3}\verts{b}^{3}}}
\end{align}
A: $$
\begin{align}
\int_0^\infty\frac{1+t^2}{(a^2+b^2t^2)^2}\,\mathrm{d}t
&=\frac1{a^3b}\int_0^\infty\frac{1+\frac{a^2}{b^2}t^2}{(1+t^2)^2}\,\mathrm{d}t\tag{1}\\
&=\frac1{2a^3b}\int_0^\infty\frac{t^{-1/2}+\frac{a^2}{b^2}t^{1/2}}{(1+t)^2}\,\mathrm{d}t\tag{2}\\
&=\frac1{2a^3b}\frac{\Gamma\left(\frac12\right)\Gamma\left(\frac32\right)}{\Gamma(2)}+\frac1{2ab^3}\frac{\Gamma\left(\frac32\right)\Gamma\left(\frac12\right)}{\Gamma(2)}\tag{3}\\[3pt]
&=\frac\pi4\frac{a^2+b^2}{a^3b^3}\tag{4}
\end{align}
$$
Explanation:
$(1)$: substitute $t\mapsto\frac abt$
$(2)$: substitute $t\mapsto t^{1/2}$
$(3)$: use the Beta Function integral
$(4)$: simplify
A: For a solution that doesn't involve complex analysis: Try the substitution $t = \frac{a}{b} \tan u$. Then $du = \frac{ab}{a^2 + b^2 t^2} \,dt$ and
your integral becomes
$$\frac{1}{a^3 b^3} \int_0^{\pi/2} (b^2 \cos^2 u + a^2 \sin^2 u) \,du$$
which is more doable.
