Step Functions; and Laplace Transforms of Piecewise Continuous Functions The present objective is to use the Laplace transform to solve differential equations with piecewise continuous forcing functions (that is, forcing functions that contain discontinuities). Before that could be done, we need to learn how to find the Laplace transforms of piecewise continuous functions, and how to find their inverse transforms. Our starting point is to study how a piecewise continuous function can be constructed using step functions. Then we will see how the Laplace transform and its inverse interact with the said construct. Step Functions Definition: The unit step function (or Heaviside function), is defined by 0, u c (t ) = 1, t<c t≥c , c ≥ 0. Often the unit step function uc(t) is also denoted as u(t − c), Hc(t), or H(t − c). The step could also be made backward, stepping down from 1 to 0 at t = c. This complement function is 1, 1 − u c (t ) = 0, © 2008 Zachary S Tseng t<c t≥c , c ≥ 0. C-2 - 1 The Laplace transform of the unit step function is e − cs L{uc(t)} = s s > 0, , c≥0 Notice that when c = 0, u0(t) has the same Laplace transform as the constant function f (t) = 1. (Why?) Therefore, for our purpose, u0(t) = 1. (Keep in mind that a Laplace transform is only defined for t ≥ 0.) Note: The calculation of L{uc(t)} goes as follow (given that c ≥ 0): L{uc(t)} = ∫ ∞ 0 u c (t ) e − st −1 e − cs − cs = 0−e = s s ( © 2008 Zachary S Tseng ) ∞ dt = ∫ 1 ⋅ e − st dt = c , − 1 − st e s ∞ c s > 0. C-2 - 2 The unit step function is much more useful than it first appears to be. When put in a product with a second function, the unit step function acts like a switch to turn the other function on or off: 0, uc (t ) f (t ) = f (t ), f (t ), (1 − uc (t )) f (t ) = 0, t<c t≥c, (an “on” switch) t<c t ≥ c, (an “off” switch). By combining two unit step functions, we can also selectively make a function appears only for a finite duration, then it disappears. That is, the function is switched “on” at a, then is switched “off” at a later time b. 0, (u a (t ) − ub (t )) f (t ) = f (t ), 0, t<a a≤t <b , t ≥b where 0 ≤ a < b. We could think this combination as an “on-off” toggle switch that controls the appearance of the second function f (t). In other words, it creates a “window” which we can peek into to see another function f(t) hiding behind. Therefore, the expression ua(t) − ub(t) is commonly called a window function, or a “boxcar” function. By cascading the above types of products, we can now write any piecewisedefined function in a succinct form in terms of unit step functions. © 2008 Zachary S Tseng C-2 - 3 Suppose f1 (t ), f (t ), 2 F (t ) = f 3 (t ), : f n (t ), t<a a≤t <b b≤t <c . : t≥d Then, we can rewrite F(t), succinctly, as F(t) = (1 − ua(t)) f1(t) + (ua(t) − ub(t)) f2(t) + (ub(t) − uc(t)) f3(t) + … + ud(t) fn(t). Example: 3t 2 − 2, F (t ) = e 5t + t , cos( 2t ), t<4 4≤ t <9 t ≥9 . Then, F(t) = (1 − u4(t)) (3t2 − 2) + (u4(t) − u9(t)) (e5t + t) + u9(t) cos(2t). © 2008 Zachary S Tseng C-2 - 4 The difference between uc(t) f (t) and uc(t) f (t − c) Example: uπ/2 (t) sin(t) and uπ/2 (t) sin(t − π/2) Fig. Graph of : uπ/2 (t) sin(t) Fig. Graph of : uπ/2 (t) sin(t − π/2) © 2008 Zachary S Tseng C-2 - 5 Laplace transform and translations: time and frequency shifts Arguably the most important formula for this class, it is usually called the Second Translation Theorem (or the Second Shift Theorem), defining the time shift property of the Laplace transform: Theorem: If F(s) = L{f (t)}, and if c is any positive constant, then L{uc(t) f (t − c)} = e−cs L{f (t)} = e−cs F(s). Note: Equivalently, L{uc(t) g(t)} = e−cs L{g(t + c)}.* Conversely, if f (t) = L −1 {F(s)}, then uc(t) f (t − c) = L −1{e−cs F(s)}. 5e −2 s Example: Find the inverse transform of F ( s ) = s + 10 . 5 = e−2s L{5e−10t}, therefore, s + 10 −2 s Since F ( s ) = e −10t c = 2 and f (t) = 5e . Apply the above theorem and we have L −1{F(s)} = u2(t)(5e−10(t − 2)) = 5u2(t) e−10(t − 2). * This equivalent formula is more explicit about what needs to be done when transforming a product containing a unit step function. It tells you to translate the function, t → t + c, before transform the function. Remember, when transforming a product containing a step function: “translate before transform”! © 2008 Zachary S Tseng C-2 - 6 Example: Find the Laplace transforms of uπ/2 (t) sin(t) and uπ/2 (t) sin(t − π/2). L{uπ/2 (t) sin(t)} = e−πs/2 L{sin(t + π/2)} = e−πs/2 L{cos(t)} s −πs / 2 =e . s2 +1 (Recall the addition formula of sine: sin(α ± β ) = sin(α ) cos( β ) ± cos(α ) sin( β ) ) L{uπ/2 (t) sin(t − π/2)} = e− πs/2 F(s) = e− πs/2 L{sin(t)} 1 −πs / 2 = e . s2 + 1 7t Example: Find the Laplace transform of u2(t) e . L{u2(t) e7t} = e−2s L{e7(t + 2)} = e−2s L{e7t + 14} = e−2s e14L{e7t} 1 e −2 s +14 − 2 s 14 = =e e . s−7 s−7 2 Example: Find the Laplace transform of u1(t) (t + 3t + 2). L{u1(t) (t2 + 3t + 2)} = e−1s L{(t + 1)2 + 3(t + 1) + 2} = e−s L{(t2 + 2t +1) + (3t +3) + 2} = e−s L{t2 + 5t + 6} 1 1 −s 2 5 6 −s 2 e + 5 + 6 =e 3 + 2 + = 3 2 s s s s s s © 2008 Zachary S Tseng C-2 - 7 Example: Find the Laplace transform of 3t 2 − 2, F (t ) = e 5t + t , cos( 2t ), t<4 4≤ t <9 t ≥9 . We have seen earlier that: F(t) = (1 − u4(t)) (3t2 − 2) + (u4(t) − u9(t)) (e5t + t) + u9(t) cos(2t) = (3t2 − 2) + u4(t)(e5t + t − 3t2 + 2) + u9(t)(cos(2t) − e5t − t). Transform the last expression above, applying, where appropriate, the −cs formula L{uc(t) g(t)} = e L{g(t + c)}: L{F(t)} = L{3t2 − 2} + e−4s L{e5(t + 4) + (t + 4) − 3(t + 4)2 + 2} + e−9s L{cos2(t + 9) − e5(t + 9) − (t + 9)} = L{3t2 − 2} + e−4s L{e5t + 20 + (t + 4) − 3(t2 + 8t + 16) + 2} + e−9s L{cos(2t + 18) − e5t + 45 − t − 9} = L{3t2 − 2} + e−4s L{e20e5t − 3t2 − 23t − 42} + e−9s L{cos(2t)cos(18) − sin(2t)sin(18) − e45e5t − t − 9} 6 2 −4 s e 20 6 23 42 = 3 − + e − 3 − 2 − + s s s s s −5 s e −9 s s 2 e 45 1 9 cos(18) 2 − sin(18) 2 − − 2 − s +4 s + 4 s −5 s s © 2008 Zachary S Tseng C-2 - 8 As a parallel to the time shift property, Laplace transform also has the frequency shift property: Theorem: If F(s) = L{f (t)}, and if c is any positive constant, then L{e ct f (t)} = F(s − c). Conversely, if f (t) = L −1 {F(s)}, then e ct f (t) = L −1 {F(s − c)}. Therefore, in the world of Laplace transforms, translations are enacted by the multiplication with exponential functions. This theorem is usually called the First Translation Theorem or the First Shift Theorem. b s , 2 2 and L{sin bt} = s + b2 s +b then, letting c = a and replace s by s − c = s − a: Example: Because L{cos bt} = 2 s−a L{e cos bt} = ( s − a ) 2 + b 2 and b at L{e sin bt} = (s − a) 2 + b 2 . at n! Similarly, since L{t } = n+1 , therefore, s n n! L{t n e at} = ( s − a ) n +1 . © 2008 Zachary S Tseng C-2 - 9 Differential Equations with Discontinuous Forcing Functions We are now ready to tackle linear differential equations whose right-hand side is piecewise continuous. As mentioned before, the method of Laplace transforms works the same way to solve all types of linear equations. Therefore, the same steps seen previously apply here as well. y″ + 4y = F(t), Example: where 0, F (t ) = 1, y(0) = 0, y′(0) = 2, t <π t ≥π . The require equation is y″ + 4y = uπ(t). Transform the equation and simplify, we have (s2 L{y} − s y(0) − y′(0)) + 4L{y} = L{uπ(t)} − πs e (s2 L{y} − 2) + 4L{y} = (s2 +4)L{y} − 2 = s e −πs 2 + L{y} = s ( s 2 + 4) s 2 + 4 The second part can be inverted directly into sin(2t). −πs The first part can be inverted by first setting aside e and then use partial fractions to simplify © 2008 Zachary S Tseng 1 11 1 s = − s ( s 2 + 4) 4 s 4 s 2 + 4 . C-2 - 10 1 1 − cos( 2t ) . It has as an inverse transform 4 4 1 1 −πs Hence, the first part is really e L{ − cos(2t ) }. It is inverted, 4 4 via the formula e−cs L{f (t)} → uc(t) f (t − c), with c = π, to 1 1 1 uπ (t ) − cos 2(t − π ) = uπ (t )(1 − cos( 2t − 2π ) ) . 4 4 4 Therefore, the solution is the sum of the 2 parts: t <π sin( 2t ), 1 y = sin( 2t ) + uπ (t )(1 − cos( 2t ) ) = 1 1 sin( 2 t ) + − cos( 2t ), t ≥ π 4 4 4 Note: cos(2t − 2π) = cos(2t) © 2008 Zachary S Tseng C-2 - 11 y″ + 9y = cos(2t) − u4π(t) cos(2t), Example: y(0) = 0, y′(0) = 0. Transform and simplify: (s2 L{y} − s y(0) − y′(0)) + 9L{y} = L{cos(2t) − u4π(t) cos(2t)} s s − 4 πs − e (s L{y} − 0) + 9L{y} = (s +9)L{y} = 2 s +4 s2 + 4 2 2 Note: e L{u4π(t) cos(2t)} = e−4πs L{cos(2(t + 4π))} = −4πs L{cos(2t + 8π)} = e −4πs s − 4 πs e L{cos(2t)} = s2 + 4 Therefore, s s − 4πs − e L{y} = ( s 2 + 4)( s 2 + 9) ( s 2 + 4)( s 2 + 9) Use partial fractions to simplify the first part: s 1 s 1 s = − ( s 2 + 4)( s 2 + 9) 5 s 2 + 4 5 s 2 + 9 . It has an inverse transform © 2008 Zachary S Tseng 1 (cos(2t ) − cos(3t ) ) . 5 C-2 - 12 The second half consists of the negative of the same expression, with 4πs an additional term of −e− . The extra term will induce the step function u4π ( t ), and the translation that changes t into t − 4π. Hence, the second part is inverted to 1 − u 4π (t )(cos( 2(t − 4π )) − cos( 3(t − 4π ) ) . 5 Summing up the 2 parts, the solution is, therefore, 1 (cos( 2t ) − cos(3t ) ) − 1 u 4π (t )(cos 2(t − 4π ) − cos 3(t − 4π ) ) 5 5 1 (cos( 2t ) − cos(3t ) ), t < 4π = 5 0, t ≥ 4π y= © 2008 Zachary S Tseng C-2 - 13 y″ + 6y′ + 5y = u5(t), Example: y(0) = 1, y′(0) = 1 Transform and simplify: (s2L{y} − s y(0) − y′(0)) + 6(sL{y} − y(0)) + 5L{y} = L{u5(t)} −5 s e (s2 L{y} − s − 1) + 6(sL{y} − 1) + 5L{y} = s −5 s e (s2 + 6s + 5)L{y} − s − 7 = s e −5 s (s + 1)(s + 5)L{y} = s +s+7 Hence, e −5 s s+7 + L{y} = s ( s + 1)( s + 5) ( s + 1)( s + 5) The second half is simpler. It can be broken down by partial fractions into s+7 3 1 1 1 = − ( s + 1)( s + 5) 2 s + 1 2 s + 5 . It has an inverse transform of © 2008 Zachary S Tseng 3 −t 1 −5t e − e . 2 2 C-2 - 14 The first half, without the e−5s term, has partial fractions decomposition of 1 11 1 1 1 1 = − + s ( s + 1)( s + 5) 5 s 4 s + 1 20 s + 5 . It has an inverse transform of 1 1 −t 1 −5 t − e + e . 5 4 20 We then must apply the effects of the e−5s term, namely the introduction of the step function u5( t ), and the translation that changes t into t − 5. Hence, this part really represents 1 −5t + 25 1 1 u5 (t ) − e −t +5 + e . 5 4 20 Combining the two parts, we now have the solution: y= © 2008 Zachary S Tseng 3 −t 1 −5 t 1 1 1 e − e + u5 (t ) − e −t +5 + e −5t + 25 2 2 20 5 4 C-2 - 15 Example: A mass weighing 32 lbs is attached to a spring with spring constant k = 4. The mass is initially at rest in its equilibrium position. At t = 0, an external force of F(t) = cos(2t) is applied to the mass. The force is then abruptly discontinued at t = 2π. There is no damping in the system. Find the displacement function of this mass-spring system. From the problem’s description, we deduce that: m = 1, γ = 0, k = 4, and F(t) = (1 − u2π (t)) cos(2t). Therefore, the initial value problem we need to solve is u″ + 4u = cos(2t) − u2π (t) cos(2t), u(0) = 0, u′(0) = 0. Transform the equation and simplify: (s2L{u} − s u(0) − u′(0)) + 4L{u} = L{cos(2t) − u2π(t) cos(2t)} s s − 2 πs e − (s L{u} − 0) + 4L{u} = (s +4)L{u} = 2 s +4 s2 + 4 2 2 Hence, s s − 2πs − e L{u} = ( s 2 + 4) 2 ( s 2 + 4) 2 . The first part has inverse transform 1 t sin( 2t ) . 4 The second part, via the formula e−2πs L{f (t)} → u2π(t) f (t − 2π) becomes −1 −1 u 2π (t )(t − 2π ) sin 2(t − 2π ) = u 2π (t )(t − 2π ) sin( 2t ) . 4 4 © 2008 Zachary S Tseng C-2 - 16 Therefore, the solution is u (t ) = 1 1 t sin( 2t ) − u 2π (t )(t − 2π ) sin( 2t ) 4 4 1 4 t sin( 2t ), = π sin( 2t ), 2 0 ≤ t < 2π t ≥ 2π . Notice that the system was undergoing resonance until the forcing function was shut off. Then it oscillates at constant amplitude. 2as Note: L{t sin(at)} = 2 (s + a 2 )2 . The graph of the above solution: © 2008 Zachary S Tseng C-2 - 17 Exercises C-2.1: 1. Find (a) L{uπ(t) t2}, (b) L{u4(t) t2 e5t}. 2. Find (a) L{u5π / 6(t) cos 3t}, (b) L{uπ / 2(t) e−t cos 2t}. 3. Find L {u3(t) (t2 − t + 2) e−5t }. 4. Suppose f (t) = sin t + u1(t) − 5u4(t) − 2u5(t) cos t + π u9(t), find f (0), f (π), f (2π), and f (8). 5 – 6 Find each definite integral by (a) integration, and (b) using the properties of Laplace transform. 5. ∫ ∞ 9 e −( s +3) t dt 6. ∫ ∞ 5 t 2 e − st dt 7. Find the Laplace transform of t 2 + t, 0≤t <2 F (t ) = 1 − e −4t , 2≤ t <5 . 0 , 5≤t 8 – 13 Find the inverse Laplace transform of each given F(s). 3s + 22 −4 s 8. F ( s ) = e 2 s + 3s − 10 4 s + 11 −6 s 9. F ( s ) = e s 2 + 6s + 9 3 2 − s 3s + 12 s − 2 s − 3 F ( s ) = e 10. s 4 − 2 s 3 − 3s 2 2 s − 14 −2 s 11. F ( s ) = e 2 s + 2 s + 17 2 −8 s 3s − 10 s + 8 12. F ( s ) = e s 3 + 4s e −c s F ( s ) = 13. ( s + α )( s + β ) © 2008 Zachary S Tseng C-2 - 18 s at 2 , find L {e cosh (b t)}. s −b b 15. Given that L {sinh (b t)} = 2 , find L {t e at sinh (b t)}. s − b2 14. Given that L {cosh (b t)} = 2 16 – 20 Solve each initial value problem. 16. y′ + 6y = 4u2(t) t2, y(0) = 1 17. y″ + 6y′ + 9y = u5(t) e−t, y(0) = 10, y′(0) = 0 18. y″ + 4y′ + 5y = u3(t) − u6(t), y(0) = 0, y′(0) = 4 19. y″ + 5y′ + 4y = u10(t) − 2u20(t), y(0) = 2, y′(0) = 0 20. y″ + 25y = t – t u6(t), y(0) = 0, y′(0) = 3 Answers C-2.1: 2π π 2 −π s 2 F s e ( ) = + 1. (a) s 3 s 2 + s , 2 8 16 − 4 s 20 . + + (b) F ( s ) = e e 3 2 ( s − 5 ) ( s − 5 ) s − 5 s +1 −3 − ( s + 1) π / 2 F ( s ) = − e , (b) . s 2 + 2s + 5 s2 + 9 2 5 8 −3 s −15 + + 3. F ( s ) = e e 3 2 ( s + 5 ) ( s + 5 ) s + 5 4. f (0) = 0, f (π) = 1, f (2π) = −6, f (8) = sin(8) − 2cos(8) − 4. 1 −9 s − 27 5. e , s>0 s+3 − 5π s / 6 2. (a) F ( s ) = e © 2008 Zachary S Tseng C-2 - 19 10 25 −5 s 2 , 6. e 3 + 2 + s s s s>0 −8 2 1 2 5 5 −5 s e −20 1 −2 s e + 3 + 2 + + e − 7. F ( s ) = 3 + 2 − e + 4 + 4 s s s s s s s s 8. f (t) = u4(t)(4e2t − 8 − e−5t + 20 ) 9. f (t) = u6(t)(10 − t) e−3t + 18 10. f (t) = u1(t)( t − 1 − 2e−t + 1 + 5e3t − 3 ) −t +2 cos(4t − 8) − 4e − t + 2 sin( 4t − 8) ) 11. f (t ) = u 2 (t )(2e 12. f (t ) = u8 (t )(2 + cos( 2t − 16) − 5 sin( 2t − 16) ) 13. f (t ) = 1 u c (t )(e −α t + α c − e − β t + β c ) β −α s−a (s − a)2 − b 2 2b ( s − a ) 15. L {t e at sinh (b t)} = (( s − a ) 2 − b 2 ) 2 22 61 61 −6 (t −2 ) 4 −6t 2 (t − 2) + e − 16. y = e + u 2 (t ) (t − 2) + 9 27 27 3 26 73 61 −6t +12 4 = e −6 t + u 2 (t ) t 2 − t + − e 9 27 27 3 14. L {e at cosh (b t)} = 17. y = 10e − 3t + 30te −2t 18. y = 4e sin t + ( −3t e −5 + u5 (t ) e −t +5 + (9 − 2t )e −3t +15 4 ( ( ) 1 u3 (t ) 1 − e −2t +6 cos(t − 3) − 2e −2 t +6 sin(t − 3) 5 ) ) 1 − u6 (t ) 1 − e −2t +12 cos(t − 6) − 2e −2 t +12 sin(t − 6) 5 8 −t 2 − 4 t 1 1 −t +10 1 −4t + 40 + e 19. y = e − e + u10 (t ) − e 3 3 12 4 3 1 1 2 − u 20 (t ) − e −t + 20 + e −4 t +80 6 2 3 1 74 1 1 6 t+ sin 5t + u6 (t ) cos(5t − 30) + sin(5t − 30) + t 20. y = 25 125 125 25 25 © 2008 Zachary S Tseng C-2 - 20