Differential Equations • Laplace Transforms

ODEs with Discontinuous Inputs — Solving ODEs with Discontinuous or Impulsive Inputs

Learn how Laplace transforms elegantly handle sudden switches, jumps, and impulses in differential equations.

A changing curve with sigma and variable symbols for differential equations
Inside this lesson 10 sections 5 questions 10 figures

SECTION 1

Historical Context & Motivation

⚠

Course Prerequisites

This lesson assumes you have completed a first course in single-variable calculus (derivatives and integrals) and have some exposure to solving ordinary differential equations. Comfort with algebraic manipulation of rational expressions will also help. The topics covered here — Laplace transforms, Heaviside step functions, Dirac delta functions, and ODEs with discontinuous inputs — are standard material in an undergraduate Differential Equations or Engineering Mathematics course. If any of the prerequisite topics feel unfamiliar, a quick review of derivatives, integrals, and basic ODE solution methods will make the material easier to follow.

In the real world, forces and inputs don't always change smoothly. Imagine flipping a light switch — the voltage jumps instantly from zero to full power. Or think about a hammer striking a nail — the force is enormous for a tiny fraction of a second, then disappears. These kinds of sudden, discontinuous inputs show up everywhere in engineering, physics, and biology. Standard methods for solving ordinary differential equations (ODEs) struggle with these abrupt changes, because those techniques typically assume the input function is smooth and well-behaved.

Mathematicians and engineers developed special tools to handle these situations. The Heaviside step function models sudden on/off switches, while the Dirac delta function models instantaneous impulses. Combined with Laplace transforms, these tools convert messy, piecewise differential equations into straightforward algebra problems. The timeline below shows how these ideas came together.

1780s • Laplace's Integral Transform

Pierre-Simon Laplace developed the integral transform that bears his name. Originally used in probability theory, it would later become essential for solving differential equations with complex inputs.

1890s • Heaviside's Operational Calculus

Oliver Heaviside, a self-taught English engineer, created an operational calculus for analyzing electrical circuits. He introduced the step function to model switches being turned on or off, though mathematicians initially dismissed his methods as non-rigorous.

1930s • Dirac's Delta Function

Physicist Paul Dirac introduced the delta function in quantum mechanics to represent a perfect impulse — an infinite spike concentrated at a single point with a total area of one. This idea was controversial until Laurent Schwartz gave it rigorous footing in the 1940s.

1940s–50s • Standard Engineering Toolkit

During and after World War II, Laplace transform methods became the standard approach for control systems engineering. Textbooks unified Heaviside's step function, Dirac's delta, and Laplace transforms into the powerful framework taught today in college differential equations courses.

The central question this lesson addresses is: How do we solve a differential equation when the input suddenly switches on, switches off, or delivers an instantaneous shock? The answer lies in translating these tricky inputs into the Laplace domain, where they become simple algebraic expressions.

SECTION 2

Core Principles & Definitions

Before diving into calculations, you need to understand four foundational ideas that make everything else in this lesson work. These concepts build on one another: the step function models switches, the delta function models impulses, Laplace transforms convert them to algebra, and the shifting theorem handles delayed inputs.

💡

Mathematical Background Needed

The Laplace transform uses a complex variable s (which can have both real and imaginary parts), and the method relies on techniques such as partial fraction decomposition and solving second-order ODEs with initial conditions. These are standard tools from calculus and an introductory differential equations course. If any of them feel rusty, a quick review of partial fractions and second-order linear ODEs will make the worked examples much easier to follow.
1

The Heaviside Step Function u(t − a)

This function equals 0 when t < a and equals 1 when t ≥ a. It models a switch that turns on at time t = a. You can multiply any function by u(t − a) to "activate" it only after time a. Think of it like a light switch: before time a, the output is off (0); from time a onward, the output is on (1).
2

The Dirac Delta Function δ(t − a)

This represents an instantaneous impulse at t = a. It is zero everywhere except at t = a, yet its integral over all time equals 1. Think of it as the mathematical version of a hammer strike — all the energy delivered in zero time. It is not an ordinary function but a mathematical idealization called a distribution.
3

The Laplace Transform

The transform ℒ{f(t)} = F(s) converts a function of time into a function of the variable s. This is defined by the integral from 0 to ∞ of e−ste^{−st}·f(t) dt. Derivatives of f(t) become multiplication by s in the s-domain, which turns differential equations into algebraic equations that are much easier to solve.
4

The Second Shifting Theorem

