# Partial Fraction Decomposition

Partial Fraction Decomposition (PFD for short) is how we'll integrate rational functions, like $\dfrac{2x^2+3x}{x^3-6x+4}.$

It isn't actually a new integration technique; it's actually an algebraic technique that we can use to rewrite a rational function in a form that we already know how to integrate (using u-substitution).

We'll see how this works in a moment, but for now, let me show you the results of this process without worrying about how it's done.

Say we want to evaluate $\int \dfrac{1}{x^3+2x^2+x} \ dx$

This function is equal to a sum of simpler rational functions: $\dfrac{1}{x^3 + 2x^2 + x} = \dfrac{1}{x} - \dfrac{1}{x+1} - \dfrac{1}{(x+1)^2}$

Since we can integrate each of these functions individually, we can integrate the sum of them: \begin{aligned} \int \dfrac{1}{x^3+2x^2+x} \ dx &= \int \dfrac{1}{x} \ dx - \int \dfrac{1}{x+1} \ dx - \int \dfrac{1}{(x+1)^2} \ dx\ &= \ln x - \ln |x+1| + \dfrac{1}{x+1} + C \end{aligned}

I left out the u-substitution process, so if you're stuck on the integration above, you can go back and review the section on u-substitution.

Before we see how to do this decomposition process (breaking the complicated rational function into simpler ones), let's verify that the results are correct. This may be helpful when we see the decomposition process.

Start with the three rational functions and find a common denominator. The least common denominator is $x(x+1)^2$, so we'll multiply each fraction by that on top and on the bottom and combine the fractions: \begin{aligned} \dfrac{1}{x} - \dfrac{1}{x+1} - \dfrac{1}{(x+1)^2} &= \dfrac{1}{x} \cdot {\color{red}\dfrac{x(x+1)^2}{x(x+1)^2}} - \dfrac{1}{x+1} \cdot {\color{red}\dfrac{x(x+1)^2}{x(x+1)^2}} - \dfrac{1}{(x+1)^2} \cdot {\color{red}\dfrac{x(x+1)^2}{x(x+1)^2}}\ &= \dfrac{(x+1)^2}{x^3+2x^2+x} - \dfrac{x(x+1)}{x^3+2x^2+x} - \dfrac{x}{x^3+2x^2+x}\ &= \dfrac{(x+1)^2 - x(x+1) - x}{x^3+2x^2+x}\ &= \dfrac{1}{x^3+2x^2+x} \end{aligned}

# Decomposing Rational Functions

Now for the million-dollar question: how do we break a rational function down into simpler ones? Look at what we just did when we reversed this and combined fractions. $\dfrac{1}{x} - \dfrac{1}{x+1} - \dfrac{1}{(x+1)^2} = \dfrac{1}{x(x+1)^2}$

Notice that the individual denominators are factors of the combined denominator, which leads us to our first step.

## Step 1: Factor the denominator completely

In this example, to factor $x^3+2x^2+x$, start by factoring out the $x$ that's common to each term: $x^3+2x^2+x = x(x^2+2x+1)$ Then, factor $x^2+2x+1$ by finding what numbers add up to $2$ and multiply to $1$: $1$ and $1$. \begin{aligned} x^3+2x^2+x &= x(x^2+2x+1)\ &= x(x+1)(x+1)\ &= x(x+1)^2 \end{aligned}

## Step 2: Set up the sum of partial fractions

The denominators of the partial fractions will involve these factors. We'll come back to this step in a moment, because there are a few ways this can happen, but for now, take my word for it that it will look like this: $\dfrac{1}{x^3+2x^2+x} = \dfrac{A}{x} + \dfrac{B}{x+1} + \dfrac{C}{(x+1)^2}$

The numerators are still unknown, which is why we're using placeholders for them. Finding them is our next objective.

## Step 3: Find the numerators

