How to integrate by partial fractions

A partial fractions decomposition can be useful if we want to compute an integral

\int _a ^b \frac{p(x)}{q(x)}dx

where the functions p(x) and q(x) are polynomials in x. This post explains, how such a decomposition works and how this method helps to simplify such integrals.

At first we notice that the problem lies in the polynomial q(x) of the denominator. The polynomial in the numerator doesn’t bother us much, because we can easily decompose the problem into a sum of integrals, such that each of them only has a monomial in the numerator. For example:

\int _a ^b \frac{4x^3+5x^2+9}{q(x)}dx =  \int _a ^b \frac{4x^3}{q(x)}dx + \int _a ^b \frac{5x^2}{q(x)}dx + \int _a ^b \frac{9}{q(x)}dx

Obviously we can’t do this with the polynomial q(x). However, by the following method we can use a factorization of q(x) to arrive at a sum of integrals where the denominators are simple.

Assumption on the degrees of the polynomials

For the above integral to exist, the denominator q(x) shall not be constant zero. Furthermore, we assume that the degree of the polynomial q(x) is greater than the degree of the polynomial p(x). In this case the integrand is called a proper rational function. An example for such a function is

f(x)=\frac{x^2+4}{2x^3-9x^2+x-1.}

Here we have a polynomial of degree 2 in the numerator and one of degree 3 in the denominator.

This assumption is not a real restriction of the class of integrals we consider. If it is not fulfilled and instead we have a polynomial with a greater degree in the numerator, we can use polynomial division to write the integrand as

\frac{p(x)}{q(x)} = s(x)+\frac{P(x)}{Q(x)}

where s(x), P(x) and Q(x) are new polynomials. Now the degree of Q is greater than the degree of P and we can apply the following method to this part of the function.

Step 1: Find a factorization of the denominator

In the first step, we have to decompose the polynomial q(x) into its factors as far as possible. In the ideal case, we can decompose q(x) into n linear factors:

q(x)=(x-x_1)^{a_1}(x-x_2)^{a_2}...(x-x_n)^{a_n}.

Such a decomposition does always exist, if we allow the constants x1, x2, …, xn to be complex numbers. (The existence of such a factorization is known as the fundamental theorem of algebra.) However, if we restrict ourselves to the real numbers or any other number field, a decomposition into linear factors might not exist. For example we can decompose x2+1=(xx1)(x+x2) with x1=i and x2=-i. However, there are no real numbers x1, x2 for which this decomposition exists. For the moment, let us assume that q(x) can be written as a product of linear factors. At the end of this post, we come back to cases, where this is not possible.

Finding a linear factorization can be difficult. A standard approach is to try guessing one factor after another, searching for values of x where q(x) is zero. Let’s say q(x) is a polynomial of degree n and we are able to guess one of the factors, say (xx1). Then we divide q(x) by this term and obtain a new polynomial q‘(x)=q(x)/(xx1). This polynomial q‘(x) is of degree n-1 and therefore it may be easier to guess the next factor, and so on.

As an example consider q(x)=x3+3x2-4. As the polynomial vanishes for x=1, we can guess that one of the factors is (x-1). We obtain q‘(x)=q(x)/(x-1)=x2+4x+4. It is not very difficult to see that this is in fact (x+2)2. So we arrive at the factorization q(x)=(x+2)2(x-1).

Step 2: Ansatz for the partial fractions decomposition

With respect to the above factorization of q(x) we write the following Ansatz for a decomposition of the integrand:

\frac{p(x)}{q(x)}=\frac{A_{11}}{(x-x_{1})}+\frac{A_{12}}{(x-x_{1})^{2}}+...+\frac{A_{1a_{1}}}{(x-x_{1})^{a_{1}}}+\frac{A_{21}}{(x-x_{2})}+\frac{A_{22}}{(x-x_{2})^{2}}+...+\frac{A_{2a_{2}}}{(x-x_{2})^{a_{2}}}+...+\frac{A_{k1}}{(x-x_{k})}+...+\frac{A_{ka_{k}}}{(x-x_{k})^{a_{k}}}

Notice that for each factor (xxi) we introduce terms with denominators (xxi), (xxi)2, (xxi)3, and so on, up to (xxi)ai. In the numerator of these terms, we introduce place-holders Aij . These will be determined in the next step.

As an example we consider the integral

