Preface


This tutorial was made solely for the purpose of education and it was designed for students taking Applied Math 0330. It is primarily for students who have very little experience or have never used Mathematica before and would like to learn more of the basics for this computer algebra system. As a friendly reminder, don't forget to clear variables in use and/or the kernel.

Finally, the commands in this tutorial are all written in bold black font, while Mathematica output is in normal font. This means that you can copy and paste all commands into Mathematica, change the parameters and run them. You, as the user, are free to use the scripts for your needs to learn the Mathematica program, and have the right to distribute this tutorial and refer to this tutorial as long as this tutorial is accredited appropriately.

Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to Mathematica tutorial for the second course APMA0340
Return to Mathematica tutorial for the first course APMA0340
Return to the main page for the course APMA0340
Return to the main page for the course APMA0330
Return to Part VI of the course APMA0330

Laplace Transform of Discontinuous Functions


The main advantage of applications of Laplace transformation in differential equations is its easiness dealing with discontinuous functions. Of course, the Laplace transform does not exist for an arbitrary function, but only with those that have finite jumps. The algorithm finding a Laplace transform of an intermittent function consists of two steps:

  1. Rewrite the given piecewise continuous function through shifted Heaviside functions.
  2. Use the shift rule \( {\cal L} \left[ H(t-a)\, f(t-a) \right] = e^{a\lambda}\, {\cal L} \left[ f(t) \right] . \)
We demonstrate this approach in some examples.

Example: Consider a piecewise continuous function

\[ f(t) = \begin{cases} 2, & \quad 0 < t < 1 , \\ t-3, & \quad 1 < t < 3 , \\ t^2 , & \quad t > 3 . \end{cases} \]
We rewrite the given function using our lovely Heaviside function:
\begin{eqnarray*} f(t) &=& 2 \left[ H(t) - H(t-1) \right] + (t-3) \left[ H(t-1) - H(t-3) \right] + t^2 \, H(t-3) \\ &=& 2\, H(t) + (t-5)\, H(t-1) + \left[ t^2 - (t-3) \right] H(t-3) \\ &=& 2\, H(t) + (t-1-4)\, H(t-1) + \left[ (t-3)^2 +5\, (t-3) +9 \right] H(t-3) . \end{eqnarray*}
Now we are ready to apply the shift rule to obtain
\[ {\cal L} \left[ f(t) \right] (\lambda ) = f^L (\lambda ) = \frac{2}{\lambda} \left( \frac{1}{\lambda^2} - \frac{4}{\lambda} \right) e^{-\lambda} + \left( \frac{2}{\lambda^3} + \frac{5}{\lambda^2} + \frac{9}{\lambda} \right) e^{-3\lambda} . \]
We check our answer with Mathematica:
Integrate[2*Exp[-s*t], {t, 0, 1}] + Integrate[(t - 3)*Exp[-s*t], {t, 1, 3}] + Integrate[t^2*Exp[-s*t], {t, 3, Infinity}]

 

Example: Consider another piecewise continuous function

\[ g(t) = \begin{cases} t, & \quad 0 < t < 1 , \\ (t-2)^2, & \quad 1 < t < 2 , \\ 6-t^2 , & \quad t > 2 . \end{cases} \]
We rewrite the given function using our lovely Heaviside function:
\begin{eqnarray*} g(t) &=& t \left[ H(t) - H(t-1) \right] + (t-2)^2 \left[ H(t-1) - H(t-2) \right] + \left( 6 - t^2 \right) H(t-2) \\ &=& t\, H(t) - (t-1+1)\, H(t-1) + \left( t-1-1 \right)^2 H(t-1) - (t-2)^2 H(t-2) + \left[ 6 - (t-2+2)^2 \right] H(t-2) \\ &=& t\, H(t) + \left[ (t-1)^2 -3(t-1)\right] H(t-1) + \left[ 2- 4(t-2) -2 (t-2)^2 \right] H(t-2) . \end{eqnarray*}
Now we are ready to apply the shift rule to obtain
\[ {\cal L} \left[ g(t) \right] (\lambda ) = g^L (\lambda ) = \frac{1}{\lambda^2} + \left( \frac{2}{\lambda^3} - \frac{3}{\lambda^2} \right) e^{-\lambda} + \left( \frac{2}{\lambda} - \frac{4}{\lambda^2} - \frac{4}{\lambda^3} \right) e^{-3\lambda} . \]
We check our answer with Mathematica:
g[t_] = Piecewise[{{t, 0 < t < 1}, {(t - 2)^2, 1 < t < 2}, {6 - t^2, 2 < t}}]
LaplaceTransform[g[t], t, lambda]
Out[14]= (1/(lambda^3))E^(-2 lambda) (-4 - 4 lambda - E^lambda lambda + E^(2 lambda) lambda + 2 lambda^2 - E^lambda lambda^2 + Gamma[3, -lambda])
Or integrate directly:
Integrate[t*Exp[-s*t], {t, 0, 1}] + Integrate[(t - 2)^2 *Exp[-s*t], {t, 1, 2}] + Integrate[(6 - t^2)*Exp[-s*t], {t, 2, Infinity}]
Simplify[%]
ConditionalExpression[( E^(-2 s) (E^s (2 - 3 s) + E^(2 s) s + 2 (-2 - 2 s + s^2)))/s^3, Re[s] > 0]

Mathematica handles the Shift Rule:

LaplaceTransform[UnitStep[t - 2]*Sin[t], t, lambda]
Out[5]= (E^(-2 lambda) (Cos[2] + lambda Sin[2]))/(1 + lambda^2)
LaplaceTransform[UnitStep[t - 2]*Sin[t - 2], t, lambda]
Out[6]= E^(-2 lambda)/(1 + lambda^2)
LaplaceTransform[DiracDelta[t - 2]*Sin[t - 2], t, lambda]
Out[7]= 0
LaplaceTransform[DiracDelta[t - 2]*Sin[t], t, lambda]
Out[8]= E^(-2 lambda) Sin[2]