# Integration by Partial Fractions

This section covers:

Integration by Partial Fraction Decomposition is a procedure where we can “decompose” a proper rational function into simpler rational functions that are more easily integrated. So basically, we are breaking up one “complicated” fraction into several different “less complicated” fractions. You may have learned how to use this technique in your Algebra class, and it’s quite useful in Calculus!

Note that Integration by Partial Fractions is used when U-Substitution Integration doesn’t work easily; try U-sub first!

(Note that Partial Fraction Decomposition may really only be used with rationals with denominators that factor well. In more advanced cases, you may need to use Completing the Square or another method to get the rational in the right form).

The basic idea is to factor the denominator (if it isn’t already factored) of the complicated factor, and then break it up into different fractions with denominators of those factors. We’ll see that when we do this, we’ll usually end up with integrating logarithmic functions or integrating inverse trigonometric functions.

If an integral is improper (the degree of the numerator is greater than the degree of the denominator), use polynomial long division to get a term that’s not a rational function, and then decompose the remaining terms; we’ll show an example below.

# Integration by Partial Fractions Example

Let’s integrate $$\displaystyle \int{{\frac{{2x+1}}{{12{{x}^{2}}+x-1}}dx}}$$:

Since it looks pretty impossible to integrate with U-sub, let’s see if we can divide it into two separate fractions. By factoring the denominator, $$\displaystyle \int{{\frac{{2x+1}}{{12{{x}^{2}}+x-1}}dx}}=\int{{\frac{{2x+1}}{{\left( {3x+1} \right)\left( {4x-1} \right)}}dx}}$$. (When doing these types of problems in school, the problem will probably be easy to factor; in the “real world,” this would probably not be the case.)

In this problem, all we have to do is to find some values A and B where $$\displaystyle \frac{{2x+1}}{{\left( {3x+1} \right)\left( {4x-1} \right)}}=\frac{A}{{\left( {3x+1} \right)}}+\frac{B}{{\left( {4x-1} \right)}}$$, since then we could integrate log functions.

To find what A and B are, we will do the opposite of finding a common denominator when we studied rational functions; remember that we would put the fractions together like this. (Note that I’m working with the same rational function, as we’ll see below):

$$\displaystyle \frac{{-\frac{1}{7}}}{{\left( {3x+1} \right)}}+\frac{{\frac{6}{7}}}{{\left( {4x-1} \right)}}=-\frac{{-\frac{1}{7}\left( {4x-1} \right)}}{{\left( {3x+1} \right)\left( {4x-1} \right)}}+\frac{{\frac{6}{7}\left( {3x+1} \right)}}{{\left( {3x+1} \right)\left( {4x-1} \right)}}=\frac{{-\frac{4}{7}x+\frac{1}{7}+\frac{{18}}{7}x+\frac{6}{7}}}{{\left( {3x+1} \right)\left( {4x-1} \right)}}=\frac{{2x+1}}{{\left( {3x+1} \right)\left( {4x-1} \right)}}$$

Now, to get A and B, do the opposite; multiply each term by the common denominator (you can also think of it as multiplying on top by “what’s missing” on bottom):

\require{cancel} \displaystyle \begin{align}\frac{{2x+1}}{{\left( {3x+1} \right)\left( {4x-1} \right)}}&=\frac{A}{{\left( {3x+1} \right)}}+\frac{B}{{\left( {4x-1} \right)}}\\\frac{{\left( {3x+1} \right)\left( {4x-1} \right)}}{1}\cdot\frac{{2x+1}}{{\left( {3x+1} \right)\left( {4x-1} \right)}}&=\frac{A}{{\left( \cancel{3x+1} \right)}}\cdot \frac{{\left( \cancel{3x+1} \right)\left( {4x-1} \right)}}{1}+\frac{B}{{\left( \cancel{4x-1} \right)}}\cdot \frac{{\left( {3x+1} \right)\left( \cancel{4x-1} \right)}}{1}\\2x+1&=A\left( {4x-1} \right)+B\left( {3x+1} \right)\end{align}

