When an outside force switches on, shuts off, or changes its formula part of the way through, we need a way to write a piecewise function as a single algebraic expression so the Laplace transform can solve the differential equation in one pass.
1
Writing Piecewise Functions with Step Switches
A unit step function is a mathematical switch that sits at 0 until time t=c, then jumps to 1 and stays at 1 forever:
unit step functionu(t−c)={0,1,t<ct≥c
(You might also see this written as uc(t); the subscript c just marks the switch time t=c, not a derivative.)
Multiplying any function by u(t−c) keeps it at 0 before t=c and turns it on from t=c onward.
Writing Piecewise Functions with Step Switches
To rewrite a piecewise function like the ramp that levels off at t=2,
f(t)={t,2,0≤t<2t≥2
walk along the timeline from t=0 and add a step switch wherever the formula changes.
Text solution
Start with the rule at t=0Write down the formula that is active at the beginning of the timeline.
f(t)=t+…
Flip a switch at t=2 to cancel the old rule and add the new oneMultiply u(t−2) by (−t+2) so the switch subtracts the climbing ramp t and replaces it with the flat value 2.
Before t=2, the switch is 0 so f(t)=t; from t=2 onward, the switch is 1 so f(t)=t−(t−2)=2.
In sin(t)[u(t−3)−u(t−c)], the second switch −u(t−c) cancels the first switch u(t−3) from t=c onward, leaving the sine wave active only in the window between 3 and c.
The first switch stays on forever, so the sine wave only stops when the negative switch turns on and cancels it out.
2
Delayed Functions and the Laplace Transform
Once a force is written with step switches, we want to take its Laplace transform. A delayed function u(t−c)f(t−c) holds f(t) at 0 until t=c and then runs it from the beginning using the elapsed time t−c since the switch flipped.
Delayed Functions and the Laplace Transform
Notice the difference at the switch time t=c:u(t−c)t2 turns on an unshifted parabola that has already climbed to height c2, while u(t−c)(t−c)2 slides the vertex to t=c so the curve starts from height 0 right at the switch.
A switch on its own just uncovers a fixed curve mid-climb, while using elapsed time moves the start of the curve along with the switch.
When the switch and the function are both written in terms of the same elapsed time t−c, the time delay becomes an exponential factor e−cs when we take the Laplace transform:
L{switch at cu(t−c)elapsed time t−cf(t−c)}=e−csF(s)
First, let's take a forward transform where the shift already matches the switch: L{u(t−4)(t−4)3}.
Text solution
Transform the unshifted functionIgnore the shift of 4 first and take the Laplace transform of t3.
L{t3}=s43!=s46
Attach the delay exponentialBecause both factors use t−4, the switch at t=4 multiplies the transform by e−4s.
L{u(t−4)(t−4)3}=e−4ss46
So e−4s records the 4-second wait, while s46 comes from the cubic function t3.
Now going backward, let's find the inverse transform of e−5ss2+91.
Text solution
Invert the fraction without the exponentialSet e−5s aside and find the inverse transform of s2+91.
L−1{s2+91}=31sin(3t)
Turn on the switch and shift t to t−5Multiply by u(t−5) and replace t inside the sine wave with elapsed time t−5.
L−1{e−5ss2+91}=u(t−5)31sin(3(t−5))
This gives a sine wave that stays at 0 until t=5 and starts its first cycle at t=5.
3
Matching the Shift When Functions Aren't Delayed
Often a piecewise force gives a product like u(t−3)t2, where the switch has t−3 but the function has a plain t. To take the Laplace transform L{u(t−c)g(t)}, we rewrite every unshifted t in terms of (t−c) by subtracting and adding c:
t=(t−c)+c
Matching the Shift When Functions Aren't Delayed
L{u(t−3)t2}=?
How we separate the extra +c from (t−c) depends on whether t sits inside a polynomial, an exponential, or a trig function. First, a polynomial: find L{u(t−3)t2}.
Text solution
Replace t with (t−3)+3 and expand in powers of (t−3)Keep parentheses around (t−3) while squaring so (t−3) stays grouped together.
Transform term by term with the delayTurn u(t−3) into e−3s and transform the bracket just like t2+6t+9.
L{u(t−3)t2}=e−3s(s32+s26+s9)
The extra s26 and s9 terms appear because the unshifted parabola t2 is already at height 9 with slope 6 when the switch turns it on at t=3.
Now an exponential: find L{u(t−2)e5t}. Remember that addition in an exponent splits into multiplication out front: ea+b=eaeb.
Text solution
Replace t with (t−2)+2 and split off the constant exponentialDistribute the 5 across both parts of the exponent and factor out the constant number e10.
Transform the shifted exponentialLeave the constant e10 in front and transform u(t−2)e5(t−2).
L{u(t−2)e5t}=e10e−2ss−51
Here e10 is just a constant multiplier, while e−2s marks the switch at t=2.
Now a trig function: find L{u(t−6π)cos(2t)}. When the shift is a half-period like π, you can see it directly from the wave: shifting a sine wave by π flips it upside down, so sin((t−π)+π)=−sin(t−π), which gives L{u(t−π)sin(t)}=−e−πss2+11 right away. For any other angle (or if you aren't sure which way the wave flips), split the constant angle B away from the shifted angle A using the angle-addition identities:
Splitting the angle rewrites the single unshifted cosine as a combination of a shifted cosine and a shifted sine that both start at t=6π.
4
Solving a Piecewise Initial Value Problem
Now we can solve an initial value problem driven by a piecewise force in a single pass:
y′′+yf(t)=f(t),y(0)=1,y′(0)=0,={t,1,0≤t<1t≥1
Remember how the second derivative transforms using the initial values at t=0:
L{y′′}=s2Y(s)−sy(0)−y′(0)
Solving a Piecewise Initial Value Problem
Text solution
Rewrite the piecewise force using a step switchStart with the ramp t at t=0, and at t=1 add u(t−1) times (1−t) to cancel t and level off at 1.
y′′+y=t+u(t−1)(1−t)=t−u(t−1)(t−1)
Take the Laplace transform and solve for Y(s)Plug in y(0)=1 and y′(0)=0, and keep the initial-condition fraction and the e−s term separate when dividing by s2+1.
Invert term by termTransform the unshifted fractions back to t, and for the e−s term, turn on u(t−1) and shift every t inside the bracket to t−1.
y(t)=cos(t)+t−sin(t)−u(t−1)[(t−1)−sin(t−1)]
Before t=1, the switch is 0 and the spring oscillates around the climbing ramp t; from t=1 onward, the switch is 1 and t−(t−1)=1 holds the center of oscillation at height 1 while starting a new wave sin(t−1) at t=1.
When the ramp force f(t) levels off, the delayed term in y(t) cancels the upward climb and smoothly shifts the spring's oscillation to center around the new flat force, with no jump in position or velocity.
Wherever the ramp force levels off, the delayed term turns on at the corner to cancel the upward climb, so the spring’s motion continues smoothly around the new flat level.
Key concepts
To solve a piecewise problem with Laplace transforms, walk the timeline from t=0. Write the starting rule, and at each switch time t=c, add u(t−c)(new rule−old rule). For example, a ramp t that levels off at 2 when t=2 becomes t+u(t−2)(2−t)=t−u(t−2)(t−2). Before doing any algebra, check whether the function next to u(t−c) is already written in terms of t−c. If it already matches, like u(t−4)(t−4)3 or u(t−2)(t−2), don't expand or substitute. Just transform it directly with
L{u(t−c)f(t−c)}=e−csF(s).
If you have an unshifted t next to u(t−c), substitute t=(t−c)+c. Keep (t−c) grouped in parentheses while you expand powers (like ((t−3)+3)2), factor out a constant exponential (like e5((t−2)+2)=e10e5(t−2)), or split a trig angle using angle addition (like cos(2(t−6π)+3π)). Finally, when solving for Y(s) and inverting, keep each e−cs factored out in front while you do partial fractions on F(s). Then turn e−csF(s) back into u(t−c)f(t−c) by replacing every t in f(t) with t−c, like e−5ss2+91→u(t−5)31sin(3(t−5)).
5
Practice
1
Write the piecewise function as a single expression using unit step functions: f(t)=4 for 0≤t<1,f(t)=2t+2 for 1≤t<4, and f(t)=0 for t≥4.
Start with the rule at t=0; at t=1 and t=4, what is the old rule currently active on the timeline that you need to subtract, and what is the new rule you need to add?
(Watch out: At t=4, you must subtract the full active rule 2t+2, not the simplified bracket 2t−2 from the previous switch. Subtracting 2t−2 would leave f(t)=4 instead of 0 for t≥4. Similarly, forgetting to subtract the old rule 4 at t=1 gives the wrong expression 4+u(t−1)(2t+2)−u(t−4)(2t+2).)
Answerf(t)=4+u(t−1)(2t−2)−u(t−4)(2t+2)
2
Find the inverse Laplace transform of F(s)=s(s+2)2e−3s+s2+4se−5s.
Factor e−3s and e−5s out in front of their fractions first; how does s(s+2)2 split into partial fractions before you apply the shifts?
Split the fraction and invert without the exponentials
Apply the time shifts at t=3 and t=5(Watch out: When e−cs turns into u(t−c), remember to replace t with (t−c) inside the functions. Leaving t unshifted gives the wrong answer u(t−3)[1−e−2t]+u(t−5)cos(2t), and failing to put parentheses around (t−5) inside cos(2t) gives cos(2t−5) instead of cos(2(t−5)).)
f(t)=u(t−3)[1−e−2(t−3)]+u(t−5)cos(2(t−5))
Answerf(t)=u(t−3)[1−e−2(t−3)]+u(t−5)cos(2(t−5))
3
Find the Laplace transform of f(t)=u(t−2)(t2+1).
Does t2+1 match the switch u(t−2)? Substitute t=(t−2)+2 and expand in powers of (t−2) before transforming.
Rewrite t as (t−2)+2 and expand(Watch out: Don't transform t2+1 directly or just swap t for t−2 to write (t−2)2+1. Doing that misses the middle term 4(t−2) and the +4 from squaring, which leads to the wrong answer e−2s(s32+s1).)
Replace t in the exponent with (t−3)+3 and distribute the −2; which part of the exponential splits off as a constant number?
Match the shift in the exponent(Watch out: Transforming e−2t without shifting t drops the constant factor e−6 and gives the wrong answer s+2e−3s; also be sure to distribute −2 to +3, or you'll get e3 instead of e−6.)
Find the Laplace transform of f(t)=u(t−3π)sin(t).
Rewrite sin(t) as sin((t−3π)+3π); which angle-addition identity splits (t−3π) from 3π?
Rewrite t and expand with sine angle addition(Watch out: Treating sin(t) as if it were already delayed to sin(t−3π) gives the wrong answer s2+1e−(π/3)s, and swapping cos(3π)=21 with sin(3π)=23 swaps the coefficients on the two fractions.)
(Watch out: Don't forget to shift t inside cos(t) to t−π and t−2π when inverting the two delayed terms. Leaving cos(t) unshifted gives the wrong answer sin(t)+2u(t−π)[1−cos(t)]−2u(t−2π)[1−cos(t)].)
Solve the initial value problem y′′+4y=f(t),y(0)=0,y′(0)=0, where f(t)=t for 0≤t<2 and f(t)=0 for t≥2.
When you write f(t)=t−u(t−2)t, does the t next to u(t−2) match the switch? Rewrite that t as (t−2)+2 before you take the Laplace transform.
Rewrite the piecewise force and match the shift at t=2(Watch out: Because f(t) drops to 0 at t=2 instead of leveling off at 2, the switch term is −u(t−2)t, not −u(t−2)(t−2). Treating it as −u(t−2)(t−2) drops the +2 from t=(t−2)+2 and gives the wrong answer 41t−81sin(2t)−u(t−2)[41(t−2)−81sin(2(t−2))].)