# Calculus/Integration techniques/Partial Fraction Decomposition

 ← Integration techniques/Trigonometric Integrals Calculus Integration techniques/Tangent Half Angle → Integration techniques/Partial Fraction Decomposition

Suppose we want to find $\int {3x+ 1 \over x^2+x} dx$. One way to do this is to simplify the integrand by finding constants $A$ and $B$ so that

${3x+ 1 \over x^2+x}={3x+ 1 \over x(x+1)}= {A \over x}+ {B \over x+1}.$

This can be done by cross multiplying the fraction which gives

${3x+1\over x(x+1)} = {{A(x+1) + Bx} \over {x(x+1)}}$

As both sides have the same denominator we must have

$3x+1 = A(x+1)+Bx$

This is an equation for $x$ so it must hold whatever value $x$ is. If we put in $x=0$ we get $1 = A$ and putting $x=-1$ gives $-2=-B$ so $B=2$. So we see that

$\frac{3x+ 1}{x^2+x} = \frac{1}{x} + \frac{2}{x+1} \$

Returning to the original integral

 $\int \frac{3x+1}{x^2+x} dx$ = $\int \frac{dx}{x} + \int \frac{2}{x+1} dx$ = $\ln \left| x \right| + 2 \ln \left| x+1 \right| + C$

Rewriting the integrand as a sum of simpler fractions has allowed us to reduce the initial integral to a sum of simpler integrals. In fact this method works to integrate any rational function.

## Method of Partial FractionsEdit

To decompose the rational function $\frac{P(x)}{Q(x)}$:

• Step 1 Use long division (if necessary) to ensure that the degree of $P(x)$ is less than the degree of $Q(x)$ (see Breaking up a rational function in section

1.1).

• Step 2 Factor Q(x) as far as possible.
• Step 3 Write down the correct form for the partial fraction decomposition (see below) and solve for the constants.

To factor Q(x) we have to write it as a product of linear factors (of the form $ax+b$) and irreducible quadratic factors (of the form $ax^2+bx+c$ with $b^2-4ac<0$).

Some of the factors could be repeated. For instance if $Q(x) = x^3-6x^2+9x$ we factor $Q(x)$ as

$Q(x) = x(x^2-6x+9) = x(x-3)(x-3)=x(x-3)^2.$

It is important that in each quadratic factor we have $b^2-4ac<0$, otherwise it is possible to factor that quadratic piece further. For example if $Q(x) = x^3-3x^2 - 2x$ then we can write

$Q(x) = x(x^2-3x+2) = x(x-1)(x+2)$

We will now show how to write ${P(x) \over Q(x)}$ as a sum of terms of the form

${A \over (ax+b)^k}$ and ${Ax+B \over (ax^2+bx+c)^k}.$

Exactly how to do this depends on the factorization of $Q(x)$ and we now give four cases that can occur.

### Q(x) is a product of linear factors with no repeatsEdit

This means that $Q(x) = (a_1x+b_1)(a_2x+b_2)...(a_nx+b_n)$ where no factor is repeated and no factor is a multiple of another.

For each linear term we write down something of the form ${A \over (ax+b)}$, so in total we write

${P(x) \over Q(x)} = {A_1 \over (a_1x+b_1)} + {A_2 \over (a_2x+b_2)} + \cdots + {A_n \over (a_nx+b_n)}$
 Example 1 Find $\int {1+x^2 \over (x+3)(x+5)(x+7)}dx$ Here we have $P(x)=1+x^2, Q(x)=(x+3)(x+5)(x+7)$ and Q(x) is a product of linear factors. So we write $\frac{1+x^2}{(x+3)(x+5)(x+7)}=\frac{A}{x+3}+\frac{B}{x+5}+\frac{C}{x+7}$ Multiply both sides by the denominator $1+x^2=A(x+5)(x+7)+B(x+3)(x+7)+C(x+3)(x+5)$ Substitute in three values of x to get three equations for the unknown constants, $\begin{matrix} x=-3 & 1+3^2=2\cdot 4 A \\ x=-5 & 1+5^2=-2\cdot 2 B \\ x=-7 & 1+7^2=(-4)\cdot (-2) C \end{matrix}$ so $A=5/4, B=-13/2, C=25/4$, and $\frac{1+x^2}{(x+3)(x+5)(x+7)}=\frac{5}{4x+12} -\frac{13}{2x+10} +\frac{25}{4x+28}$ We can now integrate the left hand side. $\int \frac{1+x^2 \, dx}{(x+3)(x+5)(x+7)}= \frac{5}{4} \ln|x+3| - \frac{13}{2}\ln|x+5|+ \frac{25}{4}\ln|x+7|+ C$