We have two different ways to solve for A and B (coefficient of x and the constant, respectively):

1. First way (but more complicated): First multiply out the last equation and solve for A and B by equating coefficients:

$$\displaystyle \begin{array}{l}2x+1=A\left( {4x-1} \right)+B\left( {3x+1} \right)\\2x+1=4Ax-A+3Bx+B\\2x+1=x\left( {4A+3B} \right)+(-A+B)\end{array}$$

Now set up a system of equations by equating coefficients:

\displaystyle \begin{align}4A+3B&=2\\-A+B&=1\,\end{align}

\displaystyle \begin{align}B=A+1\\4A+3\,\left( {A+1} \right)=2&:\,\,\,\,\,\,\,\,A=-\frac{1}{7}\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,B=A+1\,&:\,\,\,\,\,\,\,\,\,B=-\frac{1}{7}+\frac{7}{7}=\frac{6}{7}\end{align}

1. (Preferred method for linear factors in denominator – much easier!) In this method, we don’t even have to distribute the A and B. Since $$x=\frac{1}{4}$$ and $$x=-\frac{1}{3}$$ will turn coefficients for A and B, respectively, into 0, set x to these values and solve:

\displaystyle \begin{align}\,2x+1&=A\left( {4x-1} \right)+B\left( {3x+1} \right)\\x=\frac{1}{4}\,:\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,2\left( {\frac{1}{4}} \right)+1&=0+B\left[ {3\left( {\frac{1}{4}} \right)+1} \right];\,\,\,\,\,\,\,\,\,\,\,\,B=\,\frac{6}{7}\,\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\\x=-\frac{1}{3}\,:\,\,\,\,\,\,\,\,\,\,\,2\left( {-\frac{1}{3}} \right)+1&=A\left[ {4\left( {-\frac{1}{3}} \right)-1} \right]+0;\,\,\,\,\,\,\,A=\,-\frac{1}{7}\end{align}

(Note: this seems a little counter-intuitive, since it appears that we are setting denominators to 0, which is a no-no. But in actuality, we are equating the numerators and ignoring the denominators when using this method, so it works!)

Both methods: Substitute the A and B back in the equation and integrate:

\begin{align}\int{{\frac{{2x+1}}{{12{{x}^{2}}+x-1}}dx}}&=\int{{\frac{{2x+1}}{{\left( {3x+1} \right)\left( {4x-1} \right)}}dx}}=\int{{\left( {\frac{A}{{3x+1}}+\frac{B}{{4x-1}}} \right)dx}}=\int{{\left( {\frac{{-\frac{1}{7}}}{{3x+1}}+\frac{{\frac{6}{7}}}{{4x-1}}} \right)\,}}dx\\&=\int{{\left( {-\frac{1}{{7\left( {3x+1} \right)}}+\frac{6}{{7\left( {4x-1} \right)}}} \right)}}\,dx=-\frac{1}{7}\int{{\frac{1}{{3x+1}}dx+\frac{6}{7}\int{{\frac{1}{{4x-1}}dx}}}}\,\\&=-\frac{1}{{21}}\ln \left| {3x+1} \right|+\frac{6}{{28}}\ln \left| {4x-1} \right|+C=-\frac{1}{{21}}\ln \left| {3x+1} \right|+\frac{3}{{14}}\ln \left| {4x-1} \right|+C\end{align}

Let’s try one that’s a little bit more complicated; integrate $$\displaystyle \int{{\frac{{{{x}^{2}}+2x+2}}{{{{x}^{3}}-3{{x}^{2}}+2x}}dx}}$$:

Start by factoring the denominator and getting rid of it by multiplying by a common denominator (you can also think of multiplying the numerator by “what’s missing” in the denominator):

