Solution 1:

Hint The appearance of the term in $\frac{x}{(a x^2 + b)^{n - 1}}$ suggests applying integration by parts with $dv = dx$ and thus $u = (a x^2 + b)^{-n}$. Renaming $n$ to $m$ we get $$I_m = u v - \int v \,du = \frac{x}{(a x^2 + b)^m} + 2 m \int \frac{a x^2 \,dx}{(a x^2 + b)^{m + 1}} .$$ Now, the integral on the right can be rewritten as a linear combination $p I_{m + 1} + qI_m$, so we can solve for $I_{m + 1}$ in terms of $I_m$ and replace $m$ with $n - 1$.