There are two methods for doing this, so I'll show you both. I generally prefer the second method, but once you've seen both, you can pick which you find easier, and use that on each example.

We start with $\dfrac{1}{x^3+2x^2+x} = \dfrac{A}{x} + \dfrac{B}{x+1} + \dfrac{C}{(x+1)^2}$ Using either option, the first step is the same: clear the denominators on both sides by multiplying by left-hand side denominator: ${\color{red}x(x+1)^2} \cdot \dfrac{1}{x^3+2x^2+x} = {\color{red}x(x+1)^2} \cdot \dfrac{A}{x} + {\color{red}x(x+1)^2} \cdot \dfrac{B}{x+1} + {\color{red}x(x+1)^2} \cdot \dfrac{C}{(x+1)^2}$

On the left side, only its numerator will remain. On the right side, notice that some factors will cancel on each term. $\cancel{\color{red}x(x+1)^2} \cdot \dfrac{1}{\cancel{x^3+2x^2+x}} = {\color{red}\cancel{x}(x+1)^2} \cdot \dfrac{A}{\cancel{x}} + {\color{red}x(x+1)^{\cancel{2}}} \cdot \dfrac{B}{\cancel{x+1}} + {\color{red}x\cancel{(x+1)^2}} \cdot \dfrac{C}{\cancel{(x+1)^2}}$

Here's what's left: $1 = A(x+1)^2 + Bx(x+1) + Cx$

### Option 1: Expand and set coefficients equal to each other

Expand out the right-hand side: \begin{aligned} 1 &= A(x^2+2x+1) + B(x^2+x) + Cx\ 1 &= Ax^2 + 2Ax + A + Bx^2 + Bx + Cx \end{aligned}

If these two sides are equal, that means that all of the $x^2$'s on the left and the right match up, as do the $x$'s and the constants.

• $x^2$: there are none on the left, and $Ax^2$ and $Bx^2$ on the right: \begin{aligned} 0x^2 &= Ax^2 + Bx^2\ 0 &= A + B \end{aligned}

• $x$: again, there are none on the left, and $2Ax$, $Bx$, and $Cx$ on the right: \begin{aligned} 0x &= 2Ax + Bx + Cx\ 0 &= 2A + B + C \end{aligned}

• constants: there's a $1$ on the left, and an $A$ on the right: $1 = A$

Put all of that together, and we've got a system of three equations with three unknowns: \begin{aligned} 0 &= A + B\ 0 &= 2A + B + C\ 1 &= A \end{aligned}

It isn't that hard to solve, because the last line tells us immediately that $A=1$, and with that, the first line tells us that $B=-1$. Once we know those two, we can plug them into the second line and solve to find that $C=-1$.

And with that, we're done! \begin{aligned} \dfrac{1}{x^3+2x^2+x} &= \dfrac{A}{x} + \dfrac{B}{x+1} + \dfrac{C}{(x+1)^2}\ \dfrac{1}{x^3+2x^2+x} &= \dfrac{1}{x} + \dfrac{-1}{x+1} + \dfrac{-1}{(x+1)^2} \end{aligned}

### Option 2: Plug in test values for $x$

This is the method that I prefer. Go back to this line: $1 = A(x+1)^2 + Bx(x+1) + Cx$

If those two sides are equal, that means that if we plug any $x$ value into both sides, the answers will be equal. If we're clever about picking what values to plug in, we can find the coefficients.

Specifically, if we plug in $0$, the factor of $x$ will disappear; the last two terms on the right side will go away, leaving only an $A$ to solve for. Then, if we plug in $-1$, the $x+1$ factor will disappear.

• $x=0$: \begin{aligned} 1 &= A(1) + B(0) + C(0)\ 1 &= A \end{aligned}

• $x=-1$: \begin{aligned} 1 &= A(0) + B(0) + C(-1)\ 1 &= -C\ -1 &= C \end{aligned}