If ℒ{f(t)} = F(s), then ℒ{u(t − a) · f(t − a)} = e−ase^{−as} · F(s). This theorem is the key to handling delayed or shifted inputs — the exponential factor e−ase^{−as} encodes the time delay a. Reading it in reverse lets you undo the transform once you have a solution in the s-domain.
✦

KEY TAKEAWAY

Think of the Laplace transform as a translator. Imagine you have a math problem written in a language that's hard to work with — full of sudden jumps and spikes. The Laplace transform translates it into a simpler "language" (algebra in the s-domain) where you can solve it easily. Then you translate the answer back into the original language using the inverse Laplace transform — the process of converting F(s) back to f(t), typically using a table of known transform pairs combined with partial fraction decomposition. The step function and delta function are just specific entries in this translation dictionary.

SECTION 3

Visualizing Discontinuous & Impulsive Inputs

To truly understand these functions, you need to see what they look like. The diagram below shows the Heaviside step function u(t − 2), which stays at 0 until t = 2 and then jumps to 1, alongside the Dirac delta function δ(t − 2), which is an infinitely tall, infinitely thin spike at t = 2. Both are plotted on the same time axis so you can compare their behavior.

Heaviside Step Function vs. Dirac Delta Functionu(t − 2): Step Functionty0241δ(t − 2): Delta Functionty024Area = 1Key Laplace Transforms:ℒ{u(t−a)} = e^(−as) / sℒ{δ(t−a)} = e^(−as)Step: switches value at t = aDelta: delivers impulse at t = aThe open circle ○ means the point is excluded; the filled circle ● means it is included.
Left: the Heaviside step function u(t − 2) jumps from 0 to 1 at t = 2. The dashed line shows the instantaneous jump. Right: the Dirac delta function δ(t − 2) represents an infinitely tall spike at t = 2 with total area equal to 1. The arrow indicates that the spike extends to infinity.

Notice how different these two functions are. The step function represents a permanent change — once the switch flips on, it stays on. The delta function represents a momentary jolt — all the energy is concentrated at a single instant. In practice, you can build any piecewise-defined input by combining step functions. For example, a force that's on from t = 2 to t = 5 can be written as u(t − 2) − u(t − 5). This is why these building blocks are so powerful.

SECTION 4

Mathematical Framework

Now let's formalize the mathematics. The strategy for solving ODEs with discontinuous or impulsive inputs follows a consistent three-step process: (1) take the Laplace transform of both sides, (2) solve the resulting algebraic equation for Y(s), and (3) apply the inverse Laplace transform to get y(t). The key formulas you need are listed below.

LAPLACE TRANSFORM OF THE STEP FUNCTION

Lu(t−a)=e(−as)/sℒ{u(t − a)} = e^(−as) / s

Here u(t − a) is the unit step turning on at t = a, s is the Laplace variable, and a ≥ 0 is the delay time.

SECOND SHIFTING THEOREM

Lu(t−a)⋅f(t−a)=e(−as)⋅F(s)ℒ{u(t − a) · f(t − a)} = e^(−as) · F(s)

If ℒ{f(t)} = F(s), then multiplying by a shifted step function and shifting the argument of f by the same amount a introduces a factor of e−ase^{−as} in the s-domain. This is the workhorse theorem for discontinuous inputs.

LAPLACE TRANSFORM OF THE DELTA FUNCTION

Lδ(t−a)=e(−as)ℒ{δ(t − a)} = e^(−as)

The impulse at t = a transforms to a simple exponential. When a = 0, this becomes ℒ{δ(t)} = 1, meaning an impulse at the origin has the simplest possible Laplace transform.

LAPLACE TRANSFORM OF DERIVATIVES

Ly′=sY(s)−y(0),Ly″=s2Y(s)−sy(0)−y′(0)ℒ{y′} = sY(s) − y(0), ℒ{y″} = s²Y(s) − sy(0) − y′(0)

These formulas convert derivatives of y into algebraic expressions involving Y(s) and the initial conditions y(0), y′(0). This is why Laplace transforms turn differential equations into algebra. Note: these formulas assume familiarity with first and second derivative notation and with initial-value problems from a calculus or differential equations course.

💡

The General Strategy

Given an ODE like y″ + 3y′ + 2y = g(t) with initial conditions, follow these steps: (1) Take ℒ of both sides, replacing derivatives with s-expressions and g(t) with G(s). (2) Solve for Y(s) algebraically. (3) Use partial fraction decomposition (if needed) and inverse Laplace transform tables to convert Y(s) back to y(t). Partial fraction decomposition — breaking a rational expression like A/[s(s²+4)] into simpler fractions — is a technique from algebra and calculus that is essential here.

SECTION 5

Building Piecewise Functions with Step Functions

