Integration by Partial Fractions – Examples with Answers

Integration by partial fractions is an integration technique that consists of rewriting a rational function as the sum of simple fractions. Then, the integral of each fraction can be easily found.

In this article, we will learn how to integrate by partial fractions. We will explore several solved exercises of integration by partial fractions or simple fractions. Then, we will look at some practice problems.

Example of integration by partial fractions

Relevant for

Learning about integration by partial fractions with examples.

See examples

Example of integration by partial fractions

Relevant for

Learning about integration by partial fractions with examples.

See examples

How to integrate functions by partial fractions

The partial fraction method is used to integrate rational functions as follows:

$$\int \frac{x+2}{(x-1)(x-3)}dx$$

To integrate a rational function using partial fractions we follow the steps below:

1. Decompose the rational function into its partial fractions

You can make a revision of the methods of partial fraction decomposition in this article.

2. Form an integral with each partial fraction

The integral of the sum of fractions is equal to the sum of the integrals of each fraction.

3. Solve each integral using the natural logarithm

We use the standard integral $latex \int \frac{1}{x}=\ln (x)+c$ and the chain rule.

Integration by partial fractions – Examples with answers


Find the integral:

$$\int \frac{x^2+x+3}{x-2}dx$$

This case corresponds to an integrand of the form $latex \frac{P(x)}{Q(x)}$ where the degree of $latex P(x)$ is greater than or equal to the degree of $latex Q(x) )$.

In such a case, the first thing to do is perform the division of polynomials. In this way, the quotient $latex \frac{P(x)}{Q(x)}$ is expressed as:

$$ \dfrac{P(x)}{Q(x)}=q(x)+\dfrac{r(x)}{Q(x)}$$

Where $latex q(x)$ is the quotient and $latex r(x)$ is the remainder. For the integrand of the example, we obtain:

$$ (x^2+x+3)\,\div\, (x-2)= (x+3) + \dfrac{9}{x-2}$$

With this in mind, the integral to be solved is rewritten as follows:

$$\int \left(\frac{x^2+x+3}{x-2}\right)dx=\int \left[(x+3) + \frac{9}{x-2}\right]dx$$

Obtaining three immediate integrals:

$$\int \left(\frac{x^2+x+3}{x-2}\right)dx=\int x\,dx+3\int dx +9\int \frac{dx}{x-2}$$

$$\int \left(\frac{x^2+x+3}{x-2}\right)dx=\frac{x^2}{2}+3x +9\ln|x-2|+C$$


Calculate the following integral by the method of partial fractions:

$$\int \frac{dx}{x^2-9}$$

Since the degree of the denominator is greater than the degree of the numerator, it is not necessary to divide, and we go directly to factoring the denominator, which is very simple since it is a difference of perfect squares:


Thus, the proposed integral would be as follows:

$$\int \frac{dx}{x^2-9}=\int \frac{dx}{(x+3)(x-3)}$$

Since the denominator is the product of two linear factors, the integrand can be expressed in this way:

$$ \frac{dx}{x^2-9}=\frac{1}{(x+3)(x-3)}=\frac{A}{x+3}+\frac{B}{x-3}$$

Solving the sum of algebraic fractions, results:

$$ \frac{1}{(x+3)(x-3)}=\frac{A}{x+3}+\frac{B}{x-3}$$




Since the denominator is always the same, we have:

$$x(A+B)-3A+3B = 1$$

Equating the respective coefficients of each power of $latex x$, leads to the following equations:

$latex \phantom{-3}A+\phantom{3}B=0$

$latex -3A+3B=1$

Adding both equations term by term, we deduce that:

$latex 2B=1\Rightarrow B=\dfrac{1}{2}$

Since $latex A=-B$, then:

$latex A=-\dfrac{1}{2}$


$$ \frac{1}{(x+3)(x-3)}=\frac{A}{x+3}+\frac{B}{x-3}$$


And the integral sought is transformed into:

$$\int \frac{dx}{x^2-9}=-\frac{1}{2}\int\frac{dx}{x+3}+\frac{1}{2}\int\frac{dx}{x-3}$$

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


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


Solve the following integral:


The degree of the numerator is less than the degree of the denominator, therefore, the denominator is factored, which turns out to be the cube of a sum:


The integral is then written with the denominator already factored:


Note that the denominator consists of a single linear factor that is raised to the cube, whose form is $latex (px+q)^m$, with $latex m=3$.

In such a case, the decomposition into simple fractions of the integrand takes the following form:


And now we follow a similar process as in the previous example, in order to find the coefficients $latex A$, $latex B$ and $latex C$:


Then, the numerator is carefully developed:

$$A(x+1)^2+B(x+1)+C =A(x^2+2x+1)+Bx+B+C$$


