Computing $\int_{0}^{\infty} \frac{x^2}{(x^2 + a^2)^2}dx$ I want to compute  $$\int_{0}^{\infty} \frac{x^2}{(x^2 + a^2)^2}dx$$ and have tried applying trig substution with $x = a\tan(t)$, but things get a bit messy at the very end. I get
$$ \left [ \frac{1}{3}\tan^3(\arctan(\frac{x}{a}) - \tan(\arctan(x/a)) + \arctan(\frac{x}{a})) \right ]_{0}^{\infty}$$
Can anyone confirm that this is what we get? Or offer a better way?
 A: Assuming $a>0$ we have:
$$\int_{0}^{+\infty}\frac{x^2\,dx}{(x^2+a^2)^2}=\int_{0}^{+\infty}\frac{dx}{\left(x+\frac{a^2}{x}\right)^2}=\frac{1}{a}\int_{0}^{+\infty}\frac{dz}{(z+\frac{1}{z})^2}\tag{1}$$
but since the substitution $z=\tan t$ leads to:
$$\int_{0}^{+\infty}\frac{dz}{(z+\frac{1}{z})^2}=\int_{0}^{\pi/2}\sin^2 t\,dt = \frac{\pi}{4}\tag{2}$$
we have:
$$\int_{0}^{+\infty}\frac{x^2\,dx}{(x^2+a^2)^2}=\frac{\pi}{4|a|}.\tag{3}$$
A: The following line is about primitives and contains a partial integration:
$${1\over a}\arctan{x\over a}+C=\int 1\cdot{1\over a^2+x^2}\>dx={x\over a^2+x^2}+\int{2x^2\over(a^2+x^2)^2}\>dx\ .$$
A: Integration by parts simplifies things to a common form:
$$
\begin{align}
\int_0^\infty\frac{x^2}{(x^2 + a^2)^2}\,\mathrm{d}x
&=\frac12\int_0^\infty\frac{x}{(x^2 + a^2)^2}\,\mathrm{d}x^2\\
&=-\frac12\int_0^\infty x\,\mathrm{d}\frac1{x^2 + a^2}\\
&=\frac12\int_0^\infty\frac1{x^2 + a^2}\,\mathrm{d}x\\[3pt]
&=\frac\pi{4|a|}
\end{align}
$$
A: $$\int_{0}^{\infty} \frac{x^2}{(x^2 + a^2)^2}dx=\int_{0}^{\pi/2}\frac{a^2\tan^2t}{a^3\sec^3t}a\sec^2tdt=\int_0^{\pi/2}\sin t\tan tdt=\int_0^{\pi/2}(\sec t-\cos t)dt=\left(\ln|\sec t+\tan t|-\sin t\right)_0^{\pi/2}=...$$
A: if you make the substitution $x=az$ then:
$$
I_a = \int_0^\infty \frac{ a^2z^2 adz}{a^4(1+z^2)^2}dz= \frac1{a}I_1
$$
$$
I_1 = \int_0^\infty \frac{dz}{1+z^2} - \int_0^\infty\frac{ dz}{(1+z^2)^2}dz
 \tag{1}$$
by substituting $z=\frac1{t}$ the second integral in (1) evaluates to $I_1$ so $I_1=\frac\pi{4}$ and
$$
I_a = \frac\pi{4a}
$$
A: A better way of doing it is use partial fractions to get the two integrals
\begin{equation*}
\frac{1}{a^2}\int\frac{1}{\frac{x^2}{a^2}+1}dx-a^2\int\frac{1}{(a^2+x^2)^2}dx.
\end{equation*}
Use the substitution $u=\frac{x}{a}$ for first integral and $x=a\tan(s)$ for the second integral. 
