In Section ?? we saw that expansions into partial fractions is a necessary tool when applying the method of Laplace transforms. In the simplest case partial fractions work as follows. Assume that and are two polynomials such that

(a)
the degree of is less or equal to the degree of ;
(b)
has no multiple roots.

The roots of may be either real or complex. Then the expansion into partial fractions of has the form

where are scalars determined from and .

There is a simple way to compute the constant . Define the degree polynomial Multiply both sides of (??) by and evaluate at to obtain

For example, compute the partial fraction expansion for In this example, , , and . The relevant polynomials are: It follows that

Partial Fractions with Complex Roots

Suppose that the denominator has complex conjugate roots and . When is a complex simple root of , then the partial fractions expansion of contains the two terms where . Together these two terms must be real-valued, and it follows that . Therefore the expansion is for some complex scalar . These terms combine as where . With inverse Laplace transforms in mind, we prefer to write this expression as

where .

In the third part of Section ?? we saw how to compute inverse Laplace transforms of functions like those in (??).

Partial Fractions Using MATLAB

The MATLAB command residue can be used to determine partial fractions expansions. We begin by discussing how polynomials are defined in MATLAB. The polynomial is stored in MATLAB by the vector q = [ad a1 a0] consisting of the coefficients of in descending order. For instance, in MATLAB, the polynomial is identified with the vector .

Suppose that the two vectors p and q represent the two polynomials (of degree less than ) and (of degree ). Both the vector of roots and the vectors of scalars are determined using the command

[c,r] = residue(p,q)

To illustrate this command, find the partial fraction expansion of (which we computed previously in (??)) by typing

    p = [4 2];
 
    q = [1 -1 0];  
[c,r] = residue(p,q)

MATLAB responds with
c =
 
     6  
    -2  
r =  
     1  
     0

Note that this result agrees with our previous calculation in (??).

Observe that the situation where the polynomial has complex roots is not excluded. Indeed, let and , and type

    p = [1 1];
                                                                  

                                                                  
 
    q = [1 1 -4 6];  
[c,r] = residue(p,q)

to obtain the answer
c =
 
  -0.1176  
   0.0588 - 0.2647i  
   0.0588 + 0.2647i  
r =  
  -3.0000  
   1.0000 + 1.0000i  
   1.0000 - 1.0000i

In particular, has the three roots and we have the expansion

The Return to Real Form in Partial Fractions

We can return to a representation in real numbers by combining the terms corresponding to complex conjugate roots. When is a complex simple root of , then the partial fractions expansion of contains the two terms for some complex scalar . These terms combine to give where , as in (??).

We can write a MATLAB m-file to perform the computations in (??) as follows:

function [cr,rr] = realform(c,r)
 
cr = [2*real(c), -2*imag(c)*imag(r)];  
rr = [real(r), imag(r)^2];

This m-file is accessed using the command
[num,denom] = realform(c(i),r(i))

where i is the index corresponding to the complex conjugate root of . For example, if we consider the expansion in (??), then we type
                                                                  

                                                                  
[num,denom] = realform(c(2),r(2))

yielding the answer
num =
 
     0.1176    0.5294  
denom =  
    1.0000    1.0000

This output corresponds to the expression Combining the second and third term on the right hand side leads to

Repeating a Calculation Using MATLAB

The partial fraction expansion of (??), that is, is found by typing

    p = [2 -2];
 
    q = [1 2 5];  
[c,r] = residue(p,q)

We obtain
c =
 
   0.5000 + 0.5000i  
   0.5000 - 0.5000i  
r =  
  -1.0000 + 2.0000i  
  -1.0000 - 2.0000i

Hence we have the expansion Now we use realform to return to a representation avoiding complex numbers. Type
                                                                  

                                                                  
[num,denom] = realform(c(1),r(1))

to obtain
num =
 
     1    -2  
denom =  
    -1     4

which corresponds to (??).

Exercises

In Exercises ?? – ?? use partial fractions to find a function whose Laplace transform is the given function .

.
.

In Exercises ?? – ?? use the MATLAB command residue to compute the expansion into partial fractions of for the given polynomials and .

and
and .
and .
The residue command in MATLAB also works when the degree of the numerator is greater than the degree of the denominator . In this case the answer has the form ‘partial fractions + polynomial’. The residue command stores the polynomial part in a vector k. To explore this feature, enter the vectors p = [2,0,-2,0] and q = [1,0,-4], and type the command
[c,r,k] = residue(p,q)

Explain the result of this calculation by comparing it to the expansion

Use the command residue as in Exercise ?? to compute an expansion into partial fractions for