Solving ODEs with Laplace Transforms
Solving a differential equation the classical way is a two-part chore: first hunt down the general
solution (the homogeneous part plus a particular part), then wrestle the arbitrary
constants until they match the initial conditions. The
Laplace transform
offers a completely different deal. It hands you a machine that turns the whole initial-value
problem — differential equation and starting data together — into an ordinary algebra
problem. You solve the algebra, then transform back. No two-part bookkeeping, no fitting constants at
the end.
This is why engineers reach for Laplace transforms first: they swallow a discontinuous input (a switch
flicked on at t = 3, a sudden hammer-blow) without complaint, and the
initial conditions are baked straight into the equations from the very first line.
The one rule that makes it work
Everything hinges on how the Laplace transform treats a derivative. Integration by parts
turns a derivative in t into multiplication by s
— and, crucially, drops the starting value out as a leftover term. Writing
Y(s) = \mathcal{L}\{y(t)\}:
- \mathcal{L}\{y'\} = sY(s) - y(0)
- \mathcal{L}\{y''\} = s^2 Y(s) - s\,y(0) - y'(0)
Read those again and notice the magic: the initial values y(0) and
y'(0) ride along inside the transform. The moment you transform the
equation, the starting data is already in it. There is no separate step where you "apply the initial
conditions" — they were never left out.
The method in three moves
Every Laplace solution of an initial-value problem follows the same pipeline. It never changes:
- Transform. Take \mathcal{L}\{\,\cdot\,\} of the whole
equation, using the derivative rules so the initial conditions drop in automatically.
- Solve for Y(s). What's left is a plain
algebraic equation in Y(s) — no calculus. Rearrange to get
Y(s) by itself.
- Invert. Take the inverse transform
y(t) = \mathcal{L}^{-1}\{Y(s)\} — usually by breaking
Y(s) into
partial fractions
that each match a line of the transform table.
The differential equation goes in one end; the solution y(t) — already
satisfying its initial conditions — comes out the other. Here is that pipeline drawn out:
Worked example 1 — a first-order equation
Solve y' + 2y = 0 with y(0) = 3.
Transform. Apply \mathcal{L} term by term. Using
\mathcal{L}\{y'\} = sY - y(0) = sY - 3:
\bigl(sY - 3\bigr) + 2Y = 0.
Solve for Y(s). Gather the
Y terms — this is now pure algebra:
(s + 2)\,Y = 3 \;\Longrightarrow\; Y(s) = \frac{3}{s + 2}.
Invert. The table entry
\mathcal{L}\{e^{at}\} = \dfrac{1}{s - a} matches with
a = -2, so
y(t) = 3\,e^{-2t}.
Check it: y(0) = 3e^{0} = 3 ✓, and
y' + 2y = -6e^{-2t} + 6e^{-2t} = 0 ✓. Notice we never introduced a constant
of integration and never "applied the initial condition" as a separate step — the
3 was carried in by the derivative rule from the first line.
Worked example 2 — a second-order equation
Solve y'' + y = 0 with y(0) = 0 and
y'(0) = 1.
Transform. Now use
\mathcal{L}\{y''\} = s^2 Y - s\,y(0) - y'(0) = s^2 Y - s(0) - 1 = s^2 Y - 1:
\bigl(s^2 Y - 1\bigr) + Y = 0.
Solve for Y(s).
(s^2 + 1)\,Y = 1 \;\Longrightarrow\; Y(s) = \frac{1}{s^2 + 1}.
Invert. The table entry
\mathcal{L}\{\sin t\} = \dfrac{1}{s^2 + 1} matches exactly, so
y(t) = \sin t.
A denominator of s^2 + 1 — an irreducible quadratic — is the
transform's fingerprint for an oscillation. Roots of the denominator (the "poles") on the imaginary
axis mean sines and cosines; a real root like s = -2 above meant a decaying
exponential. The recovered solutions look like this:
Real problems have a right-hand side: a driving force. Take
y'' - y = e^{t} with y(0) = 0,
y'(0) = 0. Transforming (with
\mathcal{L}\{e^{t}\} = \tfrac{1}{s-1}) gives
(s^2 - 1)Y = \tfrac{1}{s-1}, so
Y(s) = \frac{1}{(s - 1)(s^2 - 1)} = \frac{1}{(s - 1)^2 (s + 1)}.
That matches no single table entry — so we split it with
\dfrac{1}{(s-1)^2(s+1)} = \dfrac{A}{s-1} + \dfrac{B}{(s-1)^2} + \dfrac{C}{s+1}.
Working the partial fractions out gives
A = -\tfrac14, B = \tfrac12,
C = \tfrac14, and each piece is now a table entry:
y(t) = -\tfrac14 e^{t} + \tfrac12 t\,e^{t} + \tfrac14 e^{-t}.
Notice how the repeated factor (s-1)^2 produced the
t\,e^{t} term — the transform automatically supplied the "resonance" piece
that the classical method has to guess at. Partial fractions are the engine that turns any messy
Y(s) into recognisable table entries.
Three reasons, all of them practical:
- Initial conditions are free. They ride into the equations through the derivative
rules, so there is no separate constant-fitting stage that goes wrong.
- Discontinuous inputs are no problem. A switch turned on at
t = 3, an impulse, a square-wave drive — the transform of a step or a
spike is a tidy algebraic expression, so a forcing term that would terrify the classical method is
just another piece of the algebra.
- It turns calculus into algebra. A whole differential equation becomes a rational
function of s. Circuit designers and control engineers work almost
entirely in this "s-domain," where poles and zeros of
Y(s) read off the stability and response of a system at a glance.
Two slips catch almost everyone learning this method:
- No constants of integration. Because
\mathcal{L}\{y'\} = sY - y(0) already carries the initial value, the
starting data is inside the transformed equation. Do not also tack on a
+\,C or try to "apply the initial conditions" at the end — that would
double-count them. With Laplace, the answer you invert is already the specific solution.
- You must invert. Solving for Y(s) is only two-thirds of
the job — Y(s) lives in the s-domain, not the
t-domain. You have to compute
\mathcal{L}^{-1}\{Y(s)\} to get an actual function of
t. This is where most errors happen: to match the table you nearly always
split Y(s) into partial fractions first, and a wrong-shaped decomposition
(forgetting the second term of a repeated factor, or a linear numerator over a quadratic) gives a
wrong y(t).