Unit Step Functions
The unit step function u(t − c), also called the Heaviside function, is 0 before time c and 1 from time c on. It works like a switch, so you can write piecewise forcing as one formula. Its Laplace transform is e^(−cs)/s, and the second shifting theorem turns a delay in t into a factor of e^(−cs).
Before this lesson: Laplace Transform and Solving Differential Equations with Laplace Transforms
What the unit step function means
Think of a light switch that flips on at time c. Before c the output is 0, and from c on it is 1. Multiplying any function by u(t − c) keeps that function switched off until time c.
u(t - c) = \begin{cases} 0, & t \lt c \\ 1, & t \ge c \end{cases}Real forcing often switches on and off: a heater turns on after an hour, a voltage is applied for 2 seconds, a push stops at a set time. These are piecewise functions, and step functions write each one as a single formula that the Laplace transform can handle.
Two patterns cover most cases. To jump from value a to value b at time c, add (b − a)u(t − c). To keep something on only from time a to time b, multiply it by the window u(t − a) − u(t − b).
Unit step function rules
For c ≥ 0 and F(s) = L{f(t)}:
\mathcal{L}\{u(t - c)\} = \dfrac{e^{-cs}}{s}\mathcal{L}\{u(t - c)f(t - c)\} = e^{-cs}F(s)\mathcal{L}^{-1}\{e^{-cs}F(s)\} = u(t - c)f(t - c)The middle line is the second shifting theorem. It says that delaying a function by c, and keeping it off until then, multiplies its transform by e^(−cs). The last line is the same rule read backwards.
If the function next to u(t − c) is not written in terms of t − c, use this form instead:
\mathcal{L}\{u(t - c)g(t)\} = e^{-cs}\,\mathcal{L}\{g(t + c)\}How to solve an equation with step-function forcing
- Write the forcing with step functions, using jumps (b − a)u(t − c) or windows u(t − a) − u(t − b).
- Transform both sides; each u(t − c) term brings a factor e^(−cs).
- Solve for Y(s) and group it as sums of e^(−cs) times a plain fraction F(s).
- Invert each F(s) with partial fractions, then shift: e^(−cs)F(s) becomes u(t − c)f(t − c).
Unit step function examples
Example 1: Writing a piecewise function with step functions
Write f(t) with step functions and find its Laplace transform.
f(t) = \begin{cases} 3, & 0 \le t \lt 2 \\ 7, & 2 \le t \lt 5 \\ 0, & t \ge 5 \end{cases}f(t) = 3 + (7 - 3)u(t - 2) + (0 - 7)u(t - 5)
Start at 3, then add each jump times a step at the jump time.
f(t) = 3 + 4u(t - 2) - 7u(t - 5)
Simplify the jumps.
\mathcal{L}\{f\} = \dfrac{3}{s} + 4\cdot\dfrac{e^{-2s}}{s} - 7\cdot\dfrac{e^{-5s}}{s}Transform each term with L{u(t − c)} = e^(−cs)/s.
F(s) = \dfrac{3 + 4e^{-2s} - 7e^{-5s}}{s}Write over one denominator.
Answer: f(t) = 3 + 4u(t − 2) − 7u(t − 5), and F(s) = (3 + 4e^(−2s) − 7e^(−5s))/s. Check at t = 6: 3 + 4 − 7 = 0, as it should be.
Example 2: A step times a function that is not shifted
Find L{u(t − 2) t}.
\mathcal{L}\{u(t - 2)\,t\} = e^{-2s}\,\mathcal{L}\{t + 2\}Use L{u(t − c)g(t)} = e^(−cs) L{g(t + c)} with c = 2 and g(t) = t.
\mathcal{L}\{t + 2\} = \dfrac{1}{s^2} + \dfrac{2}{s}Transform t + 2 with the table.
\mathcal{L}\{u(t - 2)\,t\} = e^{-2s}\left(\dfrac{1}{s^2} + \dfrac{2}{s}\right)Multiply by e^(−2s).
Answer: e^(−2s)(1/s² + 2/s). Another way to see it: t = (t − 2) + 2, so u(t − 2)t = u(t − 2)(t − 2) + 2u(t − 2), which transforms to e^(−2s)/s² + 2e^(−2s)/s.
Example 3: An inverse transform with a delay
Find L⁻¹{e^(−4s)/(s² + 9)}.
F(s) = \dfrac{1}{s^2 + 9}Set aside the factor e^(−4s); c = 4.
F(s) = \dfrac{1}{3}\cdot\dfrac{3}{s^2 + 9}The sine row needs b = 3 on top, so multiply and divide by 3.
f(t) = \tfrac{1}{3}\sin 3tInvert F(s).
\mathcal{L}^{-1}\{e^{-4s}F(s)\} = u(t - 4)\,\tfrac{1}{3}\sin\big(3(t - 4)\big)Apply the second shifting theorem: replace t with t − 4 and multiply by u(t − 4).
Answer: (1/3)u(t − 4) sin(3(t − 4)). The function is 0 until t = 4, then a sine wave starts from 0.
Example 4: A heater that switches on (word problem)
A small room starts at outdoor temperature. Let y(t) be how many degrees Celsius the room is above outdoors after t hours. A heater switches on at t = 1 hour, and the model is y′ + 2y = 4u(t − 1) with y(0) = 0. Find y(t), how warm the room is at t = 2 hours, and the long-run temperature rise.
sY - 0 + 2Y = \dfrac{4e^{-s}}{s}Transform both sides and substitute y(0) = 0.
Y = e^{-s}\cdot\dfrac{4}{s(s + 2)}Factor out Y, divide by s + 2 and set aside e^(−s).
\dfrac{4}{s(s + 2)} = \dfrac{2}{s} - \dfrac{2}{s + 2}Partial fractions: 4 = A(s + 2) + Bs gives A = 2 (s = 0) and B = −2 (s = −2).
f(t) = 2 - 2e^{-2t}Invert the plain fraction.
y(t) = u(t - 1)\left(2 - 2e^{-2(t - 1)}\right)Shift by 1 and multiply by u(t − 1).
y(2) = 2 - 2e^{-2}Substitute t = 2, where u(1) = 1.
y(2) \approx 1.73
Evaluate: e^(−2) ≈ 0.1353.
Answer: y = 0 for the first hour, then y(t) = 2 − 2e^(−2(t − 1)). At t = 2 hours the room is about 1.73 °C above outdoors, and as t grows the rise approaches 2 °C. The heater’s effect follows the same pattern as Newton’s law of cooling, started one hour late.
Example 5: A push that stops
A spring system starts at rest at equilibrium. A constant push acts from t = 0 to t = π and then stops, so y″ + 4y = 8 − 8u(t − π) with y(0) = 0 and y′(0) = 0. Find y(t).
s^2Y - 0 - 0 + 4Y = \dfrac{8}{s} - \dfrac{8e^{-\pi s}}{s}Transform both sides and substitute the zero initial values.
Y = \dfrac{8}{s(s^2 + 4)}\left(1 - e^{-\pi s}\right)Factor out Y, divide by s² + 4 and factor out 8/s.
8 = A(s^2 + 4) + (Bs + C)s
Partial fractions for 8/(s(s² + 4)) = A/s + (Bs + C)/(s² + 4).
A = 2
Substitute s = 0: 8 = 4A.
0 = (2 + B)s^2 + Cs \Rightarrow B = -2,\ C = 0
Subtract 8 and match coefficients.
f(t) = 2 - 2\cos 2t
Invert 2/s − 2s/(s² + 4).
y(t) = (2 - 2\cos 2t) - u(t - \pi)\big(2 - 2\cos(2(t - \pi))\big)
The e^(−πs) term shifts f by π.
\cos(2(t - \pi)) = \cos(2t - 2\pi) = \cos 2t
Cosine has period 2π (see amplitude and period).
y(t) = (2 - 2\cos 2t)\big(1 - u(t - \pi)\big)
Factor out 2 − 2 cos 2t.
Answer: y(t) = 2 − 2 cos 2t for t from 0 to π, and y(t) = 0 for t ≥ π. The push stops at the moment the mass is back at equilibrium with zero velocity (y(π) = 0 and y′(π) = 4 sin 2π = 0), so it stays at rest. Compare the steady motion in spring-mass systems.
Common mistakes
| Mistake | Example of the error | Fix |
|---|---|---|
| Not shifting g(t) before transforming | L{u(t − 2)t} = e^(−2s)/s² | Use L{g(t + 2)}: L{t + 2} = 1/s² + 2/s, then multiply by e^(−2s). |
| Not shifting f when inverting | L⁻¹{e^(−4s)/(s² + 9)} = u(t − 4)(1/3) sin 3t | Replace t with t − 4: (1/3)u(t − 4) sin(3(t − 4)). |
| Wrong sign in the exponent | L{u(t − 3)} = e^(3s)/s | A delay gives a decaying factor: e^(−3s)/s. |
| Using the new value instead of the jump | 3 for t before 2, then 7: f = 3 + 7u(t − 2) | Add the change, 7 − 3 = 4: f = 3 + 4u(t − 2). |
| Dropping the step in the answer | y = 2 − 2e^(−2(t − 1)) | Keep u(t − 1); without it the formula is wrong for t before 1. |
| Adding steps for a window | on from 1 to 3: u(t − 1) + u(t − 3) | Subtract: u(t − 1) − u(t − 3). |
Related ideas
Shifting in s vs. shifting in t
The first shifting theorem from the Laplace Transform lesson multiplies f(t) by e^(at) and shifts s to s − a. The second shifting theorem goes the other way: it delays f in t and multiplies F(s) by e^(−cs). Use the inverse Laplace transform methods on F(s) first, then apply the delay.
Impulses
A push that is very strong and very short, like a hammer strike, is the limit of a narrow window. That limit is the Dirac delta function, the next lesson.
Practice problems
- Find L{u(t − 4)}.
- Find L{5u(t − 1) − 2u(t − 3)}.
- Find L{u(t − 2)e^(3(t − 2))}.
- Find L{u(t − π) sin(t − π)}.
- Find L{u(t − 1) t²}.
- Write f(t) = 2 for t from 0 to 3 and f(t) = 6 for t ≥ 3 with a step function, then find its transform.
- Find L⁻¹{e^(−2s)/s²}.
- Find L⁻¹{e^(−s)/(s − 4)}.
- Find L⁻¹{3e^(−5s)/(s(s + 3))}.
- Solve y′ + y = 2u(t − 3) with y(0) = 1.
Show answers
1.
\mathcal{L}\{u(t - 4)\} = \dfrac{e^{-4s}}{s}Use the step rule with c = 4.
Answer: e^(−4s)/s
2.
5\cdot\dfrac{e^{-s}}{s} - 2\cdot\dfrac{e^{-3s}}{s}Transform each step by linearity.
Answer: (5e^(−s) − 2e^(−3s))/s
3.
f(t) = e^{3t},\quad F(s) = \dfrac{1}{s - 3}The function is already shifted by c = 2.
\mathcal{L}\{u(t - 2)f(t - 2)\} = e^{-2s}F(s)Apply the second shifting theorem.
Answer: e^(−2s)/(s − 3)
4.
f(t) = \sin t,\quad F(s) = \dfrac{1}{s^2 + 1}The function is already shifted by c = π.
Answer: e^(−πs)/(s² + 1)
5.
g(t + 1) = (t + 1)^2
Use L{u(t − c)g(t)} = e^(−cs) L{g(t + c)} with g(t) = t² and c = 1.
(t + 1)^2 = t^2 + 2t + 1
Expand the square (see special products of binomials).
\mathcal{L}\{t^2 + 2t + 1\} = \dfrac{2}{s^3} + \dfrac{2}{s^2} + \dfrac{1}{s}Transform each term.
Answer: e^(−s)(2/s³ + 2/s² + 1/s)
6.
f(t) = 2 + (6 - 2)u(t - 3) = 2 + 4u(t - 3)
Start at 2 and add the jump of 4 at t = 3.
Answer: f(t) = 2 + 4u(t − 3), F(s) = 2/s + 4e^(−3s)/s
7.
F(s) = \dfrac{1}{s^2} \Rightarrow f(t) = tSet aside e^(−2s) and invert.
Answer: u(t − 2)(t − 2)
8.
F(s) = \dfrac{1}{s - 4} \Rightarrow f(t) = e^{4t}Set aside e^(−s) and invert.
Answer: u(t − 1)e^(4(t − 1))
9.
3 = A(s + 3) + Bs
Partial fractions for 3/(s(s + 3)) = A/s + B/(s + 3).
A = 1,\quad B = -1
Substitute s = 0 (3 = 3A), then s = −3 (3 = −3B).
f(t) = 1 - e^{-3t}Invert 1/s − 1/(s + 3).
Answer: u(t − 5)(1 − e^(−3(t − 5)))
10.
sY - 1 + Y = \dfrac{2e^{-3s}}{s}Transform and substitute y(0) = 1.
Y = \dfrac{1}{s + 1} + e^{-3s}\cdot\dfrac{2}{s(s + 1)}Add 1, factor out Y and divide by s + 1.
\dfrac{2}{s(s + 1)} = \dfrac{2}{s} - \dfrac{2}{s + 1}Partial fractions: A = 2 (s = 0), B = −2 (s = −1).
f(t) = 2 - 2e^{-t}Invert the plain fraction.
Answer: y = e^(−t) + u(t − 3)(2 − 2e^(−(t − 3)))
Unit step function FAQ
What is the unit step function?
It is the function u(t − c) that equals 0 for t less than c and 1 for t ≥ c. It is also called the Heaviside step function and is sometimes written u_c(t) or H(t − c).
What is the Laplace transform of the unit step function?
L{u(t − c)} = e^(−cs)/s for c ≥ 0. With c = 0 this is 1/s, the transform of the constant 1.
What is the second shifting theorem?
It says L{u(t − c)f(t − c)} = e^(−cs)F(s). A delay of c in time becomes a factor of e^(−cs) in the transform, and the inverse rule undoes it.
How do you write a piecewise function with step functions?
Start with the first piece, then at each break time c add (new piece − old piece) times u(t − c). For a piece that is on only from a to b, multiply it by u(t − a) − u(t − b).
Summary
- The unit step function u(t − c) is 0 before c and 1 from c on; it switches terms on.
- Write piecewise forcing as the first piece plus each jump times a step.
- L{u(t − c)} = e^(−cs)/s, and L{u(t − c)f(t − c)} = e^(−cs)F(s).
- If the term is not written in t − c, use L{u(t − c)g(t)} = e^(−cs) L{g(t + c)}.
- To invert e^(−cs)F(s), invert F(s), replace t with t − c and multiply by u(t − c).
Previous lesson: Solving Differential Equations with Laplace Transforms
Next lesson: Dirac Delta Function
Back to the Differential Equations Index