# Imports for the entire sessionimport numpy as np # NumPy for numerical computationsimport sympy as sym # SymPy for symbolic mathematicsimport matplotlib as mpl # Matplotlib for plottingimport matplotlib.pyplot as plt # Matplotlib pyplot interfacefrom scipy.integrate import solve_ivp # SciPy numerical ODE solverfrom IPython.display import Math, displaympl.rcParams['figure.dpi'] =150mpl.rcParams['axes.spines.top'] =Falsempl.rcParams['axes.spines.right'] =False
This document reviews the Laplace transform methods covered in Chapter 3 of (Logan 2015). It is structured as a companion to Appendix A of the text (reviewed in Review 1): each section states the key idea, works through a representative example by hand, and then demonstrates the same calculation using Python — primarily SymPy for symbolic transforms and SciPy/Matplotlib for numerical simulation and visualization.
The central idea of the chapter is this:
The Laplace transform turns derivative operations in the time domain into multiplication operations in the transform domain.
This converts an initial value problem for a differential equation into an algebraic problem for the transformed state function \(X(s)\), which we solve and then invert.
B.1 — Definition and Basic Transforms
Definition (Logan, §3.1). Let \(x = x(t)\) be defined on \(0 \le t < \infty\). The Laplace transform of \(x(t)\) is \[
X(s) = \mathcal{L}[x(t)](s) = \int_0^\infty x(t)\,e^{-st}\,dt,
\] provided the improper integral converges. The transform is a linear operator: \[
\mathcal{L}[\alpha x + \beta y] = \alpha\mathcal{L}[x] + \beta\mathcal{L}[y].
\]
The three most fundamental transforms, derived directly from the definition, are
\(x(t)\)
\(X(s) = \mathcal{L}[x]\)
Condition
\(e^{at}\)
\(\dfrac{1}{s-a}\)
\(s > a\)
\(1\)
\(\dfrac{1}{s}\)
\(s > 0\)
\(t\)
\(\dfrac{1}{s^2}\)
\(s > 0\)
By Hand
Example. Compute \(\mathcal{L}[e^{at}]\) from the definition (Logan, Example 3.3).
\[
X(s) = \int_0^\infty e^{at} e^{-st}\,dt
= \int_0^\infty e^{(a-s)t}\,dt
= \frac{1}{a-s}\,e^{(a-s)t}\Big|_0^\infty
= \frac{1}{s-a}, \quad s > a.
\]
Example. Compute \(\mathcal{L}[t^n]\) for non-negative integers \(n\) (Logan, Example 3.12).
Use the derivative formula \(\mathcal{L}[x'] = s\mathcal{L}[x] - x(0)\) on \(x(t) = t^n\). Since \((t^n)' = nt^{n-1}\), we get the recurrence \(\mathcal{L}[t^n] = \tfrac{n}{s}\mathcal{L}[t^{n-1}]\). Applying repeatedly from \(\mathcal{L}[1] = 1/s\): \[
\mathcal{L}[t^n] = \frac{n!}{s^{n+1}}, \quad s > 0.
\]
Using SymPy
SymPy computes Laplace transforms with sym.laplace_transform and inverse transforms with sym.inverse_laplace_transform.
t, s, a = sym.symbols('t s a', real=True)# Direct computation from definition via sym.laplace_transform# Returns (F(s), convergence_plane, condition)funcs = {'e^{at}' : sym.exp(a*t),'1' : sym.Integer(1),'t' : t,'t^2' : t**2,'t^n (n=4)': t**4,r'\sin kt': sym.sin(sym.Symbol('k')*t),r'\cos kt': sym.cos(sym.Symbol('k')*t),r'\sinh kt': sym.sinh(sym.Symbol('k')*t),r'\cosh kt': sym.cosh(sym.Symbol('k')*t),}for name, f in funcs.items(): F, plane, cond = sym.laplace_transform(f, t, s, noconds=False) display(Math(r'\mathcal{L}\!\left['+ name +r'\right] = '+ sym.latex(sym.simplify(F))+r'\quad ('+ sym.latex(cond) +r')' ))
\(\displaystyle \mathcal{L}\!\left[e^{at}\right] = \frac{1}{- a + s}\quad (\text{True})\)
Pattern. To compute \(\mathcal{L}[x(t)]\) by hand, evaluate the improper integral \(\int_0^\infty x(t)e^{-st}\,dt\) directly, or use the recurrence relation for \(t^n\). In Python, sym.laplace_transform(f, t, s) does this symbolically.
B.2 — Operational Properties
Two additional properties are essential for solving differential equations with discontinuous or shifted inputs.
(b) Switching property (Logan, §3.1, eq. 3.5). The Heaviside function\(H(t-a)\) acts as a switch that is off for \(t < a\) and on for \(t \ge a\): \[
\mathcal{L}[H(t-a)\,x(t-a)] = e^{-as} X(s).
\] In inverse form: \(\mathcal{L}^{-1}[e^{-as} X(s)] = H(t-a)\,x(t-a)\).
The transform of derivatives (Logan, Theorem 3.11) converts the IVP into algebra: \[
\mathcal{L}[x'] = s X(s) - x(0),
\qquad
\mathcal{L}[x''] = s^2 X(s) - s\,x(0) - x'(0).
\]
By Hand
Example. Find \(\mathcal{L}[\cosh t]\) using the derivative formula (Logan, Example 3.13).
Since \((\cosh t)'' = \cosh t\), write \[
\mathcal{L}[(\cosh t)''] = s^2\mathcal{L}[\cosh t] - s\cosh 0 - \sinh 0
= s^2\mathcal{L}[\cosh t] - s.
\] But also \(\mathcal{L}[(\cosh t)''] = \mathcal{L}[\cosh t]\). Setting these equal: \[
\mathcal{L}[\cosh t] = s^2\mathcal{L}[\cosh t] - s
\quad\Longrightarrow\quad
\mathcal{L}[\cosh t] = \frac{s}{s^2 - 1}.
\]
Example. Find \(\mathcal{L}[t e^{-2t}]\) using the shift property (Logan, Example 3.9).
We know \(\mathcal{L}[t] = 1/s^2\). Replacing \(s\) with \(s - (-2) = s + 2\): \[
\mathcal{L}[t e^{-2t}] = \frac{1}{(s+2)^2}.
\]
Example. Represent the piecewise function (Logan, Example 3.8) \[
f(t) = \begin{cases} 3, & 0 \le t < 2 \\ 4, & 2 \le t \le 3 \\ 2, & 3 < t \le 6 \\ 0, & t > 6 \end{cases}
\] in one line and find \(F(s)\).
Figure 1: The piecewise function from Logan Example 3.8, expressed compactly using Heaviside step functions.
Tip
Pattern. The shift property replaces \(s\) by \(s - a\) in the transform. The switching property multiplies \(X(s)\) by \(e^{-as}\) and wraps the time-domain answer in \(H(t-a)\). An exponential factor \(e^{-as}\) in a transform always signals a time delay of \(a\) units.
B.3 — Inverse Transforms and Partial Fractions
The inverse Laplace transform\(\mathcal{L}^{-1}[X(s)] = x(t)\) reverses the process. It is also linear: \[
\mathcal{L}^{-1}[\alpha X + \beta Y] = \alpha\,\mathcal{L}^{-1}[X] + \beta\,\mathcal{L}^{-1}[Y].
\] The key technique for inverting rational functions is partial fractions: decompose \(X(s)\) into simpler terms that appear in the transform table.
By Hand
Example. Invert \(X(s) = \dfrac{1}{(s+1)(s+2)}\) (Logan, Example 3.16).
\(\displaystyle \mathcal{L}^{-1}\!\left[\frac{e^{-3s}}{s-2}\right] = e^{2 t - 6} \theta\left(t - 3\right)\)
Tip
Pattern. To invert \(X(s)\): (1) look for exponential factors \(e^{-as}\) (switching property); (2) factor or complete the square in the denominator; (3) decompose by partial fractions into table entries.
B.4 — Solving Initial Value Problems
The three-step procedure (Logan, §3.2.1):
Transform — take \(\mathcal{L}\) of each term; use Theorem 3.11 to replace derivatives by algebra; initial conditions enter automatically.
Solve — solve the resulting algebraic equation for \(X(s)\).
Invert — apply \(\mathcal{L}^{-1}\) to recover \(x(t)\).
By Hand
Example. Solve \(x'' + k^2 x = 0\), \(x(0) = 0\), \(x'(0) = 1\) (Logan, Example 3.14).
Figure 2: Solution of \(x''+4x=\sin t - H(t-\pi)\sin t\), \(x(0)=x'(0)=0\) (Logan, Example 3.19). The forcing switches off at \(t=\pi\); the oscillation continues but changes character.
Tip
Pattern. Transform \(\to\) solve \(\to\) invert. Partial fractions handle rational \(X(s)\); complete the square for complex roots; the switching property handles any \(e^{-as}\) factors.
B.5 — Piecewise Continuous Forcing
When \(f(t)\) is piecewise continuous (PWC), the Laplace method handles it cleanly — no need to match solutions at each breakpoint. Express \(f(t)\) in one line using Heaviside functions, transform, solve, and invert.
The key table entry is \[
\mathcal{L}[f(t)\,H(t-a)] = e^{-as}\,\mathcal{L}[f(t+a)].
\]
Figure 3: Charge on the capacitor in the RC circuit (Logan, Example 3.21). The switch closes at \(t=1\), charge builds up, then the switch reopens at \(t=2\) and charge decays.
Tip
Pattern. Express the PWC forcing function in one line with Heaviside functions, using the template: turn on \(g(t)\) at \(t=a\) with \(g(t)H(t-a)\), turn off at \(t=b\) by subtracting \(g(t)H(t-b)\).
B.6 — The Convolution Property
The convolution of \(x(t)\) and \(y(t)\) is \[
(x * y)(t) = \int_0^t x(\tau)\,y(t-\tau)\,d\tau.
\] The convolution property (Logan, §3.3) states \[
\mathcal{L}[x * y] = X(s)\,Y(s),
\quad\text{equivalently,}\quad
\mathcal{L}^{-1}[X(s)Y(s)] = (x*y)(t).
\] Convolution is commutative: \(x * y = y * x\).
The convolution is useful for inverting products of transforms when partial fractions would be awkward, and for writing the solution to a DE with an arbitrary forcing function.
By Hand
Example. Invert \(X(s) = \dfrac{3}{s(s^2+9)}\) using convolution (Logan, Example 3.24).
Example. General solution formula (Logan, Example 3.25).
For \(x'' + k^2 x = f(t)\) with initial conditions \(x(0)\), \(x'(0)\), the transform gives \[
X(s) = x(0)\frac{s}{s^2+k^2} + x'(0)\frac{1}{s^2+k^2} + \frac{F(s)}{s^2+k^2}.
\] Inverting: \[
x(t) = x(0)\cos kt + \frac{x'(0)}{k}\sin kt
+ \frac{1}{k}\int_0^t f(\tau)\sin k(t-\tau)\,d\tau.
\] The last term is the convolution of \(f\) and \(\tfrac{1}{k}\sin kt\).
Using SymPy
t, tau = sym.symbols('t tau', positive=True)s = sym.Symbol('s', positive=True)# Direct convolution integral: 1 * sin(3t)conv1 = sym.integrate(sym.sin(3*tau), (tau, 0, t))display(Math(r'1 *\sin 3t = \int_0^t \sin 3\tau\,d\tau = '+ sym.latex(conv1)))# Verify via inverse Laplace: L^{-1}[3 / (s(s^2+9))]X_conv = sym.Integer(3) / (s * (s**2+9))x_conv = sym.inverse_laplace_transform(X_conv, s, t)display(Math(r'\mathcal{L}^{-1}\!\left[\frac{3}{s(s^2+9)}\right] = '+ sym.latex(sym.simplify(x_conv))))# Compute several convolutions from Section 3.3 Exercise 1pairs = [ (sym.sin(t), sym.cos(t), r'\sin t *\cos t'), (sym.exp(-2*t), sym.exp(-3*t), r'e^{-2t} * e^{-3t}'), (t, t**2, r't * t^2'),]for f, g, label in pairs: result = sym.integrate( f.subs(tau, tau) * g.subs(t, t - tau), (tau, 0, t)) display(Math(label +r' = '+ sym.latex(sym.simplify(result))))
Pattern. When \(X(s) = X_1(s) X_2(s)\), the inverse is the convolution \(x_1 * x_2\). This is especially useful when the product of two recognizable transforms appears, avoiding lengthy partial fractions.
B.7 — Impulsive Sources and the Delta Function
The unit impulse (delta function) \(\delta_a(t)\) at time \(t = a\) is the idealized limit of a rectangular pulse of height \(1/\varepsilon\) and width \(\varepsilon\) as \(\varepsilon \to 0\). It satisfies the sifting property: \[
\int_0^\infty \delta_a(t)\,\phi(t)\,dt = \phi(a).
\] Its Laplace transform is \[
\mathcal{L}[\delta_a(t)] = e^{-as}, \qquad \mathcal{L}[\delta_0(t)] = 1.
\]
Figure 4: Impulse response of \(x''+2x'+5x=\delta_{t_0}(t)\) for \(t_0=2\) (Logan, Example 3.28). The system is at rest until \(t=2\), then undergoes a decaying oscillation.
Tip
Pattern. An impulsive source \(\delta_a(t)\) contributes \(e^{-as}\) to the right-hand side of the transformed equation. After solving for \(X(s)\), invert using the switching property; the result is zero for \(t < a\) and a decaying (or oscillating) response for \(t > a\).
B.8 — Transfer Functions and Input–Output Systems
For the linear system with zero initial conditions \[
ax'' + bx' + cx = f(t), \quad x(0) = x'(0) = 0,
\] the forced response in the transform domain is \[
X(s) = K(s)\,F(s),
\] where \[
K(s) = \frac{1}{as^2 + bs + c}
\] is the transfer function. In the time domain, the forced response is the convolution \(x(t) = k(t) * f(t)\), where \(k(t) = \mathcal{L}^{-1}[K(s)]\).
The transfer function fully characterizes the system’s response to any input, without needing to solve the DE from scratch each time.
By Hand
Example. Find the transfer function and impulse response for \(x'' + 2x' + 5x = f(t)\) (Logan, §3.4).
Figure 5: Responses of \(x''+2x'+5x=f(t)\), \(x(0)=x'(0)=0\) to three canonical inputs: an impulse \(\delta_0(t)\), a unit step \(H(t)\), and a sinusoidal input \(\sin(2t)\). All solved numerically with scipy.integrate.solve_ivp.
Tip
Pattern. The transfer function \(K(s)\) encodes everything about the system. The impulse response\(k(t) = \mathcal{L}^{-1}[K(s)]\) determines the response to any input via \(x(t) = k * f\). In practice, solve_ivp gives the numerical response for arbitrary \(f(t)\) without needing to compute the convolution integral analytically.
B.9 — Selected Review Exercises
This section works through a selection of exercises from Logan Chapter 3, following the same by-hand and Python structure used throughout.
Exercise 3.1.8 — Computing Transforms
Problem. Find the Laplace transform of each function.
Figure 6: Solutions to three IVPs from Logan §3.2, Exercise 6. Panel (g) shows the effect of a step input that switches off at \(t=5\): the oscillation continues with the homogeneous (free) response thereafter.
Exercise 3.3.1 — Convolution Integrals
Problem. Compute the convolutions: (a) \(\sin t * \cos t\), (b) \(e^{-2t}*e^{-3t}\), (c) \(t * t^2\), (d) \(t * e^t\).
By Hand — (b).\(e^{-2t}*e^{-3t} = \int_0^t e^{-2\tau}e^{-3(t-\tau)}\,d\tau
= e^{-3t}\int_0^t e^{\tau}\,d\tau = e^{-3t}(e^t - 1) = e^{-2t} - e^{-3t}\).
Verification via Laplace: \(\mathcal{L}^{-1}\!\left[\dfrac{1}{(s+2)(s+3)}\right]
= e^{-2t} - e^{-3t}\) ✓.
Figure 7: Response of \(x''+4x = \delta_2(t)-\delta_5(t)\), \(x(0)=x'(0)=0\) (Logan §3.4, Ex. 6). The first impulse at \(t=2\) starts oscillation; the second at \(t=5\) modifies it. Compare the analytic solution (solid) with solve_ivp using a narrow rectangular pulse (dashed).
B.10 — Summary: The Laplace Transform Toolkit
The table below (Logan, Table 3.1) collects the essential transform pairs. SymPy can verify every entry.
Show the code — verify Table 3.1 entries
t, s, k, a, n = sym.symbols('t s k a n', positive=True)entries = [ (r'e^{at}', sym.exp(a*t)), (r't^n', t**3), # n=3 as example (r'\sin kt', sym.sin(k*t)), (r'\cos kt', sym.cos(k*t)), (r'\sinh kt', sym.sinh(k*t)), (r'\cosh kt', sym.cosh(k*t)), (r'e^{at}\sin kt', sym.exp(a*t)*sym.sin(k*t)), (r'e^{at}\cos kt', sym.exp(a*t)*sym.cos(k*t)), (r'H(t-a)', sym.Heaviside(t-a)), (r'\delta_a(t)', sym.DiracDelta(t-a)),]print(f"{'x(t)':<25} X(s)")print("-"*60)for label, f in entries: F, *_ = sym.laplace_transform(f, t, s, noconds=False)print(f" {label:<23}{sym.simplify(F)}")
Transform the IVP: replace \(x'\) by \(sX - x(0)\) and \(x''\) by \(s^2X - sx(0) - x'(0)\); use linearity.
Solve the resulting algebraic equation for \(X(s)\).
Invert\(X(s)\) using the table, partial fractions, completing the square, the switching property (\(e^{-as}\) signals a time delay), and convolution.
References
Logan, J David. 2015. A First Course in Differential Equations, Third Edition.
TipExpand for Session Info
import sys, importlibprint("Python version:", sys.version)for name in ['numpy', 'sympy', 'scipy', 'matplotlib']: mod = importlib.import_module(name)print(f"{name}=={mod.__version__}")