Back to the on-screen lesson ·

Step functions and shifting

The unit step as the vocabulary for forcing that switches, the two shifting theorems, and how a discontinuous input is transformed and inverted.

Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.

1. What you will learn

By the end of this lesson you will be able to write a piecewise forcing as a sum of unit steps and windows, rewrite the function attached to a step in the delayed variable, apply the second shifting theorem in both directions, tell it apart from the first shifting theorem, and sketch the forcing your algebra actually describes.

2. What you already have

You can transform an initial value problem and invert a rational transform by partial fractions. Everything so far has had a forcing that is smooth for all time. This lesson is about the forcings that are not — a voltage applied at a moment, a load dropped on a beam — which the guess method of unit 2 cannot touch and the transform handles without difficulty.

3. Words this lesson uses

TermWhat it means
Unit step (Heaviside function)$u_c(t)$, zero for $t < c$ and one for $t > c$.
Piecewise continuousContinuous except at finitely many jumps, as a forcing built from steps is.
WindowA difference of two steps, which switches something on and then off again.
First shifting theorem$\mathcal{L}\{e^{at}f(t)\} = F(s - a)$: it shifts $s$.
Second shifting theorem$\mathcal{L}\{u_c(t)f(t - c)\} = e^{-cs}F(s)$: it delays $t$.

4. Switching, and the two shifts

The unit step is the whole vocabulary. $u_c(t)$ turns something on at $t = c$; subtracting a later step turns it off again, so $u_c - u_d$ is a window open between $c$ and $d$; and any staircase is a sum of steps with the size of each jump as its coefficient.

The second shifting theorem. If $F(s) = \mathcal{L}\{f\}$ then

$$\mathcal{L}\{u_c(t)f(t - c)\} = e^{-cs}F(s).$$

A delay in time is a factor of $e^{-cs}$ in the transform, and nothing else changes. The condition is exact: the function attached to the step must be written in $t - c$. A forcing given as $u_c(t)g(t)$ has to be rewritten first, by putting $g$ in terms of $t - c$.

The first shifting theorem, for contrast:

$$\mathcal{L}\{e^{at}f(t)\} = F(s - a).$$

A shift in $s$ rather than a factor. The two are easy to confuse and do completely different things: one delays the function, the other multiplies it by an exponential.

In the other direction, an $e^{-cs}$ anywhere in a transform is a signal to invert what is left and then delay the result by $c$, attaching a step in front of it.

Another way: picture

A light switch and a dimmer. The step is the switch: before $c$ nothing, after $c$ full. The function multiplying it is the dimmer setting, and the second shifting theorem insists the dimmer's clock starts when the switch is thrown, not when the room was built.

Another way: steps

To transform a piecewise forcing:

  1. Write it as a sum of steps, using windows for anything that switches off.
  2. For each step, rewrite the attached function in $t - c$.
  3. Transform each attached function on its own.
  4. Multiply each by its $e^{-cs}$ and add.

To invert, run it backwards: separate the terms by their exponentials, invert each remaining rational function, then delay it and attach a step.

5. Rewriting a forcing in the delayed variable

The commonest real difficulty is step 2, so it is worth doing slowly. Suppose the forcing is $u_2(t)\,t^{2}$. The theorem does not apply as written, because the attached function is $t^{2}$ and not $(t-2)^{2}$.

Put $\tau = t - 2$, so $t = \tau + 2$ and

$$t^{2} = (\tau + 2)^{2} = \tau^{2} + 4\tau + 4.$$

So $u_2(t)\,t^{2} = u_2(t)\left[(t-2)^{2} + 4(t-2) + 4\right]$, and now every piece is in $t - 2$. Transforming gives

$$e^{-2s}\left(\frac{2}{s^{3}} + \frac{4}{s^{2}} + \frac{4}{s}\right).$$

The expansion is not optional and it is not algebraic decoration: skipping it and writing $e^{-2s}\cdot 2/s^{3}$ transforms a different forcing, one that is zero at the switch rather than jumping to four.

6. Where this goes wrong

Attaching the undelayed function. $u_c(t)f(t)$ is not $u_c(t)f(t-c)$, and only the second has the clean transform.

