Partial Fractions

Rational functions – functions that only involve polynomials – are often ‘safe’ to integrate because we have a whole host of methods that can allow us to integrate pretty much any rational function. Now, this can often end up being quite long because of all the splitting and reshaping we have to do, but we can often look at an integral like

x+1x(x+2)(x2+1) dxint rac{x+1}{x(x+2)(x^2+1)} dx

and go, “yep, we can do this no problem.” It might just be a bit long. This is more likely to happen with arbitrary polynomials, but of course in recreational integration, we mathematicians love nice numbers. So there’s a good chance your polynomial(s) will factorise nicely in some way.

1x2+4x12 dx=1(x2)(x+4) dxint rac{1}{x^2+4x-12} dx = int rac{1}{(x-2)(x+4)} dx

When the denominator does factorise, we can use partial fractions to split the entire expression like so:

1(x2)(x+4) dx=18(1x21x+6)int rac{1}{(x-2)(x+4)} dx = rac{1}{8} left( rac{1}{x-2} - rac{1}{x+6} ight)

This reduces a large, messy fraction of polynomials into several smaller terms which are much easier to integrate.

Partial fractions is not technically an integration technique (it’s an algebraic manipulation that stands perfectly well on its own, and finds use outside of integration), but it’s essential for integrating fractions like this.

Splitting the Mind

We’ll start with the simplest case, where we have a constant numerator and factorised quadratic denominator:

1x25x+6 dx=1(x2)(x3) dxint rac{1}{x^2 - 5x + 6} dx = int rac{1}{(x-2)(x-3)} dx

We know we can write the above expression using partial fractions as

1(x2)(x3)=px2+qx3 rac{1}{(x-2)(x-3)} = rac{p}{x-2} + rac{q}{x-3}

The challenge now is to find the values of pp and qq.

If you’ve never done this before, it can be a bit mindblowing that you can solve 2 unknowns (or even more than 2, for cubics, quartics, etc.) from just a single equation! The reason we’re able to do so is that this equation hides a lot of very specific information, which we’ll see very soon.

Even if we might have no idea of where we’re going, we don’t like fractions when solving an equation. So let’s multiply through by each of the factors:

1(x2)(x3)=px2+qx31=p(x3)+q(x2)egin{align*} rac{1}{(x-2)(x-3)} &= rac{p}{x-2} + rac{q}{x-3} \ 1 &= p(x-3) + q(x-2) end{align*}

This removes the fraction on the left, and multiplies each of pp and qq by some xx terms. We can now expand and re-factorise:

1=px3p+qx2q1=(p+q)x+(3p2q)egin{align*} 1 &= px - 3p + qx - 2q \ 1 &= (p+q)x + (-3p - 2q) end{align*}

This looks like a polynomial equation, but we’re not actually solving for xx here! We’re trying to solve for the coefficients that guarantee the equation holds for all values of xx.

It’s not an equation for xx, but a relationship between 2 polynomials.

This is the crux here. It means the 2 sides of the equation must represent the same polynomial. That means we can compare the coefficients of each power of xx.

In this case, the left is a constant polynomial, which makes things very simple. The coefficients of x2x^2 and xx must both be 00, while the constant is 11. So we obtain a system of equations:

Equate powers of x2:0=0Equate powers of x1:p+q=0Equate powers of x0:3p2q=1egin{align} ext{Equate powers of }x^2: && 0 &= 0 \ ext{Equate powers of }x^1: && p + q &= 0 \ ext{Equate powers of }x^0: && -3p - 2q &= 1 end{align}

Which solves to give p=1p = -1 and q=1q = 1.

Cool stuff, eh? That 1 polynomial relation really encapsulated 3 individual equations.

We’ve found the values of our coefficients, so going back to our integral, we can now rewrite the fraction as

1(x2)(x3) dx=1x2+1x3 dxint rac{1}{(x-2)(x-3)} dx = int rac{-1}{x-2} + rac{1}{x-3} dx

These fractions have constant numerators and linear denominators, so they just become straight-up layer cake.

ln(x2)+ln(x3)+c-ln(x-2) + ln(x-3) + c

So, if we have any integral like

1ax2+bx+c dxint rac{1}{ax^2 + bx + c} dx

and we can factorise the denominator, then we can use partial fractions to split it into individual fractions which we can easily integrate.

In fact, we can integrate the reciprocal of any polynomial with partial fractions, as long as we can factorise it. Equating coefficients gives us a general framework for solving any partial fraction decomposition. Even if we have a higher degree polynomial:

1x3+5x2+2x8=1(x1)(x+2)(x+4)=px1+qx+2+rx+4egin{align*} rac{1}{x^3 + 5x^2 + 2x - 8} &= rac{1}{(x-1)(x+2)(x+4)} \ &= rac{p}{x-1} + rac{q}{x+2} + rac{r}{x+4} end{align*}

This means we have another power of xx to compare coefficients for, giving us another equation. 4 equations is more than enough to solve for 3 unknowns. So we will always have enough equations to solve for all the coefficients.