One of the most practical skills in this topic is learning to rewrite a piecewise-defined function using step functions. In standard math notation, you might define a function with cases — for example, g(t) = 0 for t < 1, g(t) = 5 for 1 ≤ t < 4, and g(t) = 0 for t ≥ 4. Using step functions, this becomes g(t) = 5[u(t − 1) − u(t − 4)]. The step u(t − 1) switches the 5 on at t = 1, and subtracting u(t − 4) switches it back off at t = 4.

Building a Piecewise Input with Step Functionstg(t)01475Step-Function Decomposition:g(t) = 5·u(t − 1) − 5·u(t − 4)= 5·[u(t − 1) − u(t − 4)]u(t−1) turns ON−u(t−4) turns OFFLaplace Transform:ℒ{g(t)} = 5·e^(−s)/s − 5·e^(−4s)/s = (5/s)·[e^(−s) − e^(−4s)]
The piecewise function g(t) equals 5 on the interval [1, 4) and 0 elsewhere. It decomposes into 5·u(t − 1) − 5·u(t − 4). The green annotation shows where the first step turns on, and the red annotation shows where the subtracted step turns the function back off.

This technique generalizes naturally. Any function that changes its formula at specific times can be rewritten using step functions. For instance, suppose a force ramps up linearly starting at t = 3. You'd write f(t) = (t − 3) · u(t − 3). The factor (t − 3) gives the ramp shape, and u(t − 3) ensures it only starts at t = 3. This form is exactly what the second shifting theorem is designed to handle.

Piecewise InputStep-Function FormLaplace Transform
Constant c from t = a onwardc · u(t − a)c · e−ase^{−as} / s
Constant c from t = a to t = bc · [u(t − a) − u(t − b)](c/s) · [e−ase^{−as} − e−bse^{−bs}]
Ramp (t − a) starting at t = a(t − a) · u(t − a)e−ase^{−as} / s²
Impulse at t = aδ(t − a)e−ase^{−as}

Common discontinuous inputs and their Laplace transforms

SECTION 6

Worked Example — ODE with a Step-Function Input

Let's solve a complete problem from start to finish. Consider a spring-mass system where a constant force of 5 is suddenly applied at t = 2. The governing equation is:

PROBLEM STATEMENT

y″+4y=5⋅u(t−2),y(0)=0,y′(0)=0y″ + 4y = 5·u(t − 2), y(0) = 0, y′(0) = 0

The right-hand side is a step function that turns on a force of magnitude 5 at time t = 2. The system starts at rest (both initial conditions are zero). This is a second-order ODE with constant coefficients — a type studied in a first course in differential equations.

Solving y″ + 4y = 5·u(t − 2)

  1. 1

    Step 1 — Take the Laplace Transform of Both Sides

    Apply ℒ to each term. The left side gives ℒ{y″} + 4ℒ{y} = [s²Y(s) − sy(0) − y′(0)] + 4Y(s). Since y(0) = 0 and y′(0) = 0, this simplifies to (s² + 4)Y(s). The right side gives ℒ{5·u(t − 2)} = 5e−2s5e^{−2s}/s. So the transformed equation is:
    (s² + 4)Y(s) = 5e−2s5e^{−2s} / s
  2. 2

    Step 2 — Solve for Y(s)

    Divide both sides by (s² + 4) to isolate Y(s):
    Y(s) = 5e−2s5e^{−2s} / [s(s² + 4)]
  3. 3

    Step 3 — Partial Fraction Decomposition

    Ignore the e−2se^{−2s} factor for now and decompose 5/[s(s² + 4)] using partial fractions — a technique for rewriting a fraction with a polynomial denominator as a sum of simpler fractions. Set 5/[s(s² + 4)] = A/s + (Bs + C)/(s² + 4). Multiplying through by s(s² + 4) gives 5 = A(s² + 4) + (Bs + C)s. Setting s = 0: 5 = 4A, so A = 5/4. Expanding and comparing coefficients of s²: 0 = A + B, so B = −5/4. Comparing coefficients of s¹: 0 = C. So:
    5/[s(s² + 4)] = (5/4)·(1/s) − (5/4)·s/(s² + 4)
  4. 4

    Step 4 — Apply the Inverse Laplace Transform

    Without the e−2se^{−2s} factor, the inverse transform of (5/4)·(1/s) − (5/4)·s/(s² + 4) is (5/4) − (5/4)cos(2t). This is our f(t), using the standard pairs ℒ⁻¹{1/s} = 1 and ℒ⁻¹{s/(s²+4)} = cos(2t). Now apply the second shifting theorem: the factor e−2se^{−2s} means we replace t with (t − 2) and multiply by u(t − 2).
    y(t) = (5/4)[1 − cos(2(t − 2))] · u(t − 2)
  5. 5

    Step 5 — Interpret the Solution

    The solution tells us the system does nothing until t = 2 (because of the u(t − 2) factor). At t = 2, the force kicks in and the mass begins oscillating around a new equilibrium. The (5/4) represents the shift in the equilibrium position, and cos(2(t − 2)) represents the oscillation around it with angular frequency 2.
    Before t = 2: y = 0. After t = 2: oscillation about y = 5/4.