I=\int_{a}^{b}\frac{x}{(x+2)^{2}(x-1)}dx

The corresponding Ansatz for the decomposition reads

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

where for simplicity we named the place-holders A11=A, A12=B, A21=C.

Step 3: Determine the numerators in the Ansatz by comparison of coefficients

As a next step we expand the terms in the sum of our Ansatz such that they have the same denominator. This resulting denominator is our polynomial q(x). In the numerator, we obtain a polynomial with coefficients depending on the numbers Aij . Schematically, we have:

\frac{p(x)}{q(x)}= \frac{\textrm{Polynomial involving the }A_{ij}}{q(x)}

As the denominators are the same on both sides of the equation, the numerators have to be the same as well. Therefore the polynomial with the unknown Aij in the coefficients must be equal to p(x). We use this fact to determine the numbers Aij by comparing the coefficients for each power of x on the left- and the right-hand side of this equation.

This is best understood by looking at the example again. We expand the terms in our Ansatz such that they all have the same denominator:

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

As this denominator is q(x), the new numerator has to be equal to p(x)=x. For each power of x in the complicated polynomial on the right-hand side, the coefficient has to agree with the corresponding term of p(x). Hence we obtain:

power of xcoefficient in p(x)coefficient on the
right-hand side
relation
x00-2AB+4C0=-2AB+4C
x11A+B+4C1=A+B+4C
x20A+C0=A+C
comparing coefficients

We solve the resultung system of equations for A, B and C and obtain

A=-\frac{1}{9},\textrm{ }B=\frac{2}{3},\textrm{ }C=\frac{1}{9}.

Inserting these coefficients into our Ansatz, we arrive at the desired decomposition:

\frac{p(x)}{q(x)}=\frac{x}{(x+2)^{2}(x-1)}=-\frac{1}{9}\frac{1}{x+2}+\frac{2}{3}\frac{1}{(x+2)^{2}}+\frac{1}{9}\frac{1}{x-1}

Step 4: Decompose the integral

In the final step, we insert the decomposition into the integral. In this way, we obtain a sum of integrals. In each of the resulting integrals, the denominator is just one of the factors of q(x). This is a great advantage to the original integral and helps to find the primitives.

In our example, we obtain

I=-\frac{1}{9}\int_{a}^{b}\frac{1}{x+2}dx+\frac{2}{3}\int_{a}^{b}\frac{1}{(x+2)^{2}}dx+\frac{1}{9}\int_{a}^{b}\frac{1}{x-1}dx =-\frac{1}{2}\left[\ln(|x+2|)\right]_{a}^{b}-\frac{2}{3}\left[\frac{1}{x+2}\right]_{a}^{b}+\frac{1}{9}\left[\ln\left(|x-1|\right)\right]_{a}^{b}

We see that the partial fractions decomposition has allowed us to express the original integral as a sum of easier integrals, for which we know the primitives and which we can compute. Of course one can combine this method with other techniques like substitution or partial integration. It is one of these methods which manipulate and decompose integrals until they are sufficiently simple to find the primitive.

Extension to non-linear factors

As a final remark we return to the problem that a factorization of the polynomial q(x) into linear factors might not exist if we restrict ourselves to real numbers or other number fields. Assume we have an irreducible polynomial r(x) of degree m as a factor of q(x). Then in our Ansatz for the decomposition, we have to introduce a corresponding fraction with r(x) in the denominator. In the numerator of this term we have to introduce a polynomial with degree smaller than m. Furthermore, if r(x) appears to some power b in q(x), we again have to introduce corresponding terms with r, r2,…,rb in the denominators, following the general principle above.

Let us assume that q(x) has a factor which is a power of an irreducible quadratic polynomial, say (r(x))b=(x2+ux+v)b. In this case, the Ansatz includes corresponding terms as follows:

\frac{p(x)}{(x-x_1)^{a_1}...(x^2+ux+v)^b}=\frac{A_{11}}{(x-x_{1})}+...+\frac{A_{1a_{1}}}{(x-x_{1})^{a_{1}}}+...+\frac{B_1x+C_1}{x^2+ux+v}+\frac{B_2x+C_2}{(x^2+ux+v)^2}+...+\frac{B_bx+C_b}{(x^2+ux+v)^b}

In this sense, one introduces terms for each irreducible polynomial. With this Ansatz, one proceeds with the remaining steps as above.

Leave a comment