Cleansing the Mind

Solving the equations is great, and it’s wonderfully formulaic, but sometimes it’s just a bit long. Especially when you have many factors.

1(x1)(x+2)(x+4)=px1+qx+2+rx+41=p(x+2)(x+4)+q(x1)(x+4)+r(x1)(x+2)egin{align*} rac{1}{(x-1)(x+2)(x+4)} &= rac{p}{x-1} + rac{q}{x+2} + rac{r}{x+4} \ 1 &= p(x+2)(x+4) + q(x-1)(x+4) + r(x-1)(x+2) end{align*}

I mean, expanding that isn’t exactly that fun.

But remember that this equation holds true for all values of xx. So, we could just straight-up substitute in any value of xx that we want. Looking here, what values of xx would help us most in determining the values of pp, qq, rr?

Well, to solve for pp we’d want to get rid of qq and rr. And notice both of those variables have an (x1)(x-1) term attached. So if we let x=1x=1, those terms become 11=01-1=0, which erases qq and rr. This isn’t the case for pp, which stays behind, giving us a simple number-crunching equation to solve.

1=p(1+2)(1+4)+q(11)(1+4)+r(11)(1+2)1=15p+0q+0r1=15pp=1/15egin{align*} 1 &= p(1+2)(1+4) + q(1-1)(1+4) + r(1-1)(1+2) \ 1 &= 15p + 0q + 0r \ 1 &= 15p \ p &= 1/15 end{align*}

Woah, isn’t that so much faster?

Now you get the gist of it. How would we get rid of pp and rr, leaving qq? pp and rr have been multiplied by (x+2)(x+2), so let x=2x=-2 to make those become 00:

1=p(2+2)(2+4)+q(21)(2+4)+r(21)(2+2)1=0p+6q+0r1=6qq=1/6egin{align*} 1 &= p(-2+2)(-2+4) + q(-2-1)(-2+4) + r(-2-1)(-2+2) \ 1 &= 0p + -6q + 0r \ 1 &= -6q \ q &= -1/6 end{align*}

And finally, isolate rr by letting x=4x=-4:

1=p(4+2)(4+4)+q(41)(4+4)+r(41)(4+2)1=0p+0q+10r1=10rr=1/10egin{align*} 1 &= p(-4+2)(-4+4) + q(-4-1)(-4+4) + r(-4-1)(-4+2) \ 1 &= 0p + 0q + 10r \ 1 &= 10r \ r &= 1/10 end{align*}

There we go, 3 variables done and dusted. Hence:

1(x1)(x+2)(x+4)=115(x1)16(x+2)+110(x+4) rac{1}{(x-1)(x+2)(x+4)} = rac{1}{15(x-1)} - rac{1}{6(x+2)} + rac{1}{10(x+4)}

This is definitely my preferred way of solving partial fractions, although it won’t always carry you to the end. This is especially true for partial fractions with repeated roots, where things get a little spicier. Let’s take a look at those next.

Shattering the Mind

There are, broadly speaking, 3 types of partial fraction terms:

typeexamplesnotes
unique rootxx, (x2)(x-2), (15x)(1-5x)
repeated rootx2x^2, x3x^3, (x+1)2(x+1)^2The same factor of xx more than once.
irreducible quadratic(x2+1)(x^2 + 1), (x2+2x+3)(x^2 + 2x + 3)A degree 2 polynomial that can’t be factorised (has complex roots).

For instance, this full-flavour fraction:

1x3(x1)(x2+3) rac{1}{x^3(x-1)(x^2+3)}

Has in the denominator a unique root of (x1)(x-1), a repeated root of x3x^3, and an irreducible quadratic of x2+3x^2 + 3.

These 3 types of terms decompose differently.

Unique Root

Unique roots split as we’ve seen above, nothing special there.

1(x2)(x4)=px2+qx4 rac{1}{(x-2)(x-4)} = rac{p}{x-2} + rac{q}{x-4}

Repeated Roots

When we have the same expression raised to a power, we have to ‘count up’ the lower powers when expanding to partial fractions. So for a double repeated root:

1x3(x9)=px+qx2+rx3+sx9 rac{1}{x^3(x-9)} = rac{p}{x} + rac{q}{x^2} + rac{r}{x^3} + rac{s}{x-9}

Here we have terms over x1x^1, x2x^2 up to x3x^3, and along with the unique root.

Yes, this does mean extra variables to solve. It’s not very nice.

Irreducible Quadratic

But that’s nowhere near as not nice as having a quadratic you can’t factorise. We account for this by having a linear (degree 1 polynomial) numerator, which has 2 constants to solve for…

1x(x2+5)=px+qx+rx2+5 rac{1}{x(x^2+5)} = rac{p}{x} + rac{qx+r}{x^2+5}

The worst part is, even after solving for them, you might have to further manipulate that term to integrate it. If you’re lucky and the question’s been engineered nicely, it’ll already be arctan or layer cake, but if not, you’ll usually split it into 1 layer cake and 1 arctan. The arctan will probably have coefficients too, lol.