<s>[INST] Reduction formula for $\int\frac{dx}{(x^2+a^2)^n}$ How can I use integration by parts to write $$\int\frac{dx}{(x^2+a^2)^n} = \frac{x}{2a^2(n-1)(x^2+a^2)^{n-1}}+\frac{2n-3}{2a^2(n-1)}\int\frac{dx}{(x^2+a^2)^{n-1}}?$$
I would try $$u=\frac{1}{(x^2+a^2)^n},du=\frac{-2nx}{(x^2+a^2)^{n+1}}dx; dv=dx,v=x.$$ Integration by parts implies $$\int\frac{dx}{(x^2+a^2)^n}=\frac{x}{(x^2+a^2)^n}+2n\int\frac{x^2}{(x^2+a^2)^{n+1}}\\=\frac{x}{(x^2+a^2)^n}+2n\int\frac{(x^2+a^2)-a^2}{(x^2+a^2)^{n+1}}\\=\frac{x}{(x^2+a^2)^n}+2n\int\frac{1}{(x^2+a^2)^{n}}-2na^2\int\frac{dx}{(x^2+a^2)^{n+1}}$$ but I don't think I'm doing this correctly since the power of the denominator $(x^2+a^2)$ is not decreasing.
 [/INST] Let $a\neq0$, $n\in\mathbb{N}$ and define, $$I_n:=\int{\frac{dx}{(x^2+a^2)^n}}$$
So, If we use integral by parts, we have $$I_n = \frac{x}{(x^2+a^2)^n}+2n\int{\frac{x^2}{(x^2+a^2)^{n+1}}dx}\qquad(*)$$
On the other hand, is clear that $$I_n=\int{\frac{x^2}{(x^2+a^2)^{n+1}}dx}+a^2\int{\frac{dx}{(x^2+a^2)^{n+1}}}=\int{\frac{x^2}{(x^2+a^2)^{n+1}}dx}+a^2I_{n+1}\qquad(**)$$
Now using $(*)$ and $(**)$, follows that $$I_n=\frac{x^2}{(x^2+a^2)^{n}}+2n(I_n-a^2I_{n+1})\implies I_{n+1}=\frac{1}{2a^{2}n}\left(\frac{x}{(x^2+a^2)^n}-(1-2n)I_n\right)$$
In particular, if we replace $n$ by $n-1$, we have 
$$I_n=\frac{1}{2a^{2}(n-1)}\left(\frac{x}{(x^2+a^2)^{n-1}}-(3-2n)I_{n-1}\right)$$
</s>