SECTION 7

Strengths & Limitations of the Laplace Transform Method

The Laplace transform approach is not the only way to solve ODEs, so it's important to understand when it shines and when other methods might be preferred. The table below compares the Laplace method with one alternative you may encounter in a differential equations course: the method of undetermined coefficients, which is used for smooth (non-discontinuous) inputs.

FeatureLaplace TransformsUndetermined Coefficients
Discontinuous inputsHandles naturally via step/delta functionsCannot handle directly; must split into intervals
Impulsive inputs (delta)Simple: ℒ{δ(t − a)} = e−ase^{−as}Not applicable
Initial conditionsBuilt into the transform automaticallyApplied separately after finding general solution
Smooth, polynomial/exponential inputsWorks but may be more work than neededUsually faster and more direct
Algebraic complexityPartial fraction decomposition can get tediousSystem of equations for coefficients

Comparison of ODE solution methods for different input types

⚡

WHEN TO USE LAPLACE

Use the Laplace transform method whenever your input has jumps, switches, or impulses. It's like choosing the right tool for a job — you could technically cut wood with a hand saw, but if the job calls for a power saw, you reach for the right tool. Laplace transforms are the right tool for discontinuous inputs. For smooth inputs like polynomials or exponentials, simpler methods like undetermined coefficients are perfectly fine and often faster.

SECTION 8

Connections to Transfer Functions & Advanced Theory

The techniques you've learned in this lesson are the gateway to deeper topics in engineering and applied mathematics. When you take the Laplace transform of an ODE and solve for Y(s), the ratio Y(s)/G(s) — where G(s) is the Laplace transform of the input — is called the transfer function H(s). The transfer function captures everything about how the system responds to inputs, independent of what the actual input is — it is a property of the system itself, not of any particular input. This idea is foundational in control systems engineering, signal processing, and circuit analysis, and is a major topic in upper-division engineering courses.

This LessonAdvanced Extension
Step function u(t − a)Step response of systems; characterizing system behavior
Delta function δ(t − a)Impulse response h(t); convolution integral y(t) = h(t) * g(t)
Solving Y(s) algebraicallyTransfer functions H(s) = Y(s)/G(s); Bode plots; stability analysis
Second shifting theoremDelay differential equations; time-delay systems in control

How this lesson connects to advanced topics

If this topic interests you, the natural next step is studying the convolution theorem, which states that ℒ{f g} = F(s)·G(s). Here, f g denotes the convolution integral — a way of combining two functions that measures how much one function overlaps with a reversed and shifted copy of the other. This powerful result means that the output of any linear system can be computed by convolving the input with the system's impulse response — the response to δ(t). You've already taken the first step toward understanding this by working with δ(t) in this lesson.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

Explain in your own words the difference between the Heaviside step function u(t − 3) and the Dirac delta function δ(t − 3). What kind of real-world scenario would each model?
Show answer
The step function u(t − 3) represents a permanent change that begins at t = 3 — it equals 0 before t = 3 and 1 from t = 3 onward. A real-world example is flipping a light switch on at t = 3; the light stays on forever afterward. The delta function δ(t − 3) represents an instantaneous impulse at t = 3 — it is zero everywhere except at that one instant, yet it delivers a finite total "amount" (integral equals 1). A real-world example is a hammer striking a surface at t = 3: the force is enormous but lasts for an infinitesimally short time. The key distinction is that the step produces a sustained effect while the delta produces a momentary one.

Question 2: BASIC CALCULATION

Write the piecewise function g(t) = { 0 for t < 3, 7 for t ≥ 3 } using a step function, then find its Laplace transform ℒ{g(t)}.
Show answer
The function turns on a constant value of 7 at t = 3, which is written as g(t) = 7·u(t − 3). Applying the Laplace transform formula ℒ{c·u(t − a)} = c·e−ase^{−as}/s, we substitute c = 7 and a = 3 to get ℒ{g(t)} = 7e−3s7e^{−3s}/s. The exponential factor e−3se^{−3s} encodes the delay of 3 time units, and the 1/s corresponds to the constant function being "switched on."

