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$.

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}}$$