\require{cancel} \displaystyle \begin{align}\frac{{{{x}^{2}}+2x+2}}{{{{x}^{3}}-3{{x}^{2}}+2x}}&=\frac{{{{x}^{2}}+2x+2}}{{x\left( {x-2} \right)\left( {x-1} \right)}}=\frac{A}{x}+\frac{B}{{x-2}}+\frac{C}{{x-1}}\\\frac{{x\left( {x-2} \right)\left( {x-1} \right)}}{1}\cdot \frac{{{{x}^{2}}+2x+2}}{{x\left( {x-2} \right)\left( {x-1} \right)}}&=\frac{A}{{\cancel{x}}}\cdot \frac{{{{\cancel{x}}}\left( {x-2} \right)\left( {x-1} \right)}}{1}+\frac{B}{\cancel{x-2}}\cdot \frac{{x\left( \cancel{x-2} \right)\left( {x-1} \right)}}{1}+\frac{C}{\cancel{x-1}}\cdot \frac{{x\left( {x-2} \right)\left(\cancel {x-1} \right)}}{1}\\{{x}^{2}}+2x+2&=A\left( {x-2} \right)\left( {x-1} \right)+Bx\left( {x-1} \right)+Cx\left( {x-2} \right)\end{align}

Now set x to values that make the terms above 0:

\displaystyle \begin{align}x=2:\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,{{x}^{2}}+2x+2&=A\left( {x-2} \right)\left( {x-1} \right)+Bx\left( {x-1} \right)+Cx\left( {x-2} \right)\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,{{\left( 2 \right)}^{2}}+2\left( 2 \right)+2&=0+B\left( 2 \right)\left( {2-1} \right)+0\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,B&=5\\x=0:\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,{{x}^{2}}+2x+2&=A\left( {x-2} \right)\left( {x-1} \right)+Bx\left( {x-1} \right)+Cx\left( {x-2} \right)\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,{{\left( 0 \right)}^{2}}+2\left( 0 \right)+2&=A\left( {0-2} \right)\left( {0-1} \right)+0+0\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,A&=1\\x=1:\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,{{x}^{2}}+2x+2&=A\left( {x-2} \right)\left( {x-1} \right)+Bx\left( {x-1} \right)+Cx\left( {x-2} \right)\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,{{\left( 1 \right)}^{2}}+2\left( 1 \right)+2&=0+0+C\left( 1 \right)\left( {1-2} \right)\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,C&=-5\end{align}

Substitute the A and B back in the equation and integrate:

\displaystyle \begin{align}\int{{\frac{{{{x}^{2}}+2x+2}}{{{{x}^{3}}-3{{x}^{2}}+2x}}dx}}&=\int{{\frac{{{{x}^{2}}+2x+2}}{{x\left( {x-2} \right)\left( {x-1} \right)}}dx}}=\int{{\left( {\frac{A}{x}+\frac{B}{{x-2}}+\frac{C}{{x-1}}} \right)dx}}\\&=\int{{\frac{1}{x}dx+\int{{\frac{5}{{x-2}}dx}}+\int{{\frac{{-5}}{{x-1}}dx}}}}=\ln \left| x \right|+5\ln \left| {x-2} \right|-5\ln \left| {x-1} \right|+C\\&=\ln \left| {\frac{{x{{{\left( {x-2} \right)}}^{5}}}}{{{{{\left( {x-1} \right)}}^{5}}}}} \right|+C\end{align}

# Integration by Partial Fractions with Improper Fractions

Let’s try another one, but one where we have to perform some long division first:

Integrate $$\displaystyle \int{{\frac{{{{x}^{3}}+2{{x}^{2}}+3x+7}}{{{{x}^{2}}-x-6}}dx}}$$:

Since the degree on the top (3) is greater than the degree of the bottom (2), let’s do polynomial long division to obtain polynomial and rational functions:

$$\displaystyle \begin{array}{l}\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,x\,\,+\,\,3\,\,+\,\,\frac{{12x+25}}{{{{x}^{2}}-x-6}}\,\,\,\\{{x}^{2}}-x-6\,\overline{\left){{{{x}^{3}}+2{{x}^{2}}+3x+7}}\right.}\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\underline{{{{x}^{3}}-\,\,{{x}^{2}}\,-6x}}\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,3{{x}^{2}}+9x+7\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\underline{{\,3{{x}^{2}}-\,3x-18}}\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,12x+25\end{array}$$