Question 3: INTERMEDIATE

Solve the initial value problem y′ + 2y = 3·δ(t − 1), with y(0) = 0. Provide y(t) in terms of step functions.
Show answer
Take the Laplace transform of both sides: sY(s) − y(0) + 2Y(s) = 3e−s3e^{−s}. Since y(0) = 0, this simplifies to (s + 2)Y(s) = 3e−s3e^{−s}, giving Y(s) = 3e−s3e^{−s}/(s + 2). The inverse Laplace transform of 1/(s + 2) is e−2te^{−2t} (a standard transform pair). Applying the second shifting theorem, the e−se^{−s} factor shifts t to (t − 1) and introduces u(t − 1). Therefore y(t) = 3e−2(t−1)3e^{−2(t−1)}·u(t − 1). The solution is zero before t = 1, then at t = 1 the impulse causes a jump to y = 3, after which the solution decays exponentially with rate 2.

Question 4: APPLIED

An electrical circuit is modeled by y″ + 5y′ + 6y = 10·[u(t − 1) − u(t − 3)], with y(0) = 0 and y′(0) = 0. Set up the Laplace-domain equation for Y(s) (you do not need to fully solve for y(t), but find Y(s) and indicate what partial fractions you would need).
Show answer
Taking the Laplace transform with zero initial conditions: (s² + 5s + 6)Y(s) = 10·[e−se^{−s} − e−3se^{−3s}]/s. Factor the characteristic polynomial: s² + 5s + 6 = (s + 2)(s + 3). So Y(s) = 10·[e−se^{−s} − e−3se^{−3s}] / [s(s + 2)(s + 3)]. To invert, perform partial fractions on 10/[s(s + 2)(s + 3)] = A/s + B/(s + 2) + C/(s + 3). Multiplying both sides by s(s+2)(s+3) and solving: setting s = 0 gives 10 = 6A so A = 5/3; setting s = −2 gives 10 = (−2)(1)B so B = −5; setting s = −3 gives 10 = (−3)(−1)C so C = 10/3. Then apply the second shifting theorem separately for each exponential factor. The first term (with e−se^{−s}) gives a response starting at t = 1, and the subtracted term (with e−3se^{−3s}) turns the input off at t = 3.

Question 5: CRITICAL THINKING

Consider the ODE y′ + y = δ(t − 2) + δ(t − 5), with y(0) = 0. Solve for y(t), sketch what the solution looks like, and explain physically what happens at t = 2 and t = 5. How does the principle of superposition apply here?
Show answer
Taking the Laplace transform: (s + 1)Y(s) = e−2se^{−2s} + e−5se^{−5s}, so Y(s) = e−2se^{−2s}/(s + 1) + e−5se^{−5s}/(s + 1). Since ℒ⁻¹{1/(s + 1)} = e−te^{−t}, applying the shifting theorem to each term gives y(t) = e−(t−2)e^{−(t−2)}·u(t − 2) + e−(t−5)e^{−(t−5)}·u(t − 5). Physically, the system is at rest until t = 2, when the first impulse causes a sudden jump to y = 1, followed by exponential decay. At t = 5, the second impulse adds another jump on top of the decaying response, increasing y by 1 again (from its current value of e−3e^{−3} ≈ 0.05 to about 1.05), then both components decay. This demonstrates superposition: the response to two impulses is the sum of the individual impulse responses, each shifted in time. Linear systems allow us to handle each input separately and add the results.

SUMMARY

Lesson Summary

Summary

This lesson introduced how to solve ordinary differential equations with discontinuous or impulsive inputs using Laplace transforms — a core technique from undergraduate differential equations and engineering mathematics. We saw that the Heaviside step function u(t − a) models sudden switches that turn on at time a, while the Dirac delta function δ(t − a) models instantaneous impulses. Their Laplace transforms — e−ase^{−as}/s and e−ase^{−as}, respectively — are elegantly simple. By combining these functions, any piecewise input can be expressed in a form suitable for the Laplace approach.

The solution process follows three steps: take the Laplace transform of both sides (converting derivatives to algebra), solve for Y(s) using algebra and partial fraction decomposition, then apply the inverse Laplace transform with the second shifting theorem to recover y(t). This method automatically incorporates initial conditions and handles jumps and spikes that would be extremely difficult to manage with other techniques. Looking ahead, these ideas lead to transfer functions and convolution — cornerstones of modern engineering analysis typically studied in upper-division college courses.

Varsity Tutors • Differential Equations • ODEs with Discontinuous Inputs