Confusing the two shifts. $e^{-cs}F(s)$ delays; $F(s-a)$ multiplies by an exponential. Reading one as the other changes what the answer describes.

Losing a sign on a window. $u_c - u_d$ with $c < d$ opens then closes; writing it the other way round gives a forcing that is negative in the middle and zero outside.

Worrying about the value at the jump. Whether $u_c(c)$ is $0$, $1$ or $\tfrac{1}{2}$ changes nothing: the transform is an integral, and a single point contributes nothing to it.

7. The method, step by step, and how to check it

A problem with a switched forcing is solved in three stages: describe the forcing with steps, transform and solve, then invert with delays.

  1. Write the forcing as a sum of steps. Read it off a description or a graph one switch at a time: at each switching time, add a step whose height is the jump there. A window from $c$ to $d$ is $u_c - u_d$.
  2. Check the description by evaluating it at a time in each stretch.
  3. Rewrite each attached function in $t - c$. Put $t = (t - c) + c$ and expand. A constant needs no rewriting.
  4. Transform each attached function as though $t - c$ were $t$, and multiply by $e^{-cs}$.
  5. Solve for $Y$ as in the previous lessons, keeping each exponential outside its fraction.
  6. Invert each fraction without its exponential, then replace $t$ by $t - c$ and attach $u_c(t)$.

Why the delay becomes a factor. In $\int_0^{\infty} e^{-st}u_c(t)h(t - c)\,dt$ the step removes everything before $c$, so the integral starts at $c$. Substituting $\tau = t - c$ turns it into $\int_0^{\infty} e^{-s(\tau + c)}h(\tau)\,d\tau = e^{-cs}H(s)$. The factor is the change of variable, and it only works if the attached function depends on $t - c$, which is why step 3 is not optional.

How to check the answer. Check each stretch between switches separately: the solution must satisfy the equation with the forcing as it is on that stretch. Then check the joins. For a first-order equation the solution is continuous at a switch even when the forcing jumps; for a second-order one both $y$ and $y'$ are continuous. Finally, a step's height appears as the coefficient of $\frac{1}{s}$ in the transform of its term, which is a quick check that step 3 was done.

Reading a staircase from a graph. Walk along the time axis from the left. At every time the graph jumps, write a step at that time with the jump as its coefficient: a jump up of $3$ is $+3u_c$, a jump down of $2$ is $-2u_c$. Nothing else is needed, and the sum of the coefficients up to any time is the height of the graph there, which is the check.

8. In the world: a pump that runs for a set time

A tank with a leak, fed by a pump that runs only between $t = 2$ and $t = 6$ minutes, holds a volume $y$ above its usual level that obeys $y' + y = 10\left(u_2(t) - u_6(t)\right)$: the pump adds $10$ litres a minute while it runs, and the leak removes the excess at a rate equal to itself. Starting at the usual level, $y(0) = 0$, transform:

$$sY + Y = 10\,\frac{e^{-2s} - e^{-6s}}{s} \quad\Rightarrow\quad Y = 10\left(e^{-2s} - e^{-6s}\right)\frac{1}{s(s + 1)}.$$

Since $\frac{1}{s(s + 1)} = \frac{1}{s} - \frac{1}{s + 1}$ inverts to $1 - e^{-t}$, each exponential delays that shape:

$$y = 10u_2(t)\left(1 - e^{-(t - 2)}\right) - 10u_6(t)\left(1 - e^{-(t - 6)}\right).$$

Read it stretch by stretch. Before $2$ minutes nothing happens. Between $2$ and $6$ the level rises towards $10$ litres: at $t = 6$ it is $10(1 - e^{-4}) \approx 9.8$. After $6$ the second term switches on, and $y = 10\left(e^{-(t - 6)} - e^{-(t - 2)}\right)$ drains back towards zero. One formula, found in one pass, describes all three stretches and joins them without a jump.

9. In the world: a dose taken on a schedule

