# Integrating a partial fraction with multiple quadratic denominators

When integrating a real rational fraction, you first break it into partial fractions. You then end up with fractions with linear denominators $\frac{A}{(x-b)^n}$, which are easy. You also end up with quadratic denominators $\frac{Ax+B}{(x+ax+b)^n}$. I cannot find a straight forward explanation for solving that second general case anywhere online. I might be missing an obvious google result, but I just cannot find one. There are of course multiple SE questions about this, but they're about specific problems. I'd like to ask about the general case:

What is $$\int \frac{Ax+B}{(x^2+ax+b)^n} dx$$ ?

I can reduce it to the case $\frac{1}{(x^2+ax+b)^n}$ easily. Then I tried completing the square, thus obtaining the form (where a, b, and c are different constants to the ones above):

$$\int \frac{1}{((x+b)^2+c)^n} dx=\frac{1}{\sqrt c}\int \frac{\frac{1}{\sqrt c}}{((\frac{x+b}{\sqrt c})^2+1)^n} dx =\frac{1}{\sqrt c}\int \frac{1}{\sqrt c}\arctan'(\frac{x+b}{\sqrt c})^n dx$$ $$=\frac{1}{\sqrt c}\int \arctan'(\frac{x+b}{\sqrt c})^n d(\frac{x+b}{\sqrt c})$$ Setting $u=\frac{x+b}{\sqrt c}$ for readability, I experimented with:

$$\frac{1}{\sqrt c}\int \arctan'(u)^n du=\frac{1}{\sqrt c}\int \arctan'(u)^{n-1} d\arctan(u)$$

And that's a dead-end, for me.

-
You might write $(x^2+ax+b)=(x-x_1)(x-x_2)$, even if the roots are complex. – Hagen von Eitzen May 10 '13 at 20:43
Complete the square. We end up wanting to integrate $\frac{1}{(x^2+1)^n}$. This can be handled by a Reduction Formula. For example, since this is discussed at the beginning of the linked article, let $x=\tan \theta$. We end up integrating $\cos^{2n-2}\theta$. But trig substitution is not necessary. A more appropriate reduction formula is mentioned later in the article. Reduction formulas are mostly done by integration by parts, let $u=\frac{1}{(x^2+1)^{n-1}}$ and $dv=dx$. – André Nicolas May 10 '13 at 20:56
Perhaps this answer will help: math.stackexchange.com/a/689932/1242 – Hans Lundmark Feb 25 '14 at 15:19
@HansLundmark Thanks for the link -- I can always stand to add more techniques to my collection, and taking or teaching courses doesn't get to all of the "good stuff". – RecklessReckoner Feb 28 '14 at 23:18

As André Nicolas describes, the end result will come down to generating some sort of reduction formula. With the techniques we learn a little way into integral calculus,

$$\int \frac{Ax+B}{(x^2 + ax + b)^n} \ dx$$

can be "stripped down" using completion of squares to

$$\frac{A}{2}\int \ \frac{[2x + a] }{( \ [x + \frac{a}{2}]^2 + [b - \frac{a^2}{4}] \ )^n} \ dx \ \ + \ \ \int \ \frac{ B - \frac{Aa}{2} }{( \ [x + \frac{a}{2}]^2 + [b - \frac{a^2}{4}] \ )^n} \ dx \ ,$$

so that the real work comes down to integrating the part with the constant in the numerator,

$$\int \frac{C}{( \ u^2 + \beta^2 )^n} \ du \ \ , \text{with} \ \ u \ = \ x + \frac{a}{2} \ \ , \ \ \beta^2 \ = \ b - \frac{a^2}{4} \ \ . \ \ \ \mathbf{[ 1 ] }$$

This is what suggests using a "chain" of integrations-by-parts with a trig substitution.

EDITS (2/28/14) -- Although this answer was accepted recently, I'd been meaning to return to it at some point, in part to correct an algebra error, and in part to elaborate on the integration chain [and later to fix a different mistake made in the "wee hours"].

The sum of squares in the denominators calls for a "tangent substitution", $\ \tan \theta = \frac{u}{\beta} \ ,$ leading to

