> restart;

>

Partial Fractions

Partial Fraction Decomposition and Integration

Partial fraction decomposition is a very useful method of rewriting rational functions in simpler terms. Partial fraction decomposition is used to integrate rational functions, but it also has other important applications that you will see later. Among others, partial fractions are used in engineering for finding inverse Laplace transforms. Let's look at the following example:

> Int(1/(x^2-4),x); value(%);

[Maple Math]

[Maple Math]

>

How did Maple find the integral? Exactly the same way that you could find it by hand: by partial fraction decomposition of the rational function [Maple Math] . Namely:

[Maple Math] .

How can such a decomposition be found?

Example 1 . Find, by hand, the partial fraction decomposition of [Maple Math] .

If the numerator of a given rational function is of a lower degree than its denominator, you start your work by factoring the denominator. (Otherwise, as in Example 5 below, you perform the long division first.) The denominator of the above function factors to [Maple Math] . According to an important theorem in algebra, this means that the rational function can be decomposed into the following simpler terms

[Maple Math]

for some constants A, B. To find these constants we use the method of undetermined coefficients . If the above equality is to hold then it must be that:

[Maple Math] .

Since the denominators on both sides are the same, the numerators also must be the same. Hence

[Maple Math] .

Rearranging the terms in the left hand side we obtain

[Maple Math] .

We know that two polynomials are equal if and only if coefficients at the corresponding powers of x are equal. Hence, we obtain the following equations for A and B

[Maple Math] ,

which gives us [Maple Math] . Thus

[Maple Math] .

We have obtained the partial fraction decomposition, which, of course allows us to find easily the integral of [Maple Math] .

It is important to know what kind of partial fraction decomposition to expect for a given rational function. The key is to factor the denominator. Then the general rules are as follows. If the factored denominator contains a first degree term [Maple Math] of mulitiplicity 1, this term gives rise to a single partial fraction [Maple Math] for some constant A, as in Example 1. If the denominator contains a term [Maple Math] of multiplicity k, this term gives rise to possibly k partial fractions

[Maple Math] , [Maple Math] , ..., [Maple Math] ,

for some constants [Maple Math] , [Maple Math] ,... [Maple Math] . If the factored denominator contains an irreducible quadratic term [Maple Math] , that is, a quadratic term which does not have real roots, that term gives rise to a fraction

[Maple Math]

for some constants B, C. If the factored denominator contains an irreducible quadratic factor [Maple Math] of multiplicity k, that term gives rise to possibly k fractions of the form

[Maple Math] , [Maple Math] , ..., [Maple Math] .

An important theorem in algebra says that every polynomial with real coefficients can be factored into first degree polynomials and irreducible quadratic polynomials with real coefficients. Furthermore, any rational function such that its denominator has the degree greater than its numerator, can be decomposed into partial fractions according to the rules stated above.

The theorem says that decomposition into partial fractions is possible. Quite another matter is finding such decomposition for a given rational function. As you can quess, the first obstacle may be factoring the denominator, which often is a difficult task. Maple can handle a variety of situations with simple commands.

The basic command for finding a partial fraction decomposition is " convert( expression, parfrac, variable ) ". For example

> convert(1/(x^2-4),parfrac,x);

[Maple Math]

>

Example 2. Consider the rational expression

[Maple Math] .

Factor the denominator of w. Find the partial fraction decomposition. Find the indefinite integral of w. Compare the three.

>

First let's define the expression w.

> w:=(6*x^4-5*x+2)/(x^5+5*x^3+4*x^4+4*x^2+4*x);

[Maple Math]

>

Now we want to factor the denominator of w. To save retyping we use the command " denom " which gives the denominator of a given expression. Similarly, the command " numer ", which we shall use later in this worksheet, gives the numerator of a given expression. This is how they act.

> numer(w);

[Maple Math]

> denom(w);

[Maple Math]

As you see, Maple couldn't help itself and somewhat simplifed the output. Let's factor the denominator.

> factor(denom(w));

[Maple Math]

>

We see a first degree term x of multiplicity 1, a first degree term [Maple Math] of multiplicity 2, and an irreducible quadratic term [Maple Math] . The rules above tell us what kind of partial fraction decomposition to expect. Indeed:

> convert(w,parfrac,x);

[Maple Math]

The decomposition has the form that we expected. Now let's look at the integral.

> Int(w,x); value(%);

[Maple Math]

[Maple Math]

>

Clearly, the integral was found via partial fractions. You can see how to each fraction there corresponds a term in the integral. The last fraction gives rise to the two last terms in the integral. They were obtained by splitting the fraction into two parts: one with 4x in the numerator, which, after a simple substitution, gives the logarithm, and the second part with 47 in the numerator, which, of course, leads to arctan(x). Similarly, as long as [Maple Math] is a polynomial with no real roots, any expression of the form [Maple Math] can be easily be integrated (by substitution and completing the square), giving rise to a term containing a logarithm and a term containing an arctangent.