A medicine taken as an infusion for a fixed time each day is a window of steps, and a week of doses is seven windows. The body's amount obeys $y' + ky = g(t)$ with $g$ built from steps, and its transform is the transform of one dose multiplied by $1 + e^{-24s} + e^{-48s} + \dots$: the delay rule does the bookkeeping of the schedule, and the inverse is the response to one dose added to copies of itself shifted by a day. Pharmacologists read from it the build-up over the first days and the level the doses settle into, which is how a dosing interval is chosen so that the drug never falls below its useful level nor rises to a toxic one.

10. In the world: switches in electronics

Every digital circuit is driven by signals that switch: a clock that turns on and off millions of times a second, a button pressed and released, a supply voltage applied at start-up. Each switch is a step, and the response of the circuit's resistors, capacitors and inductors to it is found by the method of this lesson. The single most common calculation in circuit design, how long a voltage takes to settle after a switch, is the delayed response $u_c(t)\left(1 - e^{-(t - c)/RC}\right)$, and an engineer choosing $R$ and $C$ to make that settling fast enough is reading the exponent. When the switching is faster than the settling, the steps overlap and the sum of their delayed responses is exactly what the oscilloscope shows.

11. In the world: a thermostat and a delayed response

A room heater controlled by a timer is switched on at $7$:00 and off at $8$:30. With $T$ the room's temperature above the outside, a simple model is $T' = -0.5T + 10\left(u_0(t) - u_{1.5}(t)\right)$, with $t$ in hours from $7$:00. Transforming from $T(0) = 0$ gives $T = 20\left(1 - e^{-0.5t}\right)$ while the heater runs, a rise towards $20$ degrees, and at $8$:30, $t = 1.5$, the room has reached $20\left(1 - e^{-0.75}\right) \approx 10.6$ degrees above outside. The delayed step then adds $-20u_{1.5}(t)\left(1 - e^{-0.5(t - 1.5)}\right)$, and the room cools as $10.6e^{-0.5(t - 1.5)}$. A heating engineer asked when to switch the timer on so the room is comfortable by a given time is solving this problem backwards, and the transform gives the whole curve to read the answer from. Every timer-driven appliance in a house, from an immersion heater to a dishwasher, is a sum of such delayed steps.

12. A delay is a factor, not a substitution

Because $e^{-cs}$ appears multiplied onto the transform, it is tempting to treat the delay as something that can be done at any point in the calculation, or to absorb it into the fraction and then run partial fractions on the whole thing. Neither works. The exponential is not a rational function, so it has no partial fraction decomposition and it is not a pole of anything; it is an instruction that says invert the rest, then start it later. The mirror-image error runs the other way: writing $u_c(t)f(t)$ and producing $e^{-cs}F(s)$ without rewriting $f$ in $t - c$. That one is quiet, because the answer looks entirely reasonable, and it describes a forcing that jumps to $f(c)$ at the switch rather than starting from wherever $f$ starts.

13. A voltage switched on and off

  1. A circuit is driven by $5$ volts between $t = 1$ and $t = 4$. Write it with steps.

    $g(t) = 5u_1(t) - 5u_4(t)$

    A window is a difference of two steps: on at $1$, off at $4$.

  2. Check the expression at a time in each of the three stretches.

    $g(0.5) = 0 - 0 = 0, \qquad g(2) = 5 - 0 = 5, \qquad g(6) = 5 - 5 = 0$

    Before $1$ neither step is on; between, only the first; after $4$, both, and they cancel.

  3. Each attached function is the constant $5$, already independent of $t$. Transform it.

    $\mathcal{L}\{5\} = \dfrac{5}{s}$

    A constant is its own delayed version, so no rewriting is needed.

  4. Apply the delay to each term.

    $G(s) = e^{-1 \cdot s}\dfrac{5}{s} - e^{-4s}\dfrac{5}{s}$

    Two switches, two exponentials: each records its moment.

  5. Factor the common $\frac{5}{s}$.

    $G(s) = \dfrac{5\left(e^{-s} - e^{-4s}\right)}{s}$

    The bracket records the window: open at $1$, closed at $4$.

