Skip to main content
Logo image

APEX Calculus: for University of Lethbridge

Section 6.5 Partial Fraction Decomposition

In this section we investigate the antiderivatives of rational functions. Recall that rational functions are functions of the form \(f(x)= \frac{p(x)}{q(x)}\text{,}\) where \(p(x)\) and \(q(x)\) are polynomials and \(q(x)\neq 0\text{.}\) Such functions arise in many contexts, one of which is the solving of certain fundamental differential equations.
Figure 6.5.1. Video introduction to Section 6.5
We begin with an example that demonstrates the motivation behind this section. Consider the integral \(\ds\int \frac{1}{x^2-1}\, dx\text{.}\) We do not have a simple formula for this (if the denominator were \(x^2+1\text{,}\) we would recognize the antiderivative as being the arctangent function). It can be solved using Trigonometric Substitution, but note how the integral is easy to evaluate once we realize:
\begin{equation*} \frac{1}{x^2-1} = \frac{1/2}{x-1} - \frac{1/2}{x+1}\text{.} \end{equation*}
\begin{align*} \int\frac{1}{x^2-1}\, dx \amp = \int\frac{1/2}{x-1}\, dx - \int\frac{1/2}{x+1}\, dx\\ \amp = \frac12\ln\abs{x-1} - \frac12\ln\abs{x+1} + C\text{.} \end{align*}
This section teaches how to decompose
\begin{equation*} \frac{1}{x^2-1} \text{ into } \frac{1/2}{x-1}-\frac{1/2}{x+1}\text{.} \end{equation*}
We start with a rational function \(f(x)=\frac{p(x)}{q(x)}\text{,}\) where \(p\) and \(q\) do not have any common factors and the degree of \(p\) is less than the degree of \(q\text{.}\) It can be shown that any polynomial, and hence \(q\text{,}\) can be factored into a product of linear and irreducible quadratic terms. The following Key Idea states how to decompose a rational function into a sum of rational functions whose denominators are all of lower degree than \(q\text{.}\)

Key Idea 6.5.2. Partial Fraction Decomposition.

Let \(\ds \frac{p(x)}{q(x)}\) be a rational function, where the degree of \(p\) is less than the degree of \(q\text{.}\)
  1. Linear Terms: Let \((x-a)\) divide \(q(x)\text{,}\) where \((x-a)^n\) is the highest power of \((x-a)\) that divides \(q(x)\text{.}\) Then the decomposition of \(\frac{p(x)}{q(x)}\) will contain the sum
    \begin{equation*} \frac{A_1}{(x-a)} + \frac{A_2}{(x-a)^2} + \cdots +\frac{A_n}{(x-a)^n}\text{.} \end{equation*}
  2. Quadratic Terms: Let \(x^2+bx+c\) be an irreducible quadratic that divides \(q(x)\text{,}\) where \((x^2+bx+c)^n\) is the highest power of \(x^2+bx+c\) that divides \(q(x)\text{.}\) Then the decomposition of \(\frac{p(x)}{q(x)}\) will contain the sum
    \begin{equation*} \frac{B_1x+C_1}{x^2+bx+c}+\frac{B_2x+C_2}{(x^2+bx+c)^2}+\cdots+\frac{B_nx+C_n}{(x^2+bx+c)^n}\text{.} \end{equation*}
To find the coefficients \(A_i\text{,}\) \(B_i\) and \(C_i\text{:}\)
  1. Multiply all fractions by \(q(x)\text{,}\) clearing the denominators. Collect like terms.
  2. Equate the resulting coefficients of the powers of \(x\) and solve the resulting system of linear equations.
The following examples will demonstrate how to put this Key Idea into practice. Example 6.5.3 stresses the decomposition aspect of the Key Idea.

Example 6.5.3. Decomposing into partial fractions.