We end up with $$\displaystyle \int{{\left( {x+3+\frac{{12x+25}}{{{{x}^{2}}-x-6}}} \right)dx}}=\int{{xdx}}+\int{{3dx}}+\int{{\frac{{12x+25}}{{{{x}^{2}}-x-6}}dx}}$$.

Use Partial Fraction Decomposition for the last term:

\displaystyle \begin{align}\frac{{12x+25}}{{{{x}^{2}}-x-6}}&=\frac{{12x+25}}{{\left( {x-3} \right)\left( {x+2} \right)}}=\frac{A}{{x-3}}+\frac{B}{{x+2}}\\\frac{{\left( {x-3} \right)\left( {x+2} \right)}}{1}\cdot \frac{{12x+25}}{{\left( {x-3} \right)\left( {x+2} \right)}}&=\frac{A}{{x-3}}\cdot \frac{{\left( {x-3} \right)\left( {x+2} \right)}}{1}+\frac{B}{{x+2}}\cdot \frac{{\left( {x-3} \right)\left( {x+2} \right)}}{1}\\12x+25&=A\left( {x+2} \right)+B\left( {x-3} \right)\end{align}

Now set x to values that make the terms above 0:

\displaystyle \begin{align}x=-2:\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,12x+25&=A\left( {x+2} \right)+B\left( {x-3} \right)\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,12\left( {-2} \right)+25&=0+B\left( {-2-3} \right)\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,B&=-\frac{1}{5}\\\,\,x=3:\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,12x+25&=A\left( {x+2} \right)+B\left( {x-3} \right)\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,12\left( 3 \right)+25&=A\left( {3+2} \right)+0\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,A&=\frac{{61}}{5}\end{align}

Substitute the A and B back in the equation and integrate:

\displaystyle \begin{align}\int{{\frac{{{{x}^{3}}+2{{x}^{2}}+3x+7}}{{{{x}^{2}}-x-6}}dx}}&=\int{{\left( {x+3+\frac{{12x+25}}{{{{x}^{2}}-x-6}}} \right)\,}}dx=\int{{\left( {x+3+\frac{{12x+25}}{{\left( {x-3} \right)\left( {x+2} \right)}}} \right)\,}}dx=\int{{\left( {x+3+\frac{A}{{x-3}}+\frac{B}{{x+2}}} \right)dx}}\\&=\int{{\left( {x+3+\frac{{\frac{{61}}{5}}}{{x-3}}+\frac{{-\frac{1}{5}}}{{x+2}}} \right)dx}}=\int{{x\,dx}}+\int{{3\,dx}}\,+\int{{\frac{{61}}{{5\left( {x-3} \right)}}dx}}-\int{{\frac{1}{{5\left( {x+2} \right)}}dx}}\\&=\frac{{{{x}^{2}}}}{2}+3x+\frac{{61}}{5}\ln \left| {x-3} \right|-\frac{1}{5}\ln \left| {x+2} \right|+C\end{align}

# Example of Rational Function where Partial Fractions are not Needed

Note that not all rational functions need to be decomposed by Partial Fractions. Here is an example:

Integrate $$\displaystyle \int{{\frac{{{{x}^{2}}-1}}{{{{x}^{3}}-3x+9}}}}\,dx$$:

See how we can use U-Substitution Integration?

\displaystyle \begin{align}\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,u&={{x}^{3}}-3x+9\\\int{{\frac{{{{x}^{2}}-1}}{{{{x}^{3}}-3x+9}}}}\,dx\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,du&=\left( {3{{x}^{2}}-3} \right)dx\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,dx&=\frac{{du}}{{3{{x}^{2}}-3}}=\frac{{du}}{{3\left( {{{x}^{2}}-1} \right)}}\,\,\,\end{align}

