4.6.30 · D2Ordinary Differential Equations

Visual walkthrough — Solving ODEs with Laplace (including discontinuous forcing)

1,925 words9 min readBack to topic

Step 1 — What are we even looking at? (the time picture)

WHAT. Read the equation in plain words. The symbol is an unknown wiggling quantity — say the amount of water in a leaky tank, measured at each time . The symbol (read "-prime") is its slope: how fast is changing right now. The right-hand side is a switch: it equals before and from onward.

WHY start here. Before any algebra, you must see what the equation demands. It says: "the rate of change plus the current level equals whatever the switch is feeding in." Before the switch feeds , and since starts at , nothing moves. After the switch feeds and the tank starts filling.

PICTURE. The orange curve is the switch (the forcing). It is a flat floor, then a cliff up to height at . That cliff is the whole reason classical methods struggle — you cannot differentiate a cliff nicely. Laplace will turn that cliff into a single tidy factor.

Figure — Solving ODEs with Laplace (including discontinuous forcing)

Step 2 — The magic camera: what does

WHAT. The Laplace transform is an integral that takes a whole function living on time and produces a new function living in a new variable :

Term by term: is a shrinking exponential — for a fixed it starts at and decays. It acts as a weighting curtain. Multiplying by it and adding up (that's the ) crushes the entire time-history of into a single number for each choice of . Sweep and you get the whole function .

WHY this tool and not another? We want an operation that converts differentiation into multiplication, because multiplication is easy and differentiation is hard. Out of all possible transforms, this one has exactly that property (we prove it next step). See Laplace Transform — Definition and Existence for when the integral converges.

PICTURE. Left panel: your function in the time world. Middle: the fading curtain for one value of . Right: their product, whose shaded area is the number . Change → the curtain fades faster or slower → the area changes → you trace out .

Figure — Solving ODEs with Laplace (including discontinuous forcing)

Step 3 — Why differentiation becomes "multiply by "

WHAT. We transform the slope and discover it becomes almost just . Using integration by parts on the definition:

=\underbrace{\big[e^{-st}y(t)\big]_0^\infty}_{\text{boundary term}} -\int_0^\infty(-s)e^{-st}y(t)\,dt.$$ The boundary term: at $t=\infty$ the curtain $e^{-st}$ kills everything → $0$; at $t=0$ it gives $-y(0)$. The remaining integral is $s$ times the original transform. So: $$\boxed{\;\mathcal{L}\{y'\}=sY(s)-y(0)\;}$$ where $Y(s)=\mathcal{L}\{y\}$. The lone symbol $s$ is doing the job that $\tfrac{d}{dt}$ did — that is the whole payoff. **WHY it matters.** The $-y(0)$ term is not junk: it is **where the initial condition enters the algebra by itself**. You never have to bolt it on at the end. **PICTURE.** The boundary term is the height of $e^{-st}y(t)$ evaluated at the two ends: $0$ at the far right (curtain wins), and $-y(0)$ at the left edge. The picture shows those two endpoints lit up. ![[deepdives/dd-maths-4.6.30-d2-s03.png]] > [!recall]- Why does the boundary term vanish at infinity? > Because $e^{-st}\to 0$ faster than $y(t)$ grows (for $s$ large enough), so the product dies. ::: That "$s$ large enough" is the convergence condition. --- ## Step 4 — Stamping the switch: turning the cliff into $e^{-2s}/s$ **WHAT.** We need $\mathcal{L}\{u(t-2)\}$. Plug the step into the definition. Since $u(t-2)=0$ until $t=2$, the integral only starts at $t=2$: $$\mathcal{L}\{u(t-2)\}=\int_2^\infty e^{-st}\cdot 1\,dt =\Big[\tfrac{-1}{s}e^{-st}\Big]_2^\infty=\frac{e^{-2s}}{s}.$$ Term by term: the lower limit jumped from $0$ to $2$ **because the switch is off before then**. Evaluating the antiderivative gives $\dfrac{e^{-2s}}{s}$. The factor $e^{-2s}$ is a **time-delay stamp** — it is the algebraic fingerprint of "start $2$ seconds late." The $\tfrac1s$ is the transform of a plain constant $1$ (the height the switch holds). **WHY.** This is the second shifting theorem in miniature: *a shift by $a$ in time becomes a factor $e^{-as}$ in $s$-land*. That single fact is what makes discontinuous forcing effortless. **PICTURE.** The shaded area under $e^{-st}$ but only from $t=2$ rightward — the missing chunk $[0,2]$ is exactly what supplies the $e^{-2s}$ discount. ![[deepdives/dd-maths-4.6.30-d2-s04.png]] > [!formula] The stamp > $$\mathcal{L}\{u(t-a)g(t-a)\}=e^{-as}G(s),\qquad \mathcal{L}\{u(t-a)\}=\frac{e^{-as}}{s}.$$ --- ## Step 5 — Solve the algebra (the whole point of the trip) **WHAT.** Transform the entire ODE $y'+y=u(t-2)$ term by term, using Steps 3–4 and $y(0)=0$: $$\underbrace{\big(sY-y(0)\big)}_{\mathcal{L}\{y'\}}+\underbrace{Y}_{\mathcal{L}\{y\}} =\underbrace{\frac{e^{-2s}}{s}}_{\mathcal{L}\{u(t-2)\}}.$$ With $y(0)=0$ this is $sY+Y=\dfrac{e^{-2s}}{s}$, i.e. $(s+1)Y=\dfrac{e^{-2s}}{s}$. Now just divide: $$\boxed{\;Y(s)=\frac{e^{-2s}}{s(s+1)}\;}$$ Term by term: $(s+1)$ came from the two $y$-terms collapsing into one factor; dividing by it is plain [[Linear Constant-Coefficient ODEs|algebra]], no calculus. The delay stamp $e^{-2s}$ just rides along untouched. **WHY.** In time-land we had a differential equation. In $s$-land it became a **rational function times a stamp** — something we can pull apart with fractions. **PICTURE.** A flow diagram: time-ODE → (apply $\mathcal{L}$) → algebra → (divide) → $Y(s)$. ![[deepdives/dd-maths-4.6.30-d2-s05.png]] --- ## Step 6 — Split by partial fractions (peeling $Y$ into table pieces) **WHAT.** Ignore the stamp for a second and factor the core $H(s)=\dfrac{1}{s(s+1)}$ using [[Partial Fractions]]: $$\frac{1}{s(s+1)}=\frac{A}{s}+\frac{B}{s+1}.$$ **Cover-up method:** cover $s$ and set $s=0$: $A=\dfrac{1}{0+1}=1$. Cover $(s+1)$ and set $s=-1$: $B=\dfrac{1}{-1}=-1$. So $$H(s)=\frac{1}{s}-\frac{1}{s+1}.$$ Term by term: $\dfrac1s$ is the transform of the constant $1$; $\dfrac{1}{s+1}$ is the transform of $e^{-t}$ (since $\mathcal{L}\{e^{at}\}=\tfrac{1}{s-a}$ with $a=-1$). So reading backwards: $$h(t)=1-e^{-t}.$$ **WHY split at all?** The inverse transform is only easy on *simple* pieces we recognise in the table. Partial fractions cut the ugly product into recognisable atoms. **PICTURE.** The curve $h(t)=1-e^{-t}$ drawn as the sum of a flat line at $1$ minus a decaying $e^{-t}$ — you can literally see the two fractions stacking. ![[deepdives/dd-maths-4.6.30-d2-s06.png]] --- ## Step 7 — Un-photo it: delay AND gate **WHAT.** Now restore the stamp. We have $Y(s)=e^{-2s}H(s)$ where $h(t)=1-e^{-t}$. The shifting theorem run **backwards** says: multiplying by $e^{-2s}$ means *delay $h$ by $2$ and switch it on at $t=2$*: $$\boxed{\;y(t)=u(t-2)\big(1-e^{-(t-2)}\big)\;}$$ Term by term: $u(t-2)$ is the **gate** — it forces $y=0$ before the switch. The inside $1-e^{-(t-2)}$ is the delayed relaxation — every $t$ inside $h$ became $t-2$. **WHY the gate matters.** Without the $u(t-2)$ factor, the formula $1-e^{-(t-2)}$ would already be *negative and moving* for $t<2$ — a machine reacting before it was switched on. Physically impossible. The gate is not optional. **PICTURE.** The final response: flat zero until $t=2$, then a smooth rise that climbs toward $1$ but never quite reaches — a delayed copy of the Step 6 curve. ![[deepdives/dd-maths-4.6.30-d2-s07.png]] > [!mistake] Dropping the gate > *Tempting:* invert $e^{-2s}H(s)$ as just $1-e^{-(t-2)}$. > *Fix:* always multiply by $u(t-2)$. Delay **and** gate — see [[Transfer Functions and Convolution]] for why this is exactly a delayed impulse response. --- ## Step 8 — Every case, checked (degenerate & limiting behaviour) **WHAT.** Let us make sure nothing is left unshown. - **Before the switch, $t<2$:** $u(t-2)=0$, so $y=0$. The picture is flat. ✓ - **Exactly at $t=2$:** $u=1$ but $1-e^{-(2-2)}=1-e^0=1-1=0$. So $y$ starts the rise from $0$ — **continuous**, no jump. Good, a leaky tank cannot teleport. - **Long after, $t\to\infty$:** $e^{-(t-2)}\to 0$, so $y\to 1$. The tank settles at the switch's height. ✓ - **What if $y(0)\neq 0$?** Then Step 3 keeps the $-y(0)$ term, adding a piece $\tfrac{y(0)}{s+1}\to y(0)e^{-t}$ — a decaying memory of the start. The switched part is unchanged. **WHY show all four.** The contract: the reader must never hit a scenario we skipped. The value at the switch, the tail, and a nonzero start each behave differently and each is drawn. **PICTURE.** Three stacked curves: $y(0)=0$ (our case), $y(0)=0.5$, $y(0)=-0.5$ — same switched rise, different fading memory before it. ![[deepdives/dd-maths-4.6.30-d2-s08.png]] > [!recall]- What is $y$ at the exact switch time $t=2$? > $y(2)=0$ — the response is continuous, it *starts* rising from zero. ::: The step forcing is discontinuous, but a first-order system smooths it into a continuous response. --- ## The one-picture summary Everything at once: the time-world problem (cliff forcing), the trip to $s$-land (differentiation → $\times s$, delay → $e^{-2s}$), the algebra $Y=\dfrac{e^{-2s}}{s(s+1)}$, the partial-fraction split, and the return trip to the gated answer. ![[deepdives/dd-maths-4.6.30-d2-s09.png]] > [!recall]- Feynman: tell the whole walk to a 12-year-old > Imagine a water tank with a tap. The tap is OFF, so the tank sits empty and bored. That is our > equation before $t=2$. Now: instead of watching the water slosh (hard!), we take a **magic photo** > — the Laplace transform — that freezes the whole story into a still picture drawn in a made-up > land called "$s$". In that land, "how fast things change" turns into just "multiply by $s$", which > is baby arithmetic. And "the tap turns on 2 seconds late" turns into a little sticker $e^{-2s}$ > meaning *start this part late*. In photo-land the problem is a simple fraction, and we chop that > fraction into two easy pieces (a flat $1$ and a fading $e^{-t}$). Finally we un-photo back to real > time, remembering two rules: **delay** everything by 2 seconds, and put a **gate** so nothing > happens before the tap opens. Result: empty until $t=2$, then a smooth fill-up toward "full" ($=1$) > that never quite overflows. Done — no sloshing math, just a photo, some algebra, and un-photo. > [!mnemonic] The nine frames > **See it → Photograph it → Slope becomes $s$ → Stamp the switch → Divide → Split → Delay+Gate → Check all cases → Compress.** --- > [!intuition] Connections > - [[Laplace Transform — Definition and Existence]] — the camera itself. > - [[Heaviside Step and Dirac Delta Functions]] — the switch we stamped. > - [[Partial Fractions]] — Step 6's peeling tool. > - [[Transfer Functions and Convolution]] — why $H(s)$ is *the* system's fingerprint. > - [[Method of Undetermined Coefficients]] — the classical method that chokes on the cliff. > - [[Linear Constant-Coefficient ODEs]] — the family of equations this solves.