Decompose \(\ds f(x)=\frac{1}{(x+5)(x-2)^3(x^2+x+2)(x^2+x+7)^2}\) without solving for the resulting coefficients.
Solution 1. Video solution
Solution 2.
The denominator is already factored, as both \(x^2+x+2\) and \(x^2+x+7\) cannot be factored further. We need to decompose \(f(x)\) properly. Since \((x+5)\) is a linear term that divides the denominator, there will be a
\begin{equation*} \frac{A}{x+5} \end{equation*}
term in the decomposition.
As \((x-2)^3\) divides the denominator, we will have the following terms in the decomposition:
\begin{equation*} \frac{B}{x-2}, \frac{C}{(x-2)^2} \text{ and } \frac{D}{(x-2)^3}\text{.} \end{equation*}
The \(x^2+x+2\) term in the denominator results in a \(\ds\frac{Ex+F}{x^2+x+2}\) term.
Finally, the \((x^2+x+7)^2\) term results in the terms
\begin{equation*} \frac{Gx+H}{x^2+x+7} \text{ and } \frac{Ix+J}{(x^2+x+7)^2}\text{.} \end{equation*}
All together, we have
\begin{align*} \amp\frac{1}{(x+5)(x-2)^3(x^2+x+2)(x^2+x+7)^2}\\ \amp \quad\quad = \frac{A}{x+5} + \frac{B}{x-2}+ \frac{C}{(x-2)^2}+\frac{D}{(x-2)^3}\\ \amp \quad\quad\quad\quad + \frac{Ex+F}{x^2+x+2}+\frac{Gx+H}{x^2+x+7}+\frac{Ix+J}{(x^2+x+7)^2} \end{align*}
Solving for the coefficients \(A\text{,}\) \(B \ldots J\) would be a bit tedious but not “hard.”

Example 6.5.4. Decomposing into partial fractions.

Perform the partial fraction decomposition of \(\ds \frac{1}{x^2-1}\text{.}\)
Solution 1. Video solution
Solution 2.
The denominator factors into two linear terms: \(x^2-1 = (x-1)(x+1)\text{.}\) Thus
\begin{equation*} \frac{1}{x^2-1} = \frac{A}{x-1} + \frac{B}{x+1}\text{.} \end{equation*}
To solve for \(A\) and \(B\text{,}\) first multiply through by \(x^2-1 = (x-1)(x+1)\text{:}\)
\begin{align*} 1 \amp = \frac{A(x-1)(x+1)}{x-1}+\frac{B(x-1)(x+1)}{x+1}\\ \amp = A(x+1) + B(x-1)\\ \amp = Ax+A + Bx-B\\ \amp = (A+B)x + (A-B)\text{,} \end{align*}
by collecting like terms.
The next step is key. Note the equality we have:
\begin{equation*} 1 = (A+B)x+(A-B)\text{.} \end{equation*}
For clarity’s sake, rewrite the left hand side as
\begin{equation*} 0x+1 = (A+B)x+(A-B)\text{.} \end{equation*}
On the left, the coefficient of the \(x\) term is 0; on the right, it is \((A+B)\text{.}\) Since both sides are equal, we must have that \(0=A+B\text{.}\)
Likewise, on the left, we have a constant term of 1; on the right, the constant term is \((A-B)\text{.}\) Therefore we have \(1=A-B\text{.}\)
We have two linear equations with two unknowns. This one is easy to solve by hand, leading to
\begin{align*} A+B \amp = 0\\ A-B \amp = 1 \end{align*}
If we add these two equations, we get \(2A=1 \Rightarrow A=1/2\text{.}\) Substitution into the first equation gives \(B=-1/2\text{.}\)
\begin{equation*} \frac{1}{x^2-1} = \frac{1/2}{x-1}-\frac{1/2}{x+1}\text{.} \end{equation*}
There is another method for finding the partial fraction decomposition called the “Heaviside” method, named after Oliver Heaviside. We show a variation of this process using the same example as in Example 6.5.3.

Example 6.5.5. Decomposing into partial fractions using the Heaviside method.

Perform the partial fraction decomposition of \(\ds \frac{1}{x^2-1}\text{.}\)
Solution 1. Video solution
Solution 2.
As we saw in Example 6.5.4,
\begin{equation*} \frac{1}{x^2-1} = \frac{A}{x-1} + \frac{B}{x+1}\text{.} \end{equation*}
To solve for \(A\) and \(B\) using the Heaviside method, we will build to a common denominator:
\begin{align*} \frac{1}{x^2-1} \amp = \frac{A(x+1)}{(x-1)(x+1)}+\frac{B(x-1)}{(x+1)(x-1)}\\ \amp = \frac{A(x+1)+B(x-1)}{(x-1)(x+1)} \end{align*}
Now since the denomiators match, we will only consider the numerator equation (essentially if we multiply both sides of the equation by \((x-1)(x+1)\text{,}\) we will clear the denomiators):
\begin{equation*} 1=A(x+1)+B(x-1) \end{equation*}
Now we substitute in “convenient” values of \(x\text{.}\) When \(x=1\text{,}\) we get \(1=2A \Rightarrow A=1/2\text{.}\) When \(x=-1\text{,}\) we get \(1=-2B \Rightarrow B=-1/2\text{.}\)
You may note that \(x=1\) and \(x=-1\) were not in the domain of the original fraction. However,
\begin{equation*} \frac{1}{x^2-1}=\frac{A(x+1)+B(x-1)}{(x-1)(x+1)} \end{equation*}
is an identity, meaning it is true for all values of \(x\text{,}\) even those for which the equation is undefined. We could have chosen any values of \(x\) to substitute. Whenever possible, we choose values of \(x\) that will make one of the factors zero. In this way, we can avoid solving a system of equations.
Thus as in Example 6.5.3, we get
\begin{equation*} \frac{1}{x^2-1} = \frac{1/2}{x-1}-\frac{1/2}{x+1}\text{.} \end{equation*}
For the remaining examples, we will use a combination of systems of equations and the Heaviside method to get partial fraction decompositions.