Remark 1. Observe that w is defined as an expression in terms of x and not a function. We could have defined the corresponding rational function f(x). In that case the proper syntax would be " convert(f(x),parfrac,x); ", and not "convert(f,parfrac,x);".

>

Example 3 . Define an expression m which gives a formula for a rational function

> m:=(x^8+x^7+2)/(x^6-5*x^4-9*x^2+8*x^3+8*x-3);

[Maple Math]

>

Find the integral of m. Find the partial fraction decomposition of m. Factor the denominator of m. Compare the three.

Let's ask Maple for the integral of m first:

> Int(m,x); value(%);

[Maple Math]

[Maple Math]

>

How did Maple obtain the value of the integral? By a partial fraction decomposition of the expression m. Let's find it.

> convert(m,parfrac,x);

[Maple Math]

Note that the partial fraction decomposition of m contains a polynomial term. That is because the numerator of m is of a higher degree than its denominator, in which case the long division is performed first. The resulting polynomial is left alone, and the rational function whose denominator has greater degree than the numerator is decomposed into partial fractions.

It is clear how terms of the decomposition correspond to the terms in the integral. Can you quess from the decomposition what are the factors of the denominator of m and with what multiplicities? Pretty much. Let's check.

> factor(denom(m));

[Maple Math]

>

This is, indeed, what we expected.

Partial Fraction Decomposition Step-by-Step

As you see Maple does for you partial fraction decomposition which you will find very useful in the future. How does Maple do it? This one time, in Example 5 below, we shall retrace Maple's reasoning and do the partial fraction decomposition of m step-by-step. As you may expect, the algebra is going to be brutal. Don't worry, however. Maple will do all the hard work!. It will give you a good introduction to handling rational functions and doing other algebraic chores in Maple. Before we recreate the partial fraction decomposition of m, let's look at a simple example of how to do the long division of polynomials in Maple.

Example 4 (Long Division). You can easily check by hand that

[Maple Math]

Let's do the long division of [Maple Math] by [Maple Math] using Maple.

Let's first define the polynomials in question

> p1:=x^3+1;

[Maple Math]

> p2:=x^2+2*x;

[Maple Math]

The two basic commands for long division are " quo " and " rem ". One gives you the quotient, the other the remainder.

> quo(p1,p2,x);

[Maple Math]

> rem(p1,p2,x);

[Maple Math]

The final form of the quotient p1/p2 can be written as

> quo(p1,p2,x)+rem(p1,p2,x)/p2;

[Maple Math]

>

Example 5 (Finding Partial Fraction Decomposition Step-by-Step). Find the partial fraction decomposition of the expression m, step-by-step, using Maple to help you with the algebra.

Since our rational expression, m, is high up in the worksheet, let's remind ourselves of what m is

> m;

[Maple Math]

Since the degree of the numerator is higher than the degree of the denominator, we shall perform the long division first.

> quo(numer(m),denom(m),x);

[Maple Math]

> rem(numer(m),denom(m),x);

[Maple Math]

This means that the expression m can be rewritten as

> quo(numer(m),denom(m),x)+rem(numer(m),denom(m),x)/denom(m);

[Maple Math]

The first part is a polynomial. We shall leave it alone and focus on finding the partial fraction decomposition of the rational term. Define that term as k.

> k:=rem(numer(m),denom(m),x)/denom(m);

[Maple Math]

To find the partial fraction decomposition of k, we have to first factor the denominator.

> factor(denom(k));

[Maple Math]

We see one first order term [Maple Math] of multiplicity 1, one first order term [Maple Math] of multiplicity 3, and one irreducible quadratic term [Maple Math] . This tells us what form the partial fraction decomposition of k is going to take. Let's call it "decompk".

> decompk:=A/(x+3)+B/(x-1)+C/((x-1)^2)+H/((x-1)^3)+(G*x+M)/(x^2+1);

[Maple Math]

>

For some constants A,B,C,H, G, M the expression k will have the above form. (We do not use "D" as a constant as D has an assigned meaning in Maple.) The next step is finding constants A,B,C,H,G,M. It can be done in several ways. For example, we could follow the method of Example 1. However, there is a simpler way of finding the constants, and we use it below.

Finding A,B,C,G,H,M.

We know that decompk has to be equal to k for all values of x, except x=1,-3, where the denominators are 0. We have six unknowns A,B,C,G,H,M, let's choose six values for x, say 0,2,3,4,5,6, substitute them one-by-one into k and decompk, and set up the corresponding equations. Let's label these equations eq1, eq2... and so on. Do not confuse the sign " := ", which means "defined as", with " = ", which means "equals". Below we define six equations. For example, eq1:=subs(x=0,k=decompk); means that eq1 is defined as the equation that you obtain by substituting x=0 into both sides of the equation k=decompk, that is, into both sides of the equation:

[Maple Math]

> eq1:= subs(x=0,k=decompk);

[Maple Math]

As you see, Maple evaluated k and decompk at x=0 and set both values equal.

> eq2:=subs(x=2,k=decompk);

[Maple Math]

> eq3:=subs(x=3,k=decompk);

[Maple Math]

> eq4:=subs(x=4,k=decompk);

[Maple Math]

> eq5:=subs(x=5,k=decompk);

[Maple Math]

> eq6:=subs(x=6,k=decompk);

[Maple Math]

Now we shall solve the corresponding system of equations. We label our solutions sols.

> sols:=solve({eq1,eq2,eq3,eq4,eq5,eq6},{A,B,C,G,H,M});

[Maple Math]

>

We have obtained the desired constants.

Once we have found the constants A,B,C,G,H,M we can substitute them into decompk and obtain the partial fraction decomposition of k. Since [Maple Math] , we obtain the partial fraction decomposition of m by subsituting the constants into decompk and adding the polynomial. Let's call the result of this operation decm.

> decm:=x^2+x+5+subs(sols,decompk);

[Maple Math]

>

We have obtained the partial fraction decomposition of the expression m "by hand" using Maple only to help us with algebra. Let's recall the result that we obtained using the "convert(m,parfrac,x);" command.

> convert(m,parfrac,x);

[Maple Math]

>

Clearly, in the future, we are going to use the "convert(..,parfrac,...)" command rather than finding partial fraction decompositions by hand.

What if Roots of the Denominator are not Rational?

The command " convert(..,parfrac,..); ", similarly as the related command " factor ", work very reliably as long as the denominator has rational roots. As long as all coefficients in your expression are rationals in a non-decimal form, both commands are, in fact, telling Maple to find a factorization or a partial fraction decomposition using only rational numbers as constants. If your polynomial or the denominator of your rational function happen to have irrational roots, the commands may not work at all. For example:

> convert(1/(x^2-3),parfrac,x);

[Maple Math]

> factor(x^2-3);

[Maple Math]

>

This is not what we would like to see. Maple can deal with irrational roots in several ways. The best approach is to tell Maple to look for a factorization or a partial fraction decomposition which allows arbitrary real numbers, not just rationals. We can do it by specifying "real" under the corresponding command. Maple will respond by returning a partial fraction decomposition or a factorization in which coefficients and roots are floating point approximations of their exact values. For example

> convert(1/(x^2-3),parfrac,x,real);

[Maple Math]

> factor(x^2-3,real);

[Maple Math]

The roots above are floating point approximations of [Maple Math] and [Maple Math] . Indeed:

> evalf(sqrt(3));

[Maple Math]

We obtained the desired decomposition and factorization. For all practical purposes floating point approximations of exact values are usually sufficient.

Incidentally, if coefficients of a polynomial or a rational function contain a decimal expression, Maple will automatically factor or decompose using real numbers. You do not even have to add "real" under your command. For example

> convert(1/(x^2-3.0),parfrac,x);

[Maple Math]

Remark 2. Engineers often prefer partial fraction decompositions using complex numbers. Maple provides a floating point complex decomposition with the command " convert(...,parfrac,x,complex) ". For example

> convert(1/(x^2+2),parfrac,x,complex);

[Maple Math]

>

( I stands, of course for the imaginary unit).

>

Homework Problems

Problem 1. Consider the polynomials

[Maple Math] , [Maple Math] .

Perform the long division [Maple Math] using Maple. Have Maple display the final form of the quotient [Maple Math] .

Problem 2. For each the following rational expressions

[Maple Math] , [Maple Math] ,

(a) Find the indefinite integral.

(b) Find the partial fraction decomposition (using the simple Maple command, not step-by-step!)

(c) Factor the denominator.

Do you see the relationship between the three?

Problem 3. For

[Maple Math]

find its partial fraction decomposition step-by-step, as in Example 5. Then find the decomposition using the "convert(..parfrac..)" command and compare the results. (Hint: Since the degree of the numerator is less than the degree of the denominator, you do not have to perform the long division.)

Problem 4. (a) Try to factor the polynomial [Maple Math] using the simple "factor" command. What happens?

(b) Use the appropriate command to obtain a floating point factorization of the polynomial p.

(c) Consider the rational function

[Maple Math] .

Try finding its partial fraction decomposition with the simple "convert(...parfrac,x);" command. What happens? Use the appropriate command to obtain a floating point decomposition.

MTH 142 Maple Worksheets written by B. Kaskosz and L. Pakula, Copyright 1999.

Last modified August 1999.

>