How to evaluate $\int \frac1{(x^2+a^2)^{m}}dx$ The integral $$\int\frac{1}{(x^2+a^2)^m}dx$$ can be expressed by a recursive formula of $$\frac{1}{2a^2(m-1)}\frac{x}{(x^2+a^2)^{m-1}} + \frac{2m-3}{2a^2(m-1)}\int\frac{dx}{(x^2+a^2)^{m-1}}$$ I do not understand how integration by part leads to this result. Specifically, since $$\int u dv = uv - \int v du$$ I want to know what is $u$, $du$, $v$, $dv$.
 A: Integrate by parts as follows
\begin{align}
&\int\frac{1}{(x^2+a^2)^m}dx\\
= &\int \frac1{2a^2(m-1)x^{2m-3}}\ d\left[\bigg(\frac{x^2}{x^2+a^2} \bigg)^{m-1}\right]\\
=&\  \frac{1}{2a^2(m-1)}\frac{x}{(x^2+a^2)^{m-1}} + \frac{2m-3}{2a^2(m-1)}\int\frac{1}{(x^2+a^2)^{m-1}}dx
\end{align}
Thus
$$u= \frac1{2a^2(m-1)x^{2m-3}},\>\>\>\>\>
v= \left(\frac{x^2}{x^2+a^2} \right)^{m-1} $$
A: We have
$$J = \int\dfrac{dx}{(x^2+a^2)^m} = \dfrac1{a^2}\int\dfrac{(a^2+x^2)-x^2}{(x^2+a^2)^m}dx$$
and hence
$$J = \dfrac1{a^2}\int\dfrac{dx}{(x^2+a^2)^{m-1}} - \dfrac1{a^2}\int\dfrac{x^2}{(x^2+a^2)^m}dx$$
which gives
$$J = \dfrac1{a^2}\int\dfrac{dx}{(x^2+a^2)^{m-1}} + \dfrac{1}{2a^2(m-1)}\int x\,d\, \dfrac1{(x^2+a^2)^{m-1}}$$
Integrating by parts, we get
$$J = \dfrac1{a^2}\int\dfrac{dx}{(x^2+a^2)^{m-1}} + \dfrac{1}{2a^2(m-1)} \dfrac {x}{(x^2+a^2)^{m-1}} - \dfrac{1}{2a^2(m-1)}\int \dfrac{dx}{(x^2+a^2)^{m-1}}$$
and hence
$$J = \dfrac{1}{2a^2(m-1)} \dfrac {x}{(x^2+a^2)^{m-1}} + \dfrac{2m-3}{2a^2(m-1)}\int \dfrac{dx}{(x^2+a^2)^{m-1}}$$