Example 6.5.6. Integrating using partial fractions.

Use partial fraction decomposition to integrate \(\ds\int\frac{1}{(x-1)(x+2)^2}\, dx\text{.}\)
Solution 1. Video solution
Solution 2.
We decompose the integrand as follows, as described by Key Idea 6.5.2:
\begin{equation*} \frac{1}{(x-1)(x+2)^2} = \frac{A}{x-1} + \frac{B}{x+2} + \frac{C}{(x+2)^2}\text{.} \end{equation*}
To solve for \(A\text{,}\) \(B\) and \(C\text{,}\) we multiply both sides by \((x-1)(x+2)^2\text{:}\)
\begin{equation} 1 = A(x+2)^2 + B(x-1)(x+2) + C(x-1)\tag{6.5.1} \end{equation}
Now we collect like terms:
\begin{align*} 1 \amp = A(x+2)^2 + B(x-1)(x+2) + C(x-1)\\ \amp = Ax^2+4Ax+4A + Bx^2 + Bx-2B + Cx-C\\ \amp = (A+B)x^2 + (4A+B+C)x + (4A-2B-C) \end{align*}
We have
\begin{equation*} 0x^2+0x+ 1 = (A+B)x^2 + (4A+B+C)x + (4A-2B-C) \end{equation*}
leading to the equations
\begin{equation*} A+B = 0, 4A+B+C = 0 \text{ and } 4A-2B-C = 1\text{.} \end{equation*}
These three equations of three unknowns lead to a unique solution:
\begin{equation*} A = 1/9, B = -1/9 \text{ and } C = -1/3\text{.} \end{equation*}
\begin{equation*} \int\frac{1}{(x-1)(x+2)^2}\, dx = \int \frac{1/9}{x-1}\, dx + \int \frac{-1/9}{x+2}\, dx + \int \frac{-1/3}{(x+2)^2}\, dx\text{.} \end{equation*}
Each can be integrated with a simple substitution with \(u=x-1\) or \(u=x+2\) (or by directly applying Key Idea 6.1.5 as the denominators are linear functions). The end result is
\begin{equation*} \int\frac{1}{(x-1)(x+2)^2}\, dx = \frac19\ln\abs{x-1} -\frac19\ln\abs{x+2} +\frac1{3(x+2)}+C\text{.} \end{equation*}
In examples like Example 6.5.6 where there are repeated roots, there is an extension of the Heaviside method using derivatives. This method is explained in Figure 6.5.7 below.
Figure 6.5.7. Alternate method for finding coefficients in Example 6.5.6

Example 6.5.8. Integrating using partial fractions.

Use partial fraction decomposition to integrate \(\ds \int \frac{x^3}{(x-5)(x+3)}\, dx\text{.}\)
Solution 1. Video solution
Solution 2.
Key Idea 6.5.2 presumes that the degree of the numerator is less than the degree of the denominator. Since this is not the case here, we begin by using polynomial division to reduce the degree of the numerator. We omit the steps, but encourage the reader to verify that
\begin{equation*} \frac{x^3}{(x-5)(x+3)} = x+2+\frac{19x+30}{(x-5)(x+3)}\text{.} \end{equation*}
Using Key Idea 6.5.2, we can rewrite the new rational function as:
\begin{equation*} \frac{19x+30}{(x-5)(x+3)} = \frac{A}{x-5} + \frac{B}{x+3} \end{equation*}
for appropriate values of \(A\) and \(B\text{.}\) Clearing denominators, we have
\begin{align*} 19x+30 \amp = A(x+3) + B(x-5)\\ \amp = (A+B)x + (3A-5B).\\ \end{align*}

This implies that:

\begin{align*} 19\amp = A+B\\ 30\amp = 3A-5B.\\ \end{align*}

Solving this system of linear equations gives

\begin{align*} 125/8 \amp =A\\ 27/8 \amp =B\text{.} \end{align*}
We can now integrate.
\begin{align*} \int \frac{x^3}{(x-5)(x+3)}\, dx \amp = \int\left(x+2+\frac{125/8}{x-5}+\frac{27/8}{x+3}\right)\, dx\\ \amp = \frac{x^2}2 + 2x + \frac{125}{8}\ln\abs{x-5} + \frac{27}8\ln\abs{x+3} + C\text{.} \end{align*}

Example 6.5.9. Integrating using partial fractions.

Use partial fraction decomposition to evaluate \(\ds \int\frac{7x^2+31x+54}{(x+1)(x^2+6x+11)}\, dx\text{.}\)
Solution 1. Video solution
Solution 2.
The degree of the numerator is less than the degree of the denominator so we begin by applying Key Idea 6.5.2. We have:
\begin{align*} \frac{7x^2+31x+54}{(x+1)(x^2+6x+11)} \amp = \frac{A}{x+1} + \frac{Bx+C}{x^2+6x+11}.\\ \end{align*}

Now clear the denominators.

\begin{align*} 7x^2+31x+54 \amp = A(x^2+6x+11) + (Bx+C)(x+1) \end{align*}
Now, letting \(x=-1\) we have \(30 = 6A \Rightarrow A=5\text{.}\) When \(x=0\text{,}\) \(54 = 11A+C\text{.}\) But we know that \(A=5\text{,}\) so \(54 =55+C \Rightarrow C=-1\) Finally, we choose \(x=1\) (with \(A=5, C=-1\)) we have \(92=90+(B-1)(2)\Rightarrow B=2\text{.}\)
\begin{equation*} \int\frac{7x^2+31x+54}{(x+1)(x^2+6x+11)}\, dx = \int\left(\frac{5}{x+1} + \frac{2x-1}{x^2+6x+11}\right)\, dx\text{.} \end{equation*}
The first term of this new integrand is easy to evaluate; it leads to a \(5\ln\abs{x+1}\) term. The second term is not hard, but takes several steps and uses substitution techniques.
The integrand \(\ds \frac{2x-1}{x^2+6x+11}\) has a quadratic in the denominator and a linear term in the numerator. This leads us to try substitution. Let \(u = x^2+6x+11\text{,}\) so \(du = (2x+6)\, dx\text{.}\) The numerator is \(2x-1\text{,}\) not \(2x+6\text{,}\) but we can get a \(2x+6\) term in the numerator by adding 0 in the form of “\(7-7\text{.}\)
\begin{align*} \frac{2x-1}{x^2+6x+11} \amp = \frac{2x-1+7-7}{x^2+6x+11}\\ \amp = \frac{2x+6}{x^2+6x+11} - \frac{7}{x^2+6x+11}\text{.} \end{align*}
We can now integrate the first term with substitution, leading to a \(\ln\abs{x^2+6x+11}\) term. The final term can be integrated using arctangent. (We can tell there is no further factoring for this quadratic since the denominator has no real solutions). First, complete the square in the denominator:
\begin{equation*} \frac{7}{x^2+6x+11} = \frac{7}{(x+3)^2+2}\text{.} \end{equation*}
An antiderivative of the latter term can be found using Theorem 6.1.20 and substitution:
\begin{equation*} \int \frac{7}{x^2+6x+11}\, dx = \frac{7}{\sqrt{2}}\tan^{-1}\left(\frac{x+3}{\sqrt{2}}\right)+C\text{.} \end{equation*}
Let’s start at the beginning and put all of the steps together.
\begin{align*} \amp \int\frac{7x^2+31x+54}{(x+1)(x^2+6x+11)}\, dx\\ \amp = \int\left(\frac{5}{x+1} + \frac{2x-1}{x^2+6x+11}\right)\, dx\\ \amp = \int\frac{5}{x+1}\, dx + \int\frac{2x+6}{x^2+6x+11}\, dx -\int\frac{7}{(x+3)^2+2}\, dx\\ \amp = 5\ln\abs{x+1}+ \ln\abs{x^2+6x+11} -\frac{7}{\sqrt{2}}\tan^{-1}\left(\frac{x+3}{\sqrt{2}}\right)+C\text{.} \end{align*}
As with many other problems in calculus, it is important to remember that one is not expected to “see” the final answer immediately after seeing the problem. Rather, given the initial problem, we break it down into smaller problems that are easier to solve. The final answer is a combination of the answers of the smaller problems.
Partial Fraction Decomposition is an important tool when dealing with rational functions. Note that at its heart, it is a technique of algebra, not calculus, as we are rewriting a fraction in a new form. Regardless, it is very useful in the realm of calculus as it lets us evaluate a certain set of “complicated” integrals.
Section 6.6 introduces new functions, called the Hyperbolic Functions. They will allow us to make substitutions similar to those found when studying Trigonometric Substitution, allowing us to approach even more integration problems.