By equating the coefficients of the equal powers on both sides of the equality, the following equations are obtained:

$latex A=0$

$latex 2A+B=3\Rightarrow B=3$

$latex B+C=2\Rightarrow C=-1$

With these values, the integrand is as follows:



Now the original integral is transformed into the sum of two easily solved integrals through a simple change of variable:


The change of variable is $latex u =x+1$, $latex du=dx$:


Applying the power rule for integration, we obtain:


$$=3\int u^{-2}du-\int u^{-3}du$$





Calculate the following integral:


It is observed that the degree of the denominator is greater than that of the numerator, so the denominator is factored:


The trinomial $latex x^2+x-2$ can be easily factored:


Which is substituted in the denominator of the integrand:



Since there are linear factors in the denominator, the algebraic fraction can be expressed as follows:


Where the coefficients $latex A$, $latex B$ and $latex C$ are real numbers to be determined by simple algebra:



$$=\frac{A( x^2+x-2)+B(x^2-x)+C(x^2+2x)}{x(x+2)(x-1)}$$

$$=\frac{ x^2(A+B+C)+x(A-B+2C)-2A}{x(x+2)(x-1)}$$

Which results in the following:

$$x^2(A+B+C)+x(A-B+2C)-2A =x^2+2x-1$$

Equalizing the coefficients of the similar powers, we obtain the following equations:

$latex A+B+C=1$

$latex A-B+2C=2$


From the latter, it is easy to deduce that:

$latex A = \dfrac{1}{2}$

And adding the first two equations, $latex B$ cancels and leaves:

$latex 2A+3C=3$

Substituting $latex A = \dfrac{1}{2}$ here, results in:

$latex 2\left(\frac{1}{2}\right)+3C=3$

$latex 1+3C=3$

$latex 3C=2$

$latex C = \dfrac{2}{3}$

Knowing the values of $latex A$ and $latex C$, the value of $latex B$ is removed from any of the equations in which it appears:

$$A+B+C=1\Longrightarrow B=1-A-C=1-\dfrac{1}{2}-\dfrac{2}{3}=\dfrac{1}{6}$$

$latex B= -\dfrac{1}{6}$

Once the coefficients are obtained, they are substituted in the integral as follows:








Find the integral:


In this case, the denominator is already factored, and consists of a linear factor and a quadratic and irreducible factor. When this happens, the decomposition into simple fractions looks like this:


Following a similar process to that of the previous examples, the addition of fractions is carried out:



Forming an equation with the numerators, we have:


The system of three equations with three unknowns is obtained:

$latex \phantom{-}A+B=0\\-B+C=0\\\phantom{-}A-C=2\\$

And its solution is: $latex A=1$, $latex B=-1$, $latex C=-1$.

Thus, the algebraic fraction becomes:



And the integral results in:


$$\int\frac{2}{(x-1)(x^2+1)}dx=\ln\left|x-1\right|-\frac{1}{2}\ln(x^2+1)-\arctan x+C$$


Find the integral:


In the denominator of this integral appears a polynomial of 3rd degree, which can be factored by Ruffini’s method.

$$\begin{array}{r|rrrr}  & 1 & 0 & -2 & -4\\ 2 &  & 2 & 4 & 4\\ \hline  & 1 & 2 & 2 & 0\end{array}$$

The resulting polynomial cannot be factored, so the denominator looks like this:

$$x^3-2x-4 = (x-2)(x^2+2x+2)$$

Then, the integrand is rewritten as:


Since the denominator consists of a linear factor and a quadratic and irreducible factor, the algebraic fraction can be decomposed in this way:





Forming an equation with the numerators:


The system of equations is obtained:

$$\phantom{2}A+\phantom{2}B\phantom{+C} = 0\\ 2A-2B+C = 3\\ 2A\phantom{-2B}-C = 4\\$$

That has this solution: $latex A=1$, $latex B=-1$, $latex C=-1$.

The proposed integral is rewritten as follows:



The first integral is direct:


The second is easily solved through a change of variable:

$latex u = x^2+2x+2$

$latex du = (2x+2)dx=2(x+1)dx$


Putting both results together:



Solve the following:

$$\int\frac{e^t dt}{e^{2t}+3e^t+2}$$

At first glance, it does not seem that the method of simple fractions is applicable, however, the following change of variable makes it possible:

$latex u =e^t$

$latex du=e^t dt$

Thus, the integral is rewritten as:

$$\int\frac{e^t dt}{e^{2t}+3e^t+2}=\int \frac {du}{u^2+3u+2}$$

The denominator is factored as:


And the integral is expressed as follows:

$$\int\frac{e^t dt}{e^{2t}+3e^t+2}=\int \frac {du}{u^2+3u+2}=\int\frac {du}{(u+2)(u+1)}$$

Immediately, the integrand is written as:

$$\frac {1}{(u+2)(u+1)}=\frac {A}{u+2}+\frac{B}{u+1}$$

$$=\frac {A(u+1)+B(u+2)}{(u+2)(u+1)}=\frac {Au+A+Bu+2B}{(u+2)(u+1)}$$

$$=\frac {u(A+B)+A+2B}{(u+2)(u+1)}$$

The system of equations obtained by equating the numerators is:

$latex A+\phantom{2}B=0\\A+2B=1\\$

And its solution is: $latex A= -1$, $latex B =1 $.


$$\int\frac {du}{(u+2)(u+1)}=-\int \frac{du}{x+2}+\int \frac{du}{x+1}$$


$$=\ln\left| \frac{u+1}{u+2}\right|+C$$

Finally, returning the change of variable made at the beginning, we have:

$$\int\frac{e^t dt}{e^{2t}+3e^t+2}=\ln\left( \frac{e^t+1}{e^t+2}\right)+C$$


Calculate the integral:

$$\int\frac{\sin x dx}{\cos x(\cos x-1)}$$

As in the previous case, it is convenient to change the variable:

$latex u = \cos x$

$latex du=-\sin x dx$

In this way:

$$\int\frac{\sin x dx}{\cos x(\cos x-1)}=\int\frac{-du}{u(u-1)}=-\int\frac{du}{u(u-1)}$$

The integrand becomes:



The resulting system of equations is:

$latex A+B=0\\\phantom{+}-A=1\\$

Then: $latex A =-1 $, $latex B =1 $.

The original integral becomes:

$$\int\frac{\sin x dx}{\cos x(\cos x-1)}=-\left[\int\frac{-du}{u}+\int\frac{du}{u-1}\right]$$

$$=\ln|u|-\ln|u-1|+C=\ln\left| \frac{u}{u-1}\right|+C$$


$$\int\frac{\sin x dx}{\cos x(\cos x-1)}=\ln\left| \frac{\cos x}{\cos x-1}\right|+C$$


Determine the following integral:


As always, the first step is to find the factorization of the denominator:


With $latex u=x^2$, we have:







The following equations are obtained:

$latex A + \phantom{3}C = 1\\B +\phantom{3}D= 1\\A+3C=1\\B+3D=3\\$

Subtracting the third equation from the first one, we obtain:

$latex 2C=0\Rightarrow C=0$

$latex A=1$

And subtracting the fourth from the second:

$latex 2D=2\Rightarrow D =1$

$latex B=0$



And the integral becomes:



Find the integral:


Since the degree of the numerator is greater than the degree of the denominator, it is necessary to first perform the division of polynomials and then apply the division algorithm:

$$ (x^4-6x^3+12x^2+6)\,\div\, (x^3-6x^2+12x-8)=$$

$$= x + \dfrac{8x+6}{x^3-6x^2+12x-8}$$

The denominator of the algebraic fraction is the cube of a difference, so it is factored like this:


All of the above leads to:

$$\int\frac{x^4-6x^3+12x^2+6}{x^3-6x^2+12x-8}dx=\int xdx+\int \frac{8x+6}{x^3-6x^2+12x-8}dx=$$

$$=\int xdx+\int\frac{8x+6}{(x-2)^3}dx$$

The integrand of the second integral is decomposed into simple fractions as follows:


Solving the sum of fractions on the right-hand side and forming an equation with the numerators, we have:

$latex A((x-2)^2+B(x-2)+C=8x+6$

$latex A(x^2-4x+4)+Bx-2B+C=8x+6$

$latex Ax^2-4Ax+4A+Bx-2B+C=8x+6$

The resulting system of equations is:

$$\phantom{-4}A\phantom{+B}\phantom{+C;} = 0 \\ -4A+B\phantom{+C;} = 8 \\\phantom{-}4A-2B+C = 6\\$$

Therefore: $latex B = 8$

And we have $latex -16+C=6\Rightarrow C =22$




Which leads to:

$$\int\frac{x^4-6x^3+12x^2+6}{x^3-6x^2+12x-8}dx=\int xdx+\int\frac{8x+6}{(x-2)^3}dx$$

$$=\int xdx+\int\frac{8}{(x-2)^2}dx+\int\frac{22}{(x-2)^3}dx$$

$$=\int xdx+8\int(x-2)^{-2}dx+22\int (x-2)^{-3}dx$$


And the answer is:


Integration by partial fractions – Practice problems

Integration by partial fractions quiz
You have completed the quiz!

See also

Interested in learning more about integrals? You can take a look at these pages:

Profile picture for author Jefferson Huera Guzman

Jefferson Huera Guzman

Jefferson is the lead author and administrator of The interactive Mathematics and Physics content that I have created has helped many students.

Learn mathematics with our additional resources in different topics