We now know $A$ and $C$. To find $B$, we need to plug in a third test value. There aren't any other factors that will disappear with carefully chosen values, so we just need to pick any value at all, say $1$. We can then plug in what we know and find the unknown $B$.

• $x=1$: \begin{aligned} 1 &= A(1+1)^2 + B(1)(1+1) + C(1)\ 1 &= 4A + 2B + C\ 1 &= 4(1) + 2B + (-1)\ 1-4+1 &= 2B\ -1 &= B \end{aligned}

We found the same values as we did with Option 1, so again, you can pick whichever method you prefer.

## Back to Step 2: setting up the partial fractions

The last missing piece of this process is how to set up the initial form of the partial fractions.

In other words, after factoring $x^3+2x^2+x$ into $x(x+1)^2$, how did that lead directly to $\dfrac{A}{x} + \dfrac{B}{x+1} + \dfrac{C}{(x+1)^2}?$

It all depends on the factored form of the denominator.

### Case 1: all linear factors (of the form $ax+b$) with no repetition

In this case, each factor will get its own fraction. For example: $\dfrac{3x+5}{(x+1)(x+2)(x+6)} = \dfrac{A}{x+1} + \dfrac{B}{x+2} + \dfrac{C}{x+6}$

### Case 2: all linear factors with some repetition

In this case, for each repeated factor, include several fractions, one for each power up to the number of times it's repeated. This is easier to show than to explain. For example: $\dfrac{1}{(x-4)(x+5)^4} = \dfrac{A}{x-4} + \dfrac{B}{x+5} + \dfrac{C}{(x+5)^2} + \dfrac{D}{(x+5)^3} + \dfrac{E}{(x+5)^4}$

Here's another example: $\dfrac{1}{x^2(x-1)} = \dfrac{A}{x} + \dfrac{B}{x^2} + \dfrac{C}{x-1}$

Here the numerator will look different. Like the linear factors had a constant numerator, quadratic factors will have a linear numerator. For example: $\dfrac{1}{x^2(x+6)(x^2+4x-9)} = \dfrac{A}{x} + \dfrac{B}{x^2} + \dfrac{C}{x+6} + \dfrac{Dx+E}{x^2+4x-9}$

### Sidenote

There are a couple of other considerations we could go into, but this explanation is long enough already, and we need to get to some more examples, so the only one I'll mention is this: the method outlined here only works if the order of the numerator is lower than that of the denominator. In all the examples we'll do here, this will be true, but if you run across one where that isn't true, you can do polynomial long division, after which the remainder will fit that description. That's beyond our scope here, so I'll just leave it at that.

Okay, now on to some examples.

# Examples

## Decomposing a Rational Function

Use partial fraction decomposition to write $\dfrac{x^2+2x-1}{2x^3+3x^2-2x}$ as the sum of simpler rational functions.

### Solution

Start by factoring the denominator: $\dfrac{x^2+2x-1}{2x^3+3x^2-2x} = \dfrac{x^2+2x-1}{x(2x^2+3x-2)} = \dfrac{x^2+2x-1}{x(2x-1)(x+2)}$

Now set up the partial fraction form. All the factors are linear, and there's no repetition: $\dfrac{x^2+2x-1}{x(2x-1)(x+2)} = \dfrac{A}{x} + \dfrac{B}{2x-1} + \dfrac{C}{x+2}$

Multiply both sides by the left-hand denominator: $x^2+2x-1 = A(2x-1)(x+2) + Bx(x+2) + Cx(2x-1)$

To find the coefficients, pick values to plug in that will make parts of the expression on the right disappear: use $0$, $-2$, and $\dfrac{1}{2}$.

• $x=0$: \begin{aligned} -1 &= A(-1)(2) + B(0) + C(0)\ -1 &= -2A\ \dfrac{1}{2} &= A \end{aligned}