#### ExercisesEdit

Evaluate the following by the method partial fraction decomposition.

1. $\int\frac{2x+11}{(x+6)(x+5)}dx$

$\ln|x+6|+\ln|x+5|+C$

2. $\int\frac{7x^{2}-5x+6}{(x-1)(x-3)(x-7)}dx$

$\frac{2}{3}\ln|x-1|-\frac{27}{4}\ln|x-3|+\frac{157}{12}\ln|x-7|+C$

Solutions

### Q(x) is a product of linear factors some of which are repeatedEdit

If $(ax+b)$ appears in the factorisation of $Q(x)$ k-times then instead of writing the piece ${A \over (ax+b)}$ we use the more complicated expression

${A_1\over ax+b} + {A_2\over (ax+b)^2} + {A_3\over (ax+b)^3} + \cdots + {A_k\over (ax+b)^k}$

 Example 2 Find $\int {1 \over (x+1)(x+2)^2}dx$ Here $P(x)=1$ and $Q(x)=(x+1)(x+2)^2$ We write $\frac{1}{(x+1)(x+2)^2}=\frac{A}{x+1}+\frac{B}{x+2}+\frac{C}{(x+2)^2}$ Multiply both sides by the denominator $1= A(x+2)^2+B(x+1)(x+2)+C(x+1)$ Substitute in three values of $x$ to get 3 equations for the unknown constants, $\begin{matrix} x=0 & 1= 2^2A +2B+C \\ x=-1 & 1=A \\ x=-2 & 1= -C \end{matrix}$ so $A=1$, $B=-1$, $C=-1$, and $\frac{1}{(x+1)(x+2)^2}=\frac{1}{x+1}-\frac{1}{x+2}-\frac{1}{(x+2)^2}$ We can now integrate the left hand side. $\int \frac{1}{(x+1)(x+2)^2} dx= \ln \frac{1}{x+1} - \ln \frac{1}{x+2} + \frac{1}{x+2} +C$ We now simplify the fuction with the property of Logarithms. $\int \ln \frac{1}{x+1} - \ln \frac{1}{x+2} + \frac{1}{x+2} + C = \ln \frac{x+1}{x+2} + \frac{1}{x+2} +C$

#### ExerciseEdit

3. Evaluate $\int\frac{x^{2}-x+2}{x(x+2)^{2}}dx$ using the method of partial fractions.

$\frac{1}{2}\ln|x|+\frac{1}{2}\ln|x+2|+\frac{4}{x+2}+C$

Solution

### Q(x) contains some quadratic pieces which are not repeatedEdit

If $(ax^2+bx+c)$ appears we use ${Ax+B \over (ax^2+bx+c)}.$

#### ExercisesEdit

Evaluate the following using the method of partial fractions.

4. $\int \frac{2}{(x+2)(x^{2}+3)} dx$

$\frac{2}{7}\ln|x+2|-\frac{1}{7}\ln|x^{2}+3|+\frac{4}{7\sqrt{3}}\arctan(\frac{x}{\sqrt{3}})+C$

5. $\int\frac{dx}{(x+2)(x^{2}+2)}$

$\frac{1}{6}\ln|x+2|-\frac{1}{12}\ln|x^{2}+2|+\frac{\sqrt{2}}{6}\arctan(\frac{x}{\sqrt{2}})+C$

Solutions

### Q(x) contains some repeated quadratic factorsEdit

If $(ax^2+bx+c)$ appears k-times then use

${A_1x+B_1 \over (ax^2+bx+c)} + {A_2x+B_2 \over (ax^2+bx+c)^2} + {A_3x+B_3 \over (ax^2+bx+c)^3} + \cdots + {A_kx+B_k \over (ax^2+bx+c)^k}$

#### ExerciseEdit

Evaluate the following using the method of partial fractions.

6. $\int\frac{dx}{(x^{2}+1)^{2}(x-1)}$

$-\frac{1}{2}\arctan(x)+\frac{1-x}{4(x^{2}+1)}+\frac{1}{8}\ln\left(\frac{(x-1)^{2}}{x^{2}+1}\right)+C$

Solution

 ← Integration techniques/Trigonometric Integrals Calculus Integration techniques/Tangent Half Angle → Integration techniques/Partial Fraction Decomposition