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];MATLAB responds with
q = [1 -1 0];
[c,r] = residue(p,q)
c =Note that this result agrees with our previous calculation in (??).
6
-2
r =
1
0
Observe that the situation where the polynomial has complex roots is not excluded. Indeed, let and , and type
p = [1 1];to obtain the answer
q = [1 1 -4 6];
[c,r] = residue(p,q)
c =In particular, has the three roots and we have the expansion
-0.1176
0.0588 - 0.2647i
0.0588 + 0.2647i
r =
-3.0000
1.0000 + 1.0000i
1.0000 - 1.0000i
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)This m-file is accessed using the command
cr = [2*real(c), -2*imag(c)*imag(r)];
rr = [real(r), imag(r)^2];
[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 =This output corresponds to the expression Combining the second and third term on the right hand side leads to
0.1176 0.5294
denom =
1.0000 1.0000
Repeating a Calculation Using MATLAB
The partial fraction expansion of (??), that is, is found by typing
p = [2 -2];We obtain
q = [1 2 5];
[c,r] = residue(p,q)
c =Hence we have the expansion Now we use realform to return to a representation avoiding complex numbers. Type
0.5000 + 0.5000i
0.5000 - 0.5000i
r =
-1.0000 + 2.0000i
-1.0000 - 2.0000i
[num,denom] = realform(c(1),r(1))to obtain
num =which corresponds to (??).
1 -2
denom =
-1 4
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 .
[c,r,k] = residue(p,q)Explain the result of this calculation by comparing it to the expansion