• $x=-2$: \begin{aligned} -1 &= A(0) + B(0) + C(-2)(-5)\ -1 &= 10C\ -\dfrac{1}{10} &= C \end{aligned}

• $x=\dfrac{1}{2}$: \begin{aligned} \dfrac{1}{4} &= A(0) + B\left(\dfrac{1}{2}\right)\left(\dfrac{5}{2}\right) + C(0)\ \dfrac{1}{4} &= \dfrac{5}{4}B\ \dfrac{1}{5} &= B \end{aligned}

Therefore, $\dfrac{x^2+2x-1}{x(2x-1)(x+2)} = \ans{\dfrac{1/2}{x} + \dfrac{1/5}{2x-1} + \dfrac{-1/10}{x+2}}$

Evaluate $\displaystyle\int \dfrac{x}{x^2+x-2}\ dx$.

### Solution

Factor the denominator: $x^2+x-2 = (x+2)(x-1)$

Since there are two linear factors, with no repetition, there will be two partial fractions: $\dfrac{x}{x^2+x-2} = \dfrac{A}{x+2} + \dfrac{B}{x-1}$

Multiply both sides by $(x+2)(x-1)$: $x = A(x-1) + B(x+2)$

To solve for $A$ and $B$, plug in $1$ and $-2$ for $x$:

• $x = 1$: \begin{aligned} 1 &= A(0)+B(3)\ 1 &= 3B\ \dfrac{1}{3} &= B \end{aligned}

• $x = -2$: \begin{aligned} -2 &= A(-3)+B(0)\ -2 &= -3A\ \dfrac{2}{3} &= A \end{aligned}

Now, rewrite the integral using these partial fractions: $\int \dfrac{x}{x^2+x-2}\ dx = \int \dfrac{2/3}{x+2} + \dfrac{-1/3}{x-1}\ dx$

