<s>[INST] Calculus Integral from Partial Fractions When you have an irreducible quadratic factor repeated you can get integrals that look like $\int \dfrac{dx}{(x^2+a)^m}$, where $m>1$, integer, and $a>0$.  What is the best way to integrate this function?  Is there more than one way?
 [/INST] The recurrence relation derived by Jack D'Aurizio in his answer above can actually be solved explicitly for $I_m$. First let me quote it below, but changing the recurrence index to $n$:

$$
I_{n+1} = \frac{2n+1}{2n}\,I_{n} + f_n(t)
\qquad (n \ge 1) \qquad (1)
$$
  where
  $$
\begin{align}
I_0 &= t \\[0.05in]
I_1 &= \arctan(t) \\[0.05in]
f_n(t) &\equiv \frac{1}{2n}\frac{t}{(1+t^2)^n} \qquad (n \ge 1)
\end{align}
$$

Now define the quantity

$$
P_{n} \equiv \prod_{k\,=\,1}^{n} \left(\frac{2k+1}{2k}\right)
           = \prod_{k\,=\,1}^{n} \left(1 + \frac{1}{2k}\right)
$$

Then, dividing (1) by $P_n$, we find
$$
\frac{I_{n+1}}{P_{n}} - \left(\frac{2n+1}{2n}\right)\frac{I_{n}}{P_{n}} = \frac{f_n}{P_{n}}
$$
Since
$$
P_{n} = \left(\frac{2n+1}{2n}\right)P_{n-1}
$$
we have
$$
\frac{I_{n+1}}{P_{n}} - \frac{I_{n}}{P_{n-1}} = \frac{f_n}{P_{n}}
$$
Now sum both sides on $n$:
$$
\sum_{n\,=\,2}^{m-1} \left( \frac{I_{n+1}}{P_{n}} - \frac{I_{n}}{P_{n-1}} \right)= \sum_{n\,=\,2}^{m-1} \frac{f_n}{P_{n}}
$$
The LHS telescopes, so
$$
\frac{I_{m}}{P_{m-1}} - \frac{I_{2}}{P_{1}} = \sum_{n\,=\,2}^{m-1} \frac{f_n}{P_{n}}
$$
and
$$
I_{m} = P_{m-1} \left(
\frac{I_{2}}{P_{1}} + \sum_{n\,=\,2}^{m-1} \frac{f_n}{P_{n}} \right) = P_{m-1} \left(
\frac{I_{2}}{P_{1}} - \frac{f_1}{P_{1}} + \sum_{n\,=\,1}^{m-1} \frac{f_n}{P_{n}} \right) = P_{m-1} \left(
I_1 + \sum_{n\,=\,1}^{m-1} \frac{f_n}{P_{n}} \right)
$$
where (1) was used in the last equality to remove $I_2$.
Hence,

$$
I_{m} = P_{m-1} \left(
\arctan(t) + \sum_{n\,=\,1}^{m-1} \frac{t\,(1+t^2)^{-n}}{2n\,P_{n}} \right)
\qquad (m \ge 2)
$$

</s>