$$\displaystyle \int{{\frac{{{{x}^{2}}-1}}{{{{x}^{3}}-3x+9}}dx}}\,=\,\int{{\left( {\frac{{{{x}^{2}}-1}}{u}\cdot \frac{{du}}{{3\left( {{{x}^{2}}-1} \right)}}} \right)}}\,=\,\int{{\frac{1}{u}\cdot \frac{{du}}{3}}}\,=\frac{1}{3}\int{{\frac{{du}}{u}}}=\frac{1}{3}\ln \left| u \right|+C=\frac{1}{3}\ln \left| {{{x}^{3}}-3x+9} \right|+C$$

# Integration by Partial Fractions with Higher Degrees

This isn’t usually taught in an AB Calculus class, but it gets a little more complicated when we are decomposing rational functions with repeatable factors in the denominator, and factors with higher degrees, which we’ll see below.

With repeatable factors in the denominator, we have to remember that the rational may be decomposed in a number of ways, with various factors of the numerator. We must account for all these ways (even if some numerators are 0) by using denominators with different powers of this factor.

For example, let’s say we want to decompose $$\displaystyle \frac{{5{{x}^{3}}+3{{x}^{2}}+x+5}}{{x{{{\left( {x-3} \right)}}^{3}}}}$$.

We could set up the partial fraction decomposition this way:

$$\displaystyle \frac{{5{{x}^{3}}+3{{x}^{2}}+x+5}}{{x{{{\left( {x-3} \right)}}^{3}}}}=\frac{A}{x}+\frac{B}{{x-3}}+\frac{C}{{{{{\left( {x-3} \right)}}^{2}}}}+\frac{D}{{{{{\left( {x-3} \right)}}^{3}}}}$$

(Note: When solving for A, B, C, and D, using $$x=0$$ and $$x=3$$, you may only get some of these values, and then you can plug in random x values to create a system of equations to get the other values; this method is beyond the scope of this site.)

The other type of rational function that is more advanced is when we have a higher degree (2 and up) in a prime (unfactorable) factor in the denominator. For example, for a quadratic factor in the denominator that can’t be factored, we’ll have to put a linear factor in the numerator (like $$Ax+B$$).

For example, let’s say we want to decompose $$\displaystyle \frac{{5{{x}^{3}}+3{{x}^{2}}+x+5}}{{x{{{\left( {{{x}^{2}}-3} \right)}}^{3}}}}$$.

We could set up the partial fraction decomposition this way:

\displaystyle \begin{align}\frac{{5{{x}^{3}}+3{{x}^{2}}+x+5}}{{x{{{\left( {{{x}^{2}}-3} \right)}}^{3}}}}&=\frac{A}{x}+\frac{{Bx+C}}{{{{x}^{2}}-3}}+\frac{{Dx+E}}{{{{{\left( {{{x}^{2}}-3} \right)}}^{2}}}}+\frac{{Fx+G}}{{{{{\left( {{{x}^{2}}-3} \right)}}^{3}}}}\\\frac{{x{{{\left( {x-3} \right)}}^{3}}}}{1}\cdot \frac{{5{{x}^{3}}+3{{x}^{2}}+x+5}}{{x{{{\left( {x-3} \right)}}^{3}}}}&=\left( {\frac{A}{x}+\frac{{Bx+C}}{{x-3}}+\frac{{Dx+E}}{{{{{\left( {x-3} \right)}}^{2}}}}+\frac{{Fx+G}}{{{{{\left( {x-3} \right)}}^{3}}}}} \right)\cdot \frac{{x{{{\left( {x-3} \right)}}^{3}}}}{1}\\5{{x}^{3}}+3{{x}^{2}}+x+5&=A{{\left( {x-3} \right)}^{3}}+\left( {Bx+C} \right)x{{\left( {x-3} \right)}^{2}}+\left( {Dx+E} \right)x\left( {x-3} \right)+\left( {Fx+G} \right)x\end{align}

I’m not going to try to solve this one, but we could first start with $$x=3$$ and $$x=0$$, simplify, possibly use random x values that are the same across the board, and then solve some systems of equations. And it turns out that these types of partial fraction integration problems usually result in the Integration of Inverse Trigonometric Functions.

Learn these rules, and practice, practice, practice!