We can then integrate using u-substitution (I'll leave out some of the details, but you can fill them in if necessary): \begin{aligned} \int \dfrac{x}{x^2+x-2}\ dx &= \int \dfrac{2/3}{x+2} + \dfrac{-1/3}{x-1}\ dx\ &= \ans{\dfrac{2}{3}\ln |x+2| - \dfrac{1}{3}\ln |x-1| + C} \end{aligned}

### Note: don't get too careless with the integration

For the sake of brevity, I often skip the last step of these problems, going from something like $\displaystyle\int \dfrac{2/3}{x+2}\ dx$ to $\dfrac{2}{3}\ln |x+2|$. Once you're comfortable with these, this integration step can be quick, but just be careful not to make one of the following common mistakes:

• Ignoring coefficients of $x$ in the denominator: \begin{aligned} {\color{red}\int \dfrac{3}{1-2x}\ dx \neq 3 \ln |1-2x|}\ {\color{green}\int \dfrac{3}{1-2x}\ dx = -\dfrac{3}{2}\ln |1-2x|} \end{aligned}

• Using the natural log function for any power in the denominator: \begin{aligned} {\color{red}\int \dfrac{1}{(x+1)^2}\ dx \neq \ln |(x+1)^2|}\ {\color{green}\int \dfrac{1}{(x+1)^2}\ dx = -\dfrac{1}{x+1}} \end{aligned}

Evaluate $\displaystyle\int \dfrac{x^4-1}{x^5-4x^3}\ dx$.

### Solution

Start factoring the denominator by pulling out the $x^3$ common factor, and then factoring the remaining quadratic: $x^5 - 4x^3 = x^3(x^2-4) = x^3(x+2)(x-2)$

Notice that the $x^3$ is a single factor repeated three times: $\dfrac{x^4-1}{x^5-4x^3} = \dfrac{A}{x} + \dfrac{B}{x^2} + \dfrac{C}{x^3} + \dfrac{D}{x+2} + \dfrac{E}{x-2}$

After multiplying both sides by $x^3(x+2)(x-2)$, we get $x^4-1 = Ax^2(x+2)(x-2) + Bx(x+2)(x-2) + C(x+2)(x-2) + Dx^3(x-2) + Ex^3(x+2)$

It makes sense to plug in $0$, $2$, and $-2$. We have five unknowns, though, so we need to plug in five numbers. Let's pick $1$ and $-1$ for the remaining two:

• $x=0$: $-1 = C(2)(-2) \longrightarrow C = \dfrac{1}{4}$

• $x=2$: $15 = E(8)(4) \longrightarrow E = \dfrac{15}{32}$

• $x=-2$: $15 = D(-8)(-4) \longrightarrow D = \dfrac{15}{32}$

• $x=1$: \begin{aligned} 0 &= -3A - 3B - 3C - D + 3E\ 0 &= -3A - 3B - \dfrac{3}{4} - \dfrac{15}{32} + \dfrac{45}{32} \end{aligned}

• $x=-1$: \begin{aligned} 0 &= -3A + 3B - 3C + 3D - E\ 0 &= -3A + 3B - \dfrac{3}{4} + \dfrac{45}{32} - \dfrac{15}{32} \end{aligned}

Putting those last two together: \begin{aligned} -\dfrac{3}{16} &= -3A - 3B\ -\dfrac{3}{16} &= -3A + 3B \end{aligned}

Add them together: $-\dfrac{6}{16} = -6A \longrightarrow A = \dfrac{1}{16}$

Finally, $B=0$.

Now we're ready to rewrite the integral and integrate: \begin{aligned} \int \dfrac{x^4-1}{x^5-4x^3}\ dx &= \int \dfrac{1/16}{x} + \dfrac{1/4}{x^3} + \dfrac{15/32}{x+2} + \dfrac{15/32}{x-2}\ dx\ &= \ans{\dfrac{1}{16} \ln x - \dfrac{1}{8x^2} + \dfrac{15}{32} \ln |x+2| + \dfrac{15}{32} \ln |x-2| + C} \end{aligned}

1. $\displaystyle\int \dfrac{x-9}{(x+5)(x-2)}\ dx$

2. $\displaystyle\int \dfrac{2}{x+5}-\dfrac{1}{x-2}\ dx = 2 \ln |x+5| - \ln |x-2| + C$

3. $\displaystyle\int \dfrac{3x+11}{x^2-x-6}\ dx$

4. $\displaystyle\int \dfrac{4}{x-3}-\dfrac{1}{x+2}\ dx = 4 \ln |x-3| - \ln |x+2| + C$

5. $\displaystyle\int \dfrac{x^2+2x-1}{x^3-x}\ dx$

6. $\displaystyle\int \dfrac{1}{x}-\dfrac{1}{x+1} + \dfrac{1}{x-1}\ dx = \ln x - \ln |x+1| + \ln |x-1| + C$

7. $\displaystyle\int \dfrac{5x^2+3x-2}{x^3+2x^2}\ dx$

8. $\displaystyle\int \dfrac{2}{x}-\dfrac{1}{x^2}+\dfrac{3}{x+2}\ dx = 2 \ln x + \dfrac{1}{x} + 3 \ln |x+2| + C$

9. $\displaystyle\int \dfrac{x^2-5x+16}{(2x+1)(x-2)^2}\ dx$

10. $\displaystyle\int \dfrac{3/2}{2x+1}-\dfrac{1}{x-2} + \dfrac{2}{(x-2)^2}\ dx = \dfrac{3}{2}\ln |2x+1| - \ln |x-2| - \dfrac{2}{x-2} + C$

11. $\displaystyle\int \dfrac{32x^2}{(x-9)(x+3)^2}\ dx$

12. $\displaystyle\int \dfrac{18}{x-9}+\dfrac{14}{x+3} - \dfrac{24}{(x+3)^2}\ dx = 18\ln |x-9| + 14 \ln |x+3| + \dfrac{24}{x+3} + C$