Integral of $x^2/(x^2 + \alpha^2)^2$ I want to find the indefinite integral 
$$\int\frac{x^2}{(x^2 + \alpha^2)^2}\,dx.$$
The answer (from Mathematica) is
$$-\frac{x}{2(x^2+\alpha^2)} + \frac{1}{2\alpha}\tan^{-1}\left(\frac{x}{\alpha}\right).$$
I can tell from the answer that there must be some integration by parts and some sort of trig substitution, but I can't seem to get it to work. Any ideas?
 A: hint: $x^2 = (x^2+\alpha^2) - \alpha^2$, and use $x = \alpha\cdot \tan \theta$ for each of the $2$ integrals that resulted from the split.
A: Hint:
Write $\;\dfrac{x^2}{(x^2+\alpha^2)^2}=\dfrac{1}{(x^2+\alpha^2)}-\dfrac{\alpha^2}{(x^2+\alpha^2)^2},\;$  and integrate by parts $\displaystyle \int\frac{\mathrm d\mkern1mu x}{x^2+\alpha^2}$ to  obtain a relation between $
\displaystyle \int\frac{\mathrm d\mkern1mu x}{(x^2+\alpha^2)^2}$ and  $\;
\displaystyle \int\frac{\mathrm d\mkern1mu x}{x^2+\alpha^2}$.
The latter is known to be $\;\dfrac1\alpha\,\arctan\Bigl(\dfrac x\alpha\Bigr)$.
A: The usual method of trigonometrical substitution would suggest to put 
\begin{align*}
x&=a\cdot \tan\theta\\
dx&=a\cdot \sec^2\theta\,d\theta
\end{align*}
and go on. We obtain
\begin{align*}
\int \dfrac{x^2}{(x^2+a^2)^2}\,dx&=\int \dfrac{a^2\tan^2\theta}{(a^2\tan^2\theta+a^2)^2}\,a\sec^2\theta\,d\theta\\
&=\int \dfrac{a^2\tan^2\theta}{(a^2(1+\tan^2\theta))^2}\,a\,\sec^2\theta\,d\theta\\
&=\int \dfrac{a^3\tan^2\theta \sec^2\theta}{a^4(\sec^2\theta)^2}\,d\theta\\
&=\int \dfrac{\tan^2\theta}{a\sec^2\theta}\,d\theta\\
&=\dfrac{1}{a}\int \dfrac{\dfrac{\sin^2\theta}{\cos^2\theta}}{\dfrac{1}{\cos^2\theta}}d\theta\\
&=\dfrac{1}{a}\int \sin^2\theta\,d\theta\\
&=\dfrac{1}{a}\int \dfrac{1-cos(2\theta)}{2},d\theta\\
&=\dfrac{1}{2a}\theta - \dfrac{1}{4a}\sin(2\theta)+C.
\end{align*}
To recover the original variables we do:
\begin{align*}
\tan\theta=\dfrac{x}{a} &\Rightarrow \sin\theta=\dfrac{x}{\sqrt{x^2+a^2}} \text{ and } \cos\theta=\dfrac{a}{\sqrt{x^2+a^2}}\\
&\Rightarrow \sin(2\theta)=2\sin\theta\cos\theta=\dfrac{2ax}{x^2+a^2}\\
&\\
\tan\theta=\dfrac{x}{a} &\Rightarrow \theta=arctan\left(\dfrac{x}{a}\right)
\end{align*}
Obtaining the following:
\begin{align*}
\int \dfrac{x^2}{(x^2+a^2)}\,dx&=-\dfrac{1}{4a}\sin(2\theta) + \dfrac{1}{2a}\theta + C\\
&=-\dfrac{1}{4a}\dfrac{2ax}{x^2+a^2}+\dfrac{1}{2a}\arctan\left(\dfrac{x}{a}\right)+C\\
&=-\dfrac{x}{2(x^2+a^2)}+\dfrac{1}{2a}\arctan\left(\dfrac{x}{a}\right)+C
\end{align*}
A: $\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{{#1}}\,}
 \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}
\int{x^{2} \over \pars{x^{2} + \alpha^{2}}^{2}}\,\dd x & =
\int{\dd x \over x^{2} + \alpha^{2}}\,\dd x -
\alpha^{2}\int{\dd x\over \pars{x^{2} + \alpha^{2}}^{2}} =
\pars{1 + {1 \over 2}\,\alpha\,\partiald{}{a}}
\int{\dd x \over x^{2} + \alpha^{2}}
\\[5mm] & =
\pars{1 + {1 \over 2}\,\alpha\,\partiald{}{a}}
\int{\dd x \over x^{2} + \alpha^{2}} =
\pars{1 + {1 \over 2}\,\alpha\,\partiald{}{a}}
\bracks{\alpha^{-1}\arctan\pars{x \over \alpha}}
\\[5mm] & =
\alpha^{-1}\arctan\pars{x \over \alpha} +
{1 \over 2}\,\alpha\bracks{-\alpha^{-2}\arctan\pars{x \over \alpha} +
\alpha^{-1}\,{-x/\alpha^{2} \over \pars{x/\alpha}^{2} + 1}}
\\[5mm] & =
\alpha^{-1}\arctan\pars{x \over \alpha} -
{1 \over 2\alpha}\arctan\pars{x \over \alpha} -
{1 \over 2}\,{x \over x^{2} + \alpha^{2}}
\\[5mm] & = \bbx{\ds{%
-\,{x \over 2\pars{x^{2} + \alpha^{2}}} + 
{1 \over 2\alpha}\arctan\pars{x \over \alpha}}}
\end{align}