14. Inverting a transform with an exponential in it

  1. Take $Y(s) = \dfrac{e^{-3s}}{s(s + 2)}$. Set the exponential aside.

    $Y(s) = e^{-3s}F(s), \qquad F(s) = \dfrac{1}{s(s + 2)}$

    The exponential is a delay instruction, not part of the fraction.

  2. Split $F$ by covering up.

    $F(s) = \dfrac{A}{s} + \dfrac{B}{s + 2}, \quad A = \dfrac{1}{0 + 2} = \dfrac{1}{2}, \quad B = \dfrac{1}{-2} = -\dfrac{1}{2}$

    Ordinary work from the previous lesson.

  3. Invert $F$ from the table.

    $f(t) = \tfrac{1}{2} - \tfrac{1}{2}e^{-2t} = \tfrac{1}{2}\left(1 - e^{-2t}\right)$

    Each piece is a table entry.

  4. Apply the delay: replace $t$ by $t - 3$ and attach the step.

    $y(t) = u_3(t) \cdot \tfrac{1}{2}\left(1 - e^{-2(t - 3)}\right)$

    The response is zero until $t = 3$ and then behaves as though it had just started.

  5. Check the value at the switch and in the long run.

    $y(3) = \tfrac{1}{2}(1 - e^{0}) = 0, \qquad y \to \tfrac{1}{2} \text{ as } t \to \infty$

    The response starts from zero at the switch with no jump, and settles at $\frac{1}{2}$, the value of $sY$ as $s \to 0$.

15. A switched-on forcing, solved end to end

  1. Solve $y' + 2y = 4u_1(t)$ with $y(0) = 0$. Transform every term.

    $sY - 0 + 2Y = \dfrac{4e^{-s}}{s}$

    The step switched on at $t = 1$ transforms to $\frac{e^{-s}}{s}$, times its height $4$.

  2. Collect $Y$ and divide by $s + 2$.

    $(s + 2)Y = \dfrac{4e^{-s}}{s} \quad\Rightarrow\quad Y = e^{-s} \cdot \dfrac{4}{s(s + 2)}$

    Keep the exponential outside the fraction: it is an instruction to delay.

  3. Split the fraction by covering up.

    $\dfrac{4}{s(s + 2)} = \dfrac{2}{s} - \dfrac{2}{s + 2}$

    At $s = 0$: $\frac{4}{2} = 2$. At $s = -2$: $\frac{4}{-2} = -2$.

  4. Invert the fraction, ignoring the delay for now.

    $h(t) = 2 - 2e^{-2t}$

    $\frac{1}{s} \to 1$ and $\frac{1}{s + 2} \to e^{-2t}$.

  5. Apply the delay: replace $t$ by $t - 1$ and attach $u_1(t)$.

    $y(t) = u_1(t)\left(2 - 2e^{-2(t - 1)}\right)$

    Nothing happens until the forcing switches on at $t = 1$.

  6. Check the stretch before the switch.

    $t < 1: \quad y = 0, \qquad y' + 2y = 0 = 4u_1(t)$

    Before $t = 1$ the forcing is off and the solution sits at its starting value.

  7. Check the stretch after the switch.

    $t > 1: \quad y' = 4e^{-2(t - 1)}, \qquad y' + 2y = 4e^{-2(t - 1)} + 4 - 4e^{-2(t - 1)} = 4$

    The equation holds, $y(1) = 0$ joins the two stretches without a jump, and $y \to 2 = \frac{4}{2}$.

16. Your turn: transform $g(t) = u_2(t)\,(t - 2)$, then $h(t) = u_2(t)\,t$

  1. Transform $g$: it is already written in $t - 2$.

    $\mathcal{L}\{u_2(t)(t - 2)\} = e^{-2s}\mathcal{L}\{t\} = \dfrac{e^{-2s}}{s^{2}}$

    No rewriting needed: the theorem applies directly.

  2. Your turn: work this step out. Its working is at the end of the packet.

    Rewrite $h$ in the delayed variable.

  3. Your turn: work this step out. Its working is at the end of the packet.

    Transform each part and apply the delay.

17. Guided practice

Match each description of a forcing to the expression that says it.

