Skip to content
Tutorials Center
My learning

Topics

Lesson 25 of 36 · Laplace Transform

Inverse Laplace Transform and Partial Fractions

Invert Laplace transforms with partial fraction expansion: distinct, repeated and complex poles, solved by hand, with scipy.signal.residue and SymPy for verification.

Going from X(s) back to x(t) is almost never done with the inversion integral. Instead you rewrite X(s) as a sum of simple terms found in the table and invert each term. For rational functions, that rewrite is the partial fraction expansion. This lesson walks through the three cases (distinct, repeated and complex poles) and shows how to let SciPy and SymPy do the arithmetic.

Distinct real poles

Let X(s) = (s + 3) / ((s + 1)(s + 2)). Write

X(s) = A/(s + 1) + B/(s + 2).

The residue at each pole is found with the cover-up rule: A = (s + 3)/(s + 2) at s = -1, which is 2; B = (s + 3)/(s + 1) at s = -2, which is -1. Therefore x(t) = (2 e^(-t) - e^(-2t)) u(t).

scipy.signal.residue does this for you. Give it the numerator and denominator coefficients (highest power first) and it returns residues r, poles p and a polynomial part k (nonzero only if the numerator has degree at least equal to the denominator).

Python Residues with scipy.signal.residue

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Repeated poles

A pole of multiplicity m needs m terms: A1/(s + a) + A2/(s + a)² + ... + Am/(s + a)^m. A term 1/(s + a)² inverts to t e^(-at). Example:

X(s) = 1 / ((s + 1)² (s + 2)) = A/(s + 1) + B/(s + 1)² + C/(s + 2).

Here B = 1/(s + 2) at s = -1, which is 1; C = 1/(s + 1)² at s = -2, which is 1; and A = -1 (found by comparing coefficients, or using the derivative formula). So x(t) = (-e^(-t) + t e^(-t) + e^(-2t)) u(t). SymPy's apart expands a rational function and inverse_laplace_transform finishes the job.

Python apart and inverse_laplace_transform

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Complex conjugate poles

When the denominator has an irreducible quadratic such as s² + 2s + 5, the poles are -1 ± j2. Do not split into complex fractions; complete the square instead so the result matches the damped sinusoid pairs:

X(s) = (s + 3) / (s² + 2s + 5) = (s + 1)/((s + 1)² + 4) + 1 · 2/((s + 1)² + 4).

Using the table: x(t) = e^(-t)(cos 2t + sin 2t) u(t). The real part of the pole gives the decay rate and the imaginary part gives the oscillation frequency.

Improper fractions

If the numerator degree is at least the denominator degree, first divide. For X(s) = (s² + 3s + 3)/(s + 1), long division gives s + 2 + 1/(s + 1). The polynomial part s + 2 inverts to δ'(t) + 2δ(t): derivatives of impulses. This is normal for systems that differentiate their input.

Solving a differential equation end to end

Solve y'' + 3y' + 2y = 0 with y(0) = 1, y'(0) = 0.

  1. Transform: s²Y - s + 3(sY - 1) + 2Y = 0.
  2. Collect: (s² + 3s + 2) Y = s + 3.
  3. Solve: Y = (s + 3)/((s + 1)(s + 2)), the same fraction as the first example.
  4. Invert: y(t) = 2 e^(-t) - e^(-2t).

The check below solves the ODE numerically and compares it with that formula.

Python Check the ODE solution numerically

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The inverse transform depends on the ROC. For a causal system, use the right-sided inverse (terms multiplied by u(t)). If the ROC says otherwise, some terms become left-sided.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What is the residue of X(s) = (s + 3)/((s + 1)(s + 2)) at s = -2?

    Cover up (s + 2) and evaluate the rest at s = -2: (-2 + 3)/(-2 + 1) = 1/(-1) = -1.
  2. 2. Which time function has transform 1/(s + 1)²?

    Multiplying by t differentiates X(s) with a sign change, so t e^(-at) maps to 1/(s + a)².
  3. 3. A pair of poles at -3 ± j4 produces which kind of response?

    The real part sets the decay rate and the imaginary part sets the oscillation frequency.
  4. 4. What should you do first if the numerator degree is not smaller than the denominator degree?

    Division leaves a polynomial part (impulses and their derivatives) plus a proper fraction that you expand.

Summary

  • Rewrite X(s) with partial fractions, invert each term from the table.
  • Distinct poles give exponentials, repeated poles add powers of t, complex pairs give damped sinusoids.
  • scipy.signal.residue and SymPy's apart check hand work.
  • Transforming an ODE gives an algebraic equation that includes the initial conditions.

Next: Transfer Functions, Poles and Zeros