<s>[INST] Find $ \int \frac{dx}{(x^2 + a^2)^3} $ I would like to find the anti-derivative
$$\displaystyle \int \dfrac{dx}{(x^2 + a^2)^3 }$$
My attempt:
By substitution:  $ x = a \tan(\theta)  \Rightarrow dx = a \sec^2(\theta) d\theta$
Then the integral becomes
$$\displaystyle \int \dfrac{ a \sec^2(\theta) d\theta }{a^6 \sec^6(\theta) } $$
And this reduces to
$$\dfrac{1}{a^5}  \displaystyle \int  \cos^4(\theta)  d\theta $$
Now, $\cos^4(\theta) = ( \cos^2(\theta) )^2 = \dfrac{1}{4} (1 + \cos(2 \theta) )^2 = \dfrac{1}{4} ( 1 + 2 \cos(2 \theta) + \cos^2(2 \theta) ) $
So this reduces to
$$ \cos^4(\theta) = \dfrac{1}{4} + \dfrac{1}{2} \cos(2 \theta) + \dfrac{1}{8} (1 + \cos(4 \theta) ) $$
and these are integrable easily, but I want to relate their integrals to the original variable $x$.
So, now I have the anti-derivative as
$$ \dfrac{3}{8} \theta + \dfrac{1}{4} \sin(2 \theta) + \dfrac{1}{32} \sin(4 \theta) $$
Since $ x = a \tan(\theta) $, then $ \cos(\theta) = \dfrac{a}{\sqrt{x^2 + a^2}}$, and $\sin(\theta) = \dfrac{x}{\sqrt{x^2 + a^2}} $
Hence
$$\sin(2 \theta) = \dfrac{ 2 a x }{x^2 + a^2} $$
$$\cos(2 \theta) = \dfrac{a^2 - x^2}{x^2 + a^2} $$
And finally,
$$\sin(4 \theta) = \dfrac{4 a x (a^2 - x^2) }{ (x^2 + a^2)^2} $$
Hence, my integral becomes
$$ \displaystyle \int \dfrac{dx}{(x^2 + a^2)^3} = \dfrac{1}{a^5}\left( \dfrac{3}{8} \tan^{-1}\left(\dfrac{x}{a}\right) + \dfrac{1}{2} \dfrac{a x }{x^2 + a^2} + \dfrac{1}{8} \dfrac{ a x (a^2 - x^2) }{ (x^2 + a^2)^2 } \right) + C $$
where $C$ is an arbitrary constant of integration.
And my question is: Are my approach and derivation correct?
 [/INST] Alternatively, integrate by parts to avoid the trig substitution
\begin{align}
I_3=&\int \frac{1}{(x^2 + a^2)^3 }dx
=\int \frac{1}{4a^2x^3}d\left(\frac{x^4}{ (x^2 + a^2)^2}\right)
= \frac{x}{4a^2 (x^2 + a^2)^2}+\frac3{4a^2}I_2\\
I_2=&\int \frac{1}{(x^2 + a^2)^2}dx
=\int \frac{1}{2a^2x}d\left(\frac{x^2}{ x^2 + a^2}\right)
=\frac{x}{2a^2 (x^2 + a^2)}+\frac1{2a^2}I_1\\
I_1=&\int \frac{1}{x^2 + a^2}dx= \frac1a \tan^{-1}\frac xa
\end{align}
which leads to
$$I_3
= \frac{x}{4a^2 (x^2 + a^2)^2}+ \frac{3x}{8a^4 (x^2 + a^2)}+
\frac{3}{8a^5}\tan^{-1}\frac xa +C
$$
</s>