$3u_{1}(t)$$3 - 3u_{1}(t)$$3 + 3u_{1}(t)$$u_{1}(t)\,(t - 1)$
Nothing until $t = 1$, then $3$ for ever
$3$ from the start, switched off at $t = 1$
$3$ from the start, with another $3$ added at $t = 1$
Nothing until $t = 1$, then a ramp growing from zero

18. Guided practice

Complete the worked solution: invert $Y(s) = \dfrac{8e^{-5s}}{s(s + 2)}$.

  1. Set the exponential aside as a delay instruction.

    $Y(s) = e^{-5s}F(s), \qquad F(s) = \dfrac{8}{s(s + 2)}$

    $e^{-5s}$ says to delay the inverse of $F$ by $5$; it is not part of the fraction.

  2. Cover up $s$ in $F$, set $s = 0$, and simplify.

    $A = \dfrac{8}{0 + 2} =$ a

    Multiplying by $s$ and setting $s = 0$ removes every term but $A$.

  3. Cover up $s + 2$ in $F$, set $s = -2$, and simplify.

    $B = \dfrac{8}{-2} =$ b

    The same move for the other factor.

  4. Invert $F$ from the table.

    $f(t) = A \cdot 1 + B e^{-2t}$

    $\mathcal{L}^{-1}\left\{\frac{1}{s}\right\} = 1$ and $\mathcal{L}^{-1}\left\{\frac{1}{s + 2}\right\} = e^{-2t}$.

  5. Apply the delay: replace $t$ by $t - 5$ and attach the step.

    $y(t) = u_{5}(t)\left[A + Be^{-2(t - 5)}\right]$

    The second shifting theorem, read backwards.

  6. Read off the response before the switch.

    $t < 5: \quad u_{5}(t) = 0 \quad\Rightarrow\quad y(t) =$ z

    A system at rest stays at rest until it is disturbed.

19. Guided practice

What is the transform of $u_{5}(t)\,e^{4(t - 5)}$?

20. Practice

A forcing is $f(t) = 7u_{3}(t) + u_{7}(t)$. Fill in its value at each time, and the size of the second jump.

Value
At the start
Just after the first switch
Just after the second switch
The size of the second jump

21. Practice

A forcing is $f(t) = u_{6}(t)\,(t - 6)^{2}$. What is $f(10)$?

Answer:

22. Practice

A pump is switched on $1$ seconds after a process starts, and from then on its flow in litres a second ramps up with time as below; the control system needs the flow's Laplace transform. Find the Laplace transform of $f(t) = u_{1}(t)\,(4t + 3)$. Write $F(s)$ as a formula in $s$ (type the exponential as e^(...)).

Answer:

23. Somewhere new

Plot the value of $f(t) = 4u_{3}(t) - 2u_{5}(t)$ just after each of its two switching times.

Plot your answer on the grid:

12345678910-2-112345678910tf

24. Lesson test

Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.

25. Test question

A pump is switched on $3$ seconds after a process starts, and from then on its flow in litres a second ramps up with time as below; the control system needs the flow's Laplace transform. Find the Laplace transform of $f(t) = u_{3}(t)\,(5t + 6)$. Write $F(s)$ as a formula in $s$ (type the exponential as e^(...)).

Answer:

26. What you can do now

You can write a switched forcing with unit steps, transform it, and invert a transform that carries an exponential factor. Say in your own words why the function attached to a step must be rewritten in $t - c$ first.

Working for the steps left to you

16. Your turn: transform $g(t) = u_2(t)\,(t - 2)$, then $h(t) = u_2(t)\,t$, step 2

$t = (t - 2) + 2 \quad\Rightarrow\quad h(t) = u_2(t)\left[(t - 2) + 2\right]$

Adding and subtracting $2$ puts it in the form the theorem needs.

16. Your turn: transform $g(t) = u_2(t)\,(t - 2)$, then $h(t) = u_2(t)\,t$, step 3

$H(s) = e^{-2s}\left(\dfrac{1}{s^{2}} + \dfrac{2}{s}\right)$

The extra $\frac{2}{s}$ records the jump: $h$ leaps to $2$ at the switch while $g$ starts from zero.