Exercises Exercises

Terms and Concepts

Partial Fraction Decomposition is a method of rewriting functions.
  • True
  • False
It is sometimes necessary to use polynomial division before using Partial Fraction Decomposition.
Exercise Group.
Decompose without solving for the coefficients, as done in Example 6.5.3.
\(\ds {\frac{1}{x^{2}-6x}}\)
\(\ds {\frac{-x-5}{x^{2}-9}}\)
\(\ds {\frac{x-7}{x^{2}-6}}\)
\(\ds {\frac{7x+1}{x^{3}+5x}}\)


Exercise Group.
Evaluate the indefinite integral.
\(\ds \int {\frac{14x+17}{x^{2}+x-6}} \, dx\)
\(\ds \int {-\frac{32}{x^{2}-4x}} \, dx\)
\(\ds \int {\frac{12}{4x^{2}-16}} \, dx\)
\(\ds \int {\frac{33-8x}{33x-4x^{2}-8}} \, dx\)
\(\ds \int {\frac{x+12}{\left(x+9\right)^{2}}} \, dx\)
\(\ds \int {\frac{7x+54}{\left(x+7\right)^{2}}} \, dx\)
\(\ds \int {\frac{4x^{2}+24x+48}{x\mathopen{}\left(x+4\right)^{2}}} \, dx\)
\(\ds \int {\frac{16x^{2}-72x-216}{\left(x+3\right)\mathopen{}\left(x-9\right)\mathopen{}\left(9-3x\right)}} \, dx\)
\(\ds \int {\frac{24x^{2}+168x}{\left(9x-9\right)\mathopen{}\left(5x+3\right)\mathopen{}\left(7x+1\right)}} \, dx\)
\(\ds \int {\frac{x^{2}-18}{x^{2}+3x-10}} \, dx\)
\(\ds \int {\frac{x^{3}}{x^{2}-12x+32}} \, dx\)
\(\ds \int {\frac{2x^{2}-12x+24}{x^{2}-6x+12}} \, dx\)
\(\ds \int {\frac{1}{x^{3}-8x^{2}+18x}} \, dx\)
\(\ds \int {\frac{x^{2}+16x+17}{x^{2}+8x+22}} \, dx\)
\(\ds \int {-\frac{55x+1}{\left(x-9\right)\mathopen{}\left(3x^{2}+x-4\right)}} \, dx\)
\(\ds \int {\frac{13x^{2}+82x+109}{\left(x+6\right)\mathopen{}\left(x^{2}+4x+5\right)}} \, dx\)
\(\ds \int {\frac{\left(3\right)x^{2}-\left(2\right)x-\left(4\right)}{\left(x-7\right)\mathopen{}\left(x^{2}+9\right)}} \, dx\)
\(\ds \int {\frac{x^{2}+4x-29}{\left(x+4\right)\mathopen{}\left(x^{2}-2x+5\right)}} \, dx\)
\(\ds \int {\frac{97-35x}{\left(x+9\right)\mathopen{}\left(x^{2}-2x+4\right)}} \, dx\)
\(\ds \int {\frac{\left(31\right)-\left(\left(2\right)x^{2}+\left(1\right)x\right)}{\left(x+1\right)\mathopen{}\left(x^{2}-8x+21\right)}} \, dx\)
Exercise Group.
Evaluate the definite integral.
\(\ds \int_{1}^{2} {\frac{11x-47}{\left(x+3\right)\mathopen{}\left(x-7\right)}}\, dx\)
\(\ds \int_{0}^{9} {-\frac{16x+19}{\left(3x+2\right)\mathopen{}\left(x+9\right)}}\, dx\)
\(\ds \int_{-1}^{1} {\frac{x^{2}+9x+11}{\left(x-6\right)\mathopen{}\left(x^{2}+8x+17\right)}}\, dx\)
\(\ds \int_{0}^1 \frac{x}{(x+1)(x^2+2x+1)}\, dx\)