Skip to content
Tutorials Center
My learning

Topics

Lesson 38 of 68 ยท Differential Equations

The Laplace Transform

Learn the Laplace transform, its key table and rules, solve initial value problems by algebra, and read transfer functions and step responses with sympy and scipy.

Solving a differential equation by the methods so far means guessing forms and juggling constants. The Laplace transform offers a different deal: it converts a differential equation in the time variable t into an ordinary algebraic equation in a new variable s. You solve the algebra, then convert back. Initial conditions are built in, and discontinuous forcing such as switches and pulses is handled naturally.

That is why the Laplace transform is the working language of circuit analysis, control engineering and signal processing. Its central object, the transfer function, describes a whole system in one fraction. In this lesson you will meet the definition, the small table of transforms you need, the solve-and-invert recipe, and transfer functions with step responses. You should be comfortable with second-order ODEs, improper integrals and partial fractions.

Definition

For a function f(t) defined for t >= 0, the Laplace transform is

F(s) = integral from 0 to infinity of f(t) * exp(-s*t) dt.

It is an improper integral, so it exists only when f does not grow faster than the decaying exponential can tame, usually for s larger than some value. The factor exp(-s*t) weights the function by how much it is damped; s can be thought of as a "decay rate" probing f. For instance, with f = 1:

F(s) = integral of exp(-s*t) dt from 0 to infinity = 1/s for s > 0.

Likewise, f = exp(a*t) gives 1/(s - a). You will hardly ever compute the integral by hand; instead you use a table and a few rules.

The essential table

f(t) F(s)
1 1/s
t 1/s**2
t**n n!/s**(n+1)
exp(a*t) 1/(s - a)
sin(w*t) w/(s**2 + w**2)
cos(w*t) s/(s**2 + w**2)
t*exp(a*t) 1/(s - a)**2
exp(a*t)*sin(w*t) w/((s - a)**2 + w**2)

And the rules that make it powerful:

  • Linearity: L{a*f + b*g} = a*F + b*G.
  • Derivatives: L{y'} = s*Y - y(0) and L{y''} = s**2 * Y - s*y(0) - y'(0). Differentiation in time becomes multiplication by s, and the initial conditions appear automatically.
  • Integration: L{integral of f from 0 to t} = F(s)/s.
  • Shift in s: multiplying f by exp(a*t) replaces s with s - a.
  • Shift in time: delaying a function by T with the unit step u(t - T) multiplies its transform by exp(-s*T).
Python A table of transforms with sympy

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 line for Heaviside(t - 2) shows the time-shift rule at work: the step at t = 2 transforms to exp(-2*s)/s.

Solving an ODE with the Laplace transform

The recipe has three steps and turns calculus into algebra:

  1. Transform every term of the ODE using the derivative rules, inserting the initial conditions.
  2. Solve the resulting algebraic equation for Y(s).
  3. Invert: split Y(s) into simple pieces (partial fractions) and use the table backwards.
flowchart LR
    A["ODE in t"] -- "transform" --> B["algebra in s"]
    B -- "solve for Y(s)" --> C["Y(s) as a fraction"]
    C -- "partial fractions, inverse transform" --> D["solution y(t)"]

Hard calculus in the time domain becomes easy algebra in the s domain.

Example. Solve y'' + 3y' + 2y = 4, with y(0) = 0 and y'(0) = 0 (a circuit switched on to a constant source). The transform of the left side is (s**2 + 3s + 2) * Y, and the transform of 4 is 4/s. So

Y = 4 / (s * (s + 1) * (s + 2)).

Partial fractions give Y = 2/s - 4/(s + 1) + 2/(s + 2), and reading the table backwards:

y(t) = 2 - 4*exp(-t) + 2*exp(-2*t).

Notice that the denominator s**2 + 3s + 2 is exactly the characteristic polynomial from the previous lesson; its roots -1 and -2 produce the exponentials. The pole at s = 0 from the constant forcing gives the steady-state value 2.

Python Solve an initial value problem with Laplace

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.

Transfer functions

For a system with zero initial state, the transform of the output divided by the transform of the input is the transfer function

H(s) = Y(s) / U(s).

For the system above, y'' + 3y' + 2y = u(t), the transfer function is H(s) = 1/(s**2 + 3s + 2). Cascading systems multiplies transfer functions; feedback loops give simple algebraic formulas. The roots of the denominator are the poles, and they predict behaviour at a glance:

  • poles with negative real parts mean a stable system whose disturbances die out,
  • a pole with a positive real part means growth: unstable,
  • complex pole pairs mean oscillation at the imaginary part's frequency; the closer to the imaginary axis, the less damping.

The step response is the output when the input jumps from 0 to 1 at t = 0. It is L^-1{H(s)/s}. Engineers read rise time, overshoot, settling time and steady-state value off it. For a stable system the final value theorem gives the steady state without inversion: y(infinity) = lim_{s->0} s*Y(s) = H(0) for a unit step.

Python Poles, step responses and overshoot

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.

As the damping ratio zeta falls from 2 toward 0, the poles move from two separate points on the negative real axis, merge at zeta = 1, and then split into complex pairs that creep toward the imaginary axis. At the same time the step response changes from slow and smooth to fast with ringing and overshoot. That is the main lesson of control design: pole positions are behaviour. You will use these ideas in Project: Simulating an RLC Circuit.

The Laplace transform is one-sided and designed for causal systems that start at t = 0. For steady-state analysis of signals that extend over all time, such as audio, the Fourier transform is the usual tool. It is the Laplace transform evaluated along the imaginary axis, s = i*w.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. What is the Laplace transform of f(t) = exp(3t)?

    L{exp(a*t)} = 1/(s - a), so with a = 3 the transform is 1/(s - 3).
  2. 2. What is L{y''} in terms of Y(s)?

    Each differentiation multiplies by s and subtracts an initial value; two derivatives give s**2Y - sy(0) - y'(0).
  3. 3. A system has poles at s = -1 + 2i and s = -1 - 2i. How does it behave?

    The negative real part gives decay like exp(-t); the imaginary part 2 gives oscillation at 2 rad/s.
  4. 4. For a stable system with H(s) = 6/(s**2 + 5s + 6), what is the unit-step steady-state output?

    By the final value theorem, the steady state is H(0) = 6/6 = 1.
  5. 5. Why is the Laplace transform handy for initial value problems?

    The derivative rules include y(0), y'(0), so the initial conditions are part of Y(s) and no constants have to be solved for afterwards.

Summary

  • F(s) is the integral of f(t)*exp(-s*t) from 0 to infinity; it turns differentiation into multiplication by s.
  • A short table plus linearity, derivative and shift rules covers most of what you need; sympy.laplace_transform and inverse_laplace_transform check it.
  • To solve an IVP: transform, solve for Y(s), use partial fractions, invert. Initial conditions enter automatically.
  • The transfer function H(s) = Y/U describes a system; its poles decide stability, oscillation and decay.
  • Step response features (rise time, overshoot, settling, final value) can be read from H(s) and simulated with scipy.signal.

Next: Sequences and Infinite Series.