<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] Furthermore, I am going to find the integral in general
$$
I_{n}=\int \frac{1}{\left(x^{2}+a^{2}\right)^{n}} d x
$$
by a reduction formula by noting that
$$
\begin{aligned}
\frac{d}{d x}\left[\frac{x}{\left(x^{2}+a^{2}\right)^{n}}\right] &=\frac{a^{2}+(1-2 n) x^{2}}{\left(x^{2}+a^{2}\right)^{n+1}} \\
&=\frac{1}{\left(x^{2}+a^{2}\right)^{n}}-2 n \cdot \frac{x^{2}+a^{2}-a^{2}}{\left(x^{2}+a^{2}\right)^{n+1}} \\
&=\frac{1}{\left(x^{2}+a^{2}\right)^{n}}-2 n\left[\frac{1}{\left(x^{2}+a^{2}\right)^{n}}-\frac{a^{2}}{\left(x^{2}+a^{2}\right)^{n+1}}\right]
\end{aligned}
$$
Integrating both sides w.r.t. $x$ yields $$
\boxed{I_{n+1}=\frac{x}{2 n a^{2}\left(x^{2}+a^{2}\right)^{n}}+\frac{2 n-1}{2 n a^{2}} I_{n}}
$$
In particular, when $n=2$,
$$
\begin{aligned}
I_{3} &=\frac{x}{4 a^{2}\left(x^{2}+a^{2}\right)^{2}}+\frac{3}{4 a^{2}} I_{2} \\
&=\frac{x}{4 a^{2}\left(x^{2}+a^{2}\right)^{2}}+\frac{3}{4 a^{2}}\left[\frac{x}{2 a^{2}\left(x^{2}+a^{2}\right)}+\frac{1}{2 a^{2}} I_{1}\right] \\
&=\boxed{\frac{x}{4 a^{2}\left(x^{2}+a^{2}\right)^{2}}+\frac{3 x}{8 a^{4}\left(x^{2}+a^{2}\right)}+\frac{3}{8 a^{5}} \tan ^{-1} \frac{x}{a}+C}
\end{aligned}
$$
</s>