A.10  Partial fraction decomposition

A partial fraction decomposition is used to convert a rational function P(x)Q(x) into a sum of simpler fractions, where P(x) and Q(x) are two polynomials with N and M being the degrees of P(x) and Q(x), respectively and x .

Two assumptions simplify the decomposition:

f 1.
M > N, i. e., the denominator has larger degree than the numerator,
f 2.
all M roots pi of the denominator (called poles when dealing with transforms such as Laplace and Z) are distinct, which allows to write Q(x) = (x p1)(x p2)(x pM).

In this special case, it is possible to write

P(x) Q(x) = r1 x p1 + r2 x p2 + + r1 x pM,
(A.23)

where

ri = (P(x) Q(x)(x pi))|x=pi
(A.24)

is called the residue of the (pole) pi. To understand (and prove) Eq. (A.24), one can observe that multiplying both sides of Eq. (A.23) by (x p1) leads to

P(x) Q(x)(x p1) = r1 + r2(x p1) x p2 + + r1(x p1) x pM

and substituting x by p1 makes all terms ri(x p1)(x pi),i1, equal to zero. The same can be done to the other poles and the general expression for this procedure is Eq. (A.24). For example, expanding 1(x2 5x + 6) leads to

1 x2 5x + 6 = r1 x 2 + r2 x 3,

where

r1 = ( 1 (x 2)(x 3)(x 2))|x=2 = 1 x 3 |x=2 = 1

and

r2 = ( 1 (x 2)(x 3)(x 3))|x=3 = 1.

If the roots are complex (typically they occur as complex conjugate pairs), the procedure is similar, but the parcels can be rearranged.

When the first assumption is not valid, one needs to use polynomial division to first obtain

P(x) Q(x) = R(x) + S(x) Q(x),

where the degree L of S(x) is L < M. This pre-processing stage is similar to writing an improper fraction as a mixed fraction, e. g., 7 4 = 13 4 = 1 + 3 4. For example, when P(x)Q(x) = (3x3 13x2 + 8x + 13)(x2 5x + 6), some algebra shows that it is not possible to find two residues r1 and r2 such that

P(x) Q(x) = r1 x 2 + r2 x 3.

Hence, first one obtains

P(x) Q(x) = 3x3 13x2 + 8x + 13 x2 5x + 6 = 3x + 2 + 1 x2 5x + 6,

with R(x) = 3x + 2 and S(x) = 1 having a degree L = 0 smaller than M = 2, and then uses the standard partial fraction expansion on S(x) Q(x) to obtain

3x3 13x2 + 8x + 13 x2 5x + 6 = 3x + 2 + 1 x 3 1 x 2.

When one or more roots pi of Q(x) (poles) have multiplicity λi larger than one, the second simplifying assumption does not hold and the expansion is trickier as discussed in the sequel.

Note that, in general, Q(x) can be written as Q(x) = (x p1)λ1(x p2)λ2(x pM)λM, while the previous results were restricted to λi = 1,i. A pole pi with λi > 1 requires not only a parcel ri(x pi) but λi parcels with residues rij,j = 1,,λi for the following powers of (x pi):

ri1 (x pi) + ri2 (x pi)2 + ri3 (x pi)3 + + riλi (x pi)λi.

The residues can be obtained using factorial and derivatives via the Theorem of residuals:

rij = 1 (λi j)! dλij dxλij (P(x) Q(x)(x pi)λi )| x=pi
(A.25)

for j = 1,,λi. When λi = 1, this equation simplifies to Eq. (A.24). For example, the expansion of (x3 + 5)(x4 9x3 + 30x2 44x + 24) can use Eq. (A.25) because the denominator can be written as (x 2)3(x 3), having a single pole p1 = 3 and a pole p2 = 2 with multiplicity 3. Hence, the following residues need to be found

x3 + 5 x4 9x3 + 30x2 44x + 24 = r1 (x p1) + r21 (x p2) + r22 (x p2)2 + r23 (x p2)3.

The residue r1 can be found with Eq. (A.24):

r1 = ( x3 + 5 (x 2)3(x 3)(x 3))|x=3 = 33 + 5 (3 2)3 = 32,

while the other residues are given by Eq. (A.25) and require using Eq. (A.26) to obtain the following derivatives:

d dx (x3 + 5 x 3 ) = 3x2(x 3) (x3 + 5) (x 3)2 = 2x3 9x2 5 (x 3)2

and

d dx (2x3 9x2 5 (x 3)2 ) = (6x2 18x)(x 3)2 (2x3 9x2 5)2(x 3)) (x 3)4 ,

which will be used for calculating r22 and r21, respectively. Therefore,

r21 = 1 (3 1)! d2 dx2 (P(x) Q(x)(x 2)3)| x=2 = 1 2(62) = 31,
r22 = 1 (3 2)! d dx (P(x) Q(x)(x 2)3)| x=2 = 25

and

r23 = 1 (3 3)! (P(x) Q(x)(x 2)3)| x=2 = 13.

It is useful to use algebra and double check the obtained expansion:

x3 + 5 x4 9x3 + 30x2 44x + 24 = 32 (x 3) + 31 (x 2) + 25 (x 2)2 + 13 (x 2)3.

Alternatively, one can use Matlab/Octave to obtain the residues with the commands b=[1 0 0 5],a=[1 -9 30 -44 24],[r,p,k]=residue(b,a). It should be noted that Octave has the option of a more complete output with [r,p,k,e]=residue(b,a), where the vector e relates each residue to the corresponding parcel in the expansion. When using Matlab, one needs to know that the residues are given in the order ri1,ri2,,riλi.

In Python, the residues can be found with the method scipy.signal.residue. For the previous example, the command would be:

1b=[1, 0, 0, 5]; # numerator 
2a=[1, -9, 30, -44, 24] # denominator 
3[r,p,k]=scipy.signal.residue(b,a)

The method residue assumes the polynomials are given in positive powers of the independent variable. For a pole rij with multiplicity λi larger than one, similar to Matlab, the residues are given in the order ri1,ri2,,riλi.

In Python, the method scipy.signal.residuez can be used if the user prefers to describe the polynomials in negative powers, such z1, z2 and so on.