$$\longrightarrow \ \ C \ \int \ \frac{\beta \ \sec^2 \theta \ \ d\theta}{( \ \beta^2 \sec^2 \theta \ )^n} \ \ = \ \ \frac{C}{\beta^{2n-1}} \int \ \cos^{2n-2} \theta \ \ d\theta \ \ . \ \ \ \mathbf{[ 2 ] }$$

To make the integration-by-parts a bit more readable, I am switching the exponent of cosine to $\ 2m \$ for the present; the reduction formula is obtained from

$$\int \ \cos^{2m} \theta \ \ d\theta \ = \ \int \ (\cos^{2m-1} \theta) \ \cdot \ (\cos \theta \ \ d\theta) \ = \ \int \ (\cos^{2m-1} \theta) \ \ d( \sin \theta \ )$$

$$= \ \sin \theta \ \cos^{2m-1} \theta \ \ - \ \int \ (\sin \theta) \ \cdot \ (2m-1) \ (\cos^{2m-2} \theta \ [-\sin \theta \ ] \ \ d\theta)$$

$$= \ \sin \theta \ \cos^{2m-1} \theta \ \ + \ \ (2m-1) \int \ \sin^2 \theta \ \ \cos^{2m-2} \theta \ \ d\theta$$

$$= \ \sin \theta \ \cos^{2m-1} \theta \ \ + \ \ (2m-1) \int \ \ (1 - \cos^2 \theta) \ \cos^{2m-2} \theta \ \ d\theta$$

$$= \ \sin \theta \ \cos^{2m-1} \theta \ \ + \ \ (2m-1) \int \ \cos^{2m-2} \theta \ \ d\theta \ \ + \ \ (2m-1)\int \ \cos^{2m} \theta \ \ d\theta$$

$$\Rightarrow \ \ 2m \ \int \ \cos^{2m} \theta \ \ d\theta \ = \ \sin \theta \ \cos^{2m-1} \theta \ \ + \ \ (2m-1) \int \ \cos^{2m-2} \theta \ \ d\theta$$

$$\Rightarrow \ \ \int \ \cos^{2m} \theta \ \ d\theta \ = \ \left( \frac{1}{2m} \right) \sin \theta \ \cos^{2m-1} \theta \ \ + \ \left( \frac{2m - 1}{2m} \right) \int \ \cos^{2m-2} \theta \ \ d\theta \ \ \ .$$

Applying this to the integral 2 above produces

$$\int \frac{C}{( \ u^2 + \beta^2 )^n} \ du$$

$$= \ \ \frac{C}{\beta^{2n-1}} \ \left[ \ \left( \frac{1}{2n - 2} \right) \sin \theta \ \cos^{2n-3} \theta \ \ + \ \left( \frac{2n - 3}{2n - 2} \right) \int \ \cos^{2n-4} \theta \ \ d\theta \ \right]$$

$$= \ \ C \ \left[ \ \left( \frac{1}{2n - 2} \right) \frac{u}{\beta^2 \ ( \ u^2 + \beta^2 )^{n-1} } \ + \ \left( \frac{[2n - 3]}{[2n - 2] \ [2n-4]} \right) \frac{u}{\beta^4 \ ( \ u^2 + \beta^2 )^{n-2} } \ + \ \ldots \ + \ \left( \frac{[2n - 3] \cdot \ \ldots \ \cdot 3}{[2n - 2] \ [2n-4] \cdot \ \ldots \ \cdot 4} \right) \frac{u}{\beta^{2n-2} \ ( \ u^2 + \beta^2 ) } \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ + \ \left( \frac{[2n - 3] \cdot \ \ldots \ \cdot 1}{[2n - 2] \ [2n-4] \cdot \ \ldots \ \cdot 2} \right) \arctan(\frac{u}{\beta} ) \ \right] \ + \ K \ \ .$$

 Here's an example run on WolframAlpha (with all terms placed over a single denominator, and the arctangent term appearing in the penultimate position):

-
I don't see how to work out the reduction formula. Do you use integration by parts? It just seems to complicate the integral rather than reduce it. – Jack M May 11 '13 at 16:53
[some while later]: I've gone back to revise my post and develop the reduction formula now. – RecklessReckoner Feb 28 '14 at 8:19