Paul's Online Notes
Paul's Online Notes
Home / Differential Equations / Laplace Transforms / IVP's With Step Functions
Show Mobile Notice Show All Notes Hide All Notes
Mobile Notice
You appear to be on a device with a "narrow" screen width (i.e. you are probably on a mobile phone). Due to the nature of the mathematics on this site it is best viewed in landscape mode. If your device is not in landscape mode many of the equations will run off the side of your device (you should be able to scroll/swipe to see them) and some of the menu items will be cut off due to the narrow screen width.

Section 4.7 : IVP's With Step Functions

In this section we will use Laplace transforms to solve IVP’s which contain Heaviside functions in the forcing function. This is where Laplace transform really starts to come into its own as a solution method.

To work these problems we’ll just need to remember the following two formulas,

\[\begin{align*}\mathcal{L}\left\{ {{u_c}\left( t \right)f\left( {t - c} \right)} \right\} & = {{\bf{e}}^{ - c\,s}}F\left( s \right) & & {\mbox{where }}F\left( s \right) = \mathcal{L}\left\{ {f\left( t \right)} \right\}\\ {\mathcal{L}^{\, - 1}}\left\{ {{{\bf{e}}^{ - c\,s}}F\left( s \right)} \right\} & = {u_c}\left( t \right)f\left( {t - c} \right) & & {\mbox{where }}f\left( t \right) = {\mathcal{L}^{\, - 1}}\left\{ {F\left( s \right)} \right\}\end{align*}\]

In other words, we will always need to remember that in order to take the transform of a function that involves a Heaviside we’ve got to make sure the function has been properly shifted.

Let’s work an example.

Example 1 Solve the following IVP. \[y'' - y' + 5y = 4 + {u_2}\left( t \right){{\bf{e}}^{4 - 2t}},\hspace{0.25in}y\left( 0 \right) = 2\,\,\,\,\,\,\,\,y'\left( 0 \right) = - 1\]
Show Solution

First let’s rewrite the forcing function to make sure that it’s being shifted correctly and to identify the function that is actually being shifted.

\[y'' - y' + 5y = 4 + {u_2}\left( t \right){{\bf{e}}^{ - 2\left( {t - 2} \right)}}\]

So, it is being shifted correctly and the function that is being shifted is \({{\bf{e}}^{ - 2t}}\). Taking the Laplace transform of everything and plugging in the initial conditions gives,

\[\begin{align*}{s^2}Y\left( s \right) - sy\left( 0 \right) - y'\left( 0 \right) - \left( {sY\left( s \right) - y\left( 0 \right)} \right) + 5Y\left( s \right) & = \frac{4}{s} + \frac{{{{\bf{e}}^{ - 2s}}}}{{s + 2}}\\ \left( {{s^2} - s + 5} \right)Y\left( s \right) - 2s + 3 & = \frac{4}{s} + \frac{{{{\bf{e}}^{ - 2s}}}}{{s + 2}}\end{align*}\]

Now solve for \(Y(s)\).

\[\begin{align*}\left( {{s^2} - s + 5} \right)Y\left( s \right) & = \frac{4}{s} + \frac{{{{\bf{e}}^{ - 2s}}}}{{s + 2}} + 2s - 3\\ \left( {{s^2} - s + 5} \right)Y\left( s \right) & = \frac{{2{s^2} - 3s + 4}}{s} + \frac{{{{\bf{e}}^{ - 2s}}}}{{s + 2}}\\ Y\left( s \right) & = \frac{{2{s^2} - 3s + 4}}{{s\left( {{s^2} - s + 5} \right)}} + {{\bf{e}}^{ - 2s}}\frac{1}{{\left( {s + 2} \right)\left( {{s^2} - s + 5} \right)}}\\ Y\left( s \right) & = F\left( s \right) + {{\bf{e}}^{ - 2s}}G\left( s \right)\end{align*}\]

Notice that we combined a couple of terms to simplify things a little. Now we need to partial fraction \(F(s)\) and \(G(s)\). We’ll leave it to you to check the details of the partial fractions.

\[\begin{align*}F\left( s \right) & = \frac{{2{s^2} - 3s + 4}}{{s\left( {{s^2} - s + 5} \right)}} = \frac{1}{5}\left( {\frac{4}{s} + \frac{{6s - 11}}{{{s^2} - s + 5}}} \right)\\ G\left( s \right) & = \frac{1}{{\left( {s + 2} \right)\left( {{s^2} - s + 5} \right)}} = \frac{1}{{11}}\left( {\frac{1}{{s + 2}} - \frac{{s - 3}}{{{s^2} - s + 5}}} \right)\end{align*}\]

We now need to do the inverse transforms on each of these. We’ll start with \(F(s)\).

\[\begin{align*}F\left( s \right) & = \frac{1}{5}\left( {\frac{4}{s} + \frac{{6\left( {s - \frac{1}{2} + \frac{1}{2}} \right) - 11}}{{{{\left( {s - \frac{1}{2}} \right)}^2} + \frac{{19}}{4}}}} \right)\\ & = \frac{1}{5}\left( {\frac{4}{s} + \frac{{6\left( {s - \frac{1}{2}} \right)}}{{{{\left( {s - \frac{1}{2}} \right)}^2} + \frac{{19}}{4}}} - \frac{{8\frac{{\sqrt {19} }}{2}\frac{2}{{\sqrt {19} }}}}{{{{\left( {s - \frac{1}{2}} \right)}^2} + \frac{{19}}{4}}}} \right)\\ f\left( t \right) & = \frac{1}{5}\left( {4 + 6{{\bf{e}}^{\frac{t}{2}}}\cos \left( {\frac{{\sqrt {19} }}{2}t} \right) - \frac{{16}}{{\sqrt {19} }}{{\bf{e}}^{\frac{t}{2}}}\sin \left( {\frac{{\sqrt {19} }}{2}t} \right)} \right)\end{align*}\]

Now \(G(s)\).

\[\begin{align*}G\left( s \right) & = \frac{1}{{11}}\left( {\frac{1}{{s + 2}} - \frac{{s - \frac{1}{2} + \frac{1}{2} - 3}}{{{{\left( {s - \frac{1}{2}} \right)}^2} + \frac{{19}}{4}}}} \right)\\ & = \frac{1}{{11}}\left( {\frac{1}{{s + 2}} - \frac{{s - \frac{1}{2}}}{{{{\left( {s - \frac{1}{2}} \right)}^2} + \frac{{19}}{4}}} + \frac{{\frac{5}{2}\frac{{\sqrt {19} }}{{\sqrt {19} }}}}{{{{\left( {s - \frac{1}{2}} \right)}^2} + \frac{{19}}{4}}}} \right)\\ g\left( t \right) & = \frac{1}{{11}}\left( {{{\bf{e}}^{ - 2t}} - {{\bf{e}}^{\frac{t}{2}}}\cos \left( {\frac{{\sqrt {19} }}{2}t} \right) + \frac{5}{{\sqrt {19} }}{{\bf{e}}^{\frac{t}{2}}}\sin \left( {\frac{{\sqrt {19} }}{2}t} \right)} \right)\end{align*}\]

Okay, we can now get the solution to the differential equation. Starting with the transform we get,

\[\begin{align*}Y\left( s \right) & = F\left( s \right) + {{\bf{e}}^{ - 2s}}G\left( s \right)\\ y\left( t \right) & = f\left( t \right) + {u_2}\left( t \right)g\left( {t - 2} \right)\end{align*}\]

where \(f(t)\) and \(g(t)\) are the functions shown above.

There can be a fair amount of work involved in solving differential equations that involve Heaviside functions.

Let’s take a look at another example or two.

Example 2 Solve the following IVP. \[y'' - y' = \cos \left( {2t} \right) + \cos \left( {2t - 12} \right){u_6}\left( t \right)\quad \quad y\left( 0 \right) = - 4,\;y'\left( 0 \right) = 0\]
Show Solution

Let’s rewrite the differential equation so we can identify the function that is actually being shifted.

\[y'' - y' = \cos \left( {2t} \right) + \cos \left( {2\left( {t - 6} \right)} \right){u_6}\left( t \right)\]

So, the function that is being shifted is \(\cos \left( {2t} \right)\) and it is being shifted correctly. Taking the Laplace transform of everything and plugging in the initial conditions gives,

\[\begin{align*}{s^2}Y\left( s \right) - sy\left( 0 \right) - y'\left( 0 \right) - \left( {sY\left( s \right) - y\left( 0 \right)} \right) & = \frac{s}{{{s^2} + 4}} + \frac{{s{{\bf{e}}^{ - 6s}}}}{{{s^2} + 4}}\\ \left( {{s^2} - s} \right)Y\left( s \right) + 4s - 4 & = \frac{s}{{{s^2} + 4}} + \frac{{s{{\bf{e}}^{ - 6s}}}}{{{s^2} + 4}}\end{align*}\]

Now solve for \(Y(s)\).

\[\begin{align*}\left( {{s^2} - s} \right)Y\left( s \right) & = \frac{{s + s{{\bf{e}}^{ - 6s}}}}{{{s^2} + 4}} - 4s + 4\\ Y\left( s \right) & = \frac{{s\left( {1 + {{\bf{e}}^{ - 6s}}} \right)}}{{s\left( {s - 1} \right)\left( {{s^2} + 4} \right)}} - 4\frac{{s - 1}}{{s\left( {s - 1} \right)}}\\ & = \frac{{1 + {{\bf{e}}^{ - 6s}}}}{{\left( {s - 1} \right)\left( {{s^2} + 4} \right)}} - \frac{4}{s}\\ Y\left( s \right) & = \left( {1 + {{\bf{e}}^{ - 6s}}} \right)F\left( s \right) - \frac{4}{s}\end{align*}\]

Notice that we combined the first two terms to simplify things a little. Also, there was some canceling going on in this one. Do not expect that to happen on a regular basis. We now need to partial fraction \(F(s)\). We’ll leave the details to you to check.

\[\begin{align*}F\left( s \right) & = \frac{1}{{\left( {s - 1} \right)\left( {{s^2} + 4} \right)}} = \frac{1}{5}\left( {\frac{1}{{s - 1}} - \frac{{s + 1}}{{{s^2} + 4}}} \right)\\ f\left( t \right) & = \frac{1}{5}\left( {{{\bf{e}}^t} - \cos \left( {2t} \right) - \frac{1}{2}\sin \left( {2t} \right)} \right)\end{align*}\]

Okay, we can now get the solution to the differential equation. Starting with the transform we get,

\[\begin{align*}Y\left( s \right) & = F\left( s \right) + F\left( s \right){{\bf{e}}^{ - 6s}} - \frac{4}{s}\\ y\left( t \right) & = f\left( t \right) + {u_6}\left( t \right)f\left( {t - 6} \right) - 4\end{align*}\]

where \(f(t)\) is given above.

Example 3 Solve the following IVP. \[y'' - 5y' - 14y = 9 + {u_3}\left( t \right) + 4\left( {t - 1} \right){u_1}\left( t \right)\quad \quad y\left( 0 \right) = 0,\;y'\left( 0 \right) = 10\]
Show Solution

Let’s take the Laplace transform of everything and note that in the third term we are shifting 4\(t\).

\[\begin{align*}{s^2}Y\left( s \right) - sy\left( 0 \right) - y'\left( 0 \right) - 5\left( {sY\left( s \right) - y\left( 0 \right)} \right) - 14Y\left( s \right) & = \frac{9}{s} + \frac{{{{\bf{e}}^{ - 3s}}}}{s} + 4\frac{{{{\bf{e}}^{ - s}}}}{{{s^2}}}\\ \left( {{s^2} - 5s - 14} \right)Y\left( s \right) - 10 & = \frac{{9 + {{\bf{e}}^{ - 3s}}}}{s} + 4\frac{{{{\bf{e}}^{ - s}}}}{{{s^2}}}\end{align*}\]

Now solve for \(Y(s)\).

\[\begin{align*}\left( {{s^2} - 5s - 14} \right)Y\left( s \right) - 10 & = \frac{{9 + {{\bf{e}}^{ - 3s}}}}{s} + 4\frac{{{{\bf{e}}^{ - s}}}}{{{s^2}}}\\ Y\left( s \right) & = \frac{{9 + {{\bf{e}}^{ - 3s}}}}{{s\left( {s - 7} \right)\left( {s + 2} \right)}} + \frac{{4{{\bf{e}}^{ - s}}}}{{{s^2}\left( {s - 7} \right)\left( {s + 2} \right)}} + \frac{{10}}{{\left( {s - 7} \right)\left( {s + 2} \right)}}\\ Y\left( s \right) & = \left( {9 + {{\bf{e}}^{ - 3s}}} \right)F\left( s \right) + 4{{\bf{e}}^{ - s}}G\left( s \right) + H\left( s \right)\end{align*}\]

So, we have three functions that we’ll need to partial fraction for this problem. I’ll leave it to you to check the details.

\[\begin{align*}F\left( s \right) & = \frac{1}{{s\left( {s - 7} \right)\left( {s + 2} \right)}} = - \frac{1}{{14}}\frac{1}{s} + \frac{1}{{63}}\frac{1}{{s - 7}} + \frac{1}{{18}}\frac{1}{{s + 2}}\\ f\left( t \right) & = - \frac{1}{{14}} + \frac{1}{{63}}{{\bf{e}}^{7t}} + \frac{1}{{18}}{{\bf{e}}^{ - 2t}}\end{align*}\] \[\begin{align*}G\left( s \right) & = \frac{1}{{{s^2}\left( {s - 7} \right)\left( {s + 2} \right)}} = \frac{5}{{196}}\frac{1}{s} - \frac{1}{{14}}\frac{1}{{{s^2}}} + \frac{1}{{441}}\frac{1}{{s - 7}} - \frac{1}{{36}}\frac{1}{{s + 2}}\\ g\left( t \right) & = \frac{5}{{196}} - \frac{1}{{14}}t + \frac{1}{{441}}{{\bf{e}}^{7t}} - \frac{1}{{36}}{{\bf{e}}^{ - 2t}}\end{align*}\] \[\begin{align*}H\left( s \right) & = \frac{{10}}{{\left( {s - 7} \right)\left( {s + 2} \right)}} = \frac{{10}}{9}\frac{1}{{s - 7}} - \frac{{10}}{9}\frac{1}{{s + 2}}\\ h\left( t \right) & = \frac{{10}}{9}{{\bf{e}}^{7t}} - \frac{{10}}{9}{{\bf{e}}^{ - 2t}}\end{align*}\]

Okay, we can now get the solution to the differential equation. Starting with the transform we get,

\[\begin{align*}Y\left( s \right) & = 9F\left( s \right) + {{\bf{e}}^{ - 3s}}F\left( s \right) + 4{{\bf{e}}^{ - s}}G\left( s \right) + H\left( s \right)\\ y\left( t \right) & = 9f\left( t \right) + {u_3}\left( t \right)f\left( {t - 3} \right) + 4{u_1}\left( t \right)g\left( {t - 1} \right) + h\left( t \right)\end{align*}\]

where \(f(t)\), \(g(t)\) and \(h(t)\) are given above.

Let’s work one more example.

Example 4 Solve the following IVP. \[y'' + 3y' + 2y = g\left( t \right),\hspace{0.25in}y\left( 0 \right) = 0\,\,\,\,\,\,\,\,y'\left( 0 \right) = - 2\]

where,

\[g\left( t \right) = \left\{ {\begin{array}{*{20}{l}}2&{\hspace{0.25in}t < 6}\\t&{\hspace{0.25in}6 \le t < 10}\\4&{\hspace{0.25in}t \ge 10}\end{array}} \right.\]
Show Solution

The first step is to get \(g(t)\) written in terms of Heaviside functions so that we can take the transform.

\[g\left( t \right) = 2 + \left( {t - 2} \right){u_6}\left( t \right) + \left( {4 - t} \right){u_{10}}\left( t \right)\]

Now, while this is \(g(t)\) written in terms of Heaviside functions it is not yet in proper form for us to take the transform. Remember that each function must be shifted by a proper amount. So, getting things set up for the proper shifts gives us,

\[\begin{align*}g\left( t \right) & = 2 + \left( {t - 6 + 6 - 2} \right){u_6}\left( t \right) + \left( {4 - \left( {t - 10 + 10} \right)} \right){u_{10}}\left( t \right)\\ g\left( t \right) & = 2 + \left( {t - 6 + 4} \right){u_6}\left( t \right) + \left( { - 6 - \left( {t - 10} \right)} \right){u_{10}}\left( t \right)\end{align*}\]

So, for the first Heaviside it looks like \(f\left( t \right) = t + 4\) is the function that is being shifted and for the second Heaviside it looks like \(f\left( t \right) = - 6 - t\) is being shifted.

Now take the Laplace transform of everything and plug in the initial conditions.

\[\begin{align*}{s^2}Y\left( s \right) - sy\left( 0 \right) - y'\left( 0 \right) + 3\left( {sY\left( s \right) - y\left( 0 \right)} \right) + 2Y\left( s \right) & = \frac{2}{s} + {{\bf{e}}^{ - 6s}}\left( {\frac{1}{{{s^2}}} + \frac{4}{s}} \right) - {{\bf{e}}^{ - 10s}}\left( {\frac{1}{{{s^2}}} + \frac{6}{s}} \right)\\ \left( {{s^2} + 3s + 2} \right)Y\left( s \right) + 2 & = \frac{2}{s} + {{\bf{e}}^{ - 6s}}\left( {\frac{1}{{{s^2}}} + \frac{4}{s}} \right) - {{\bf{e}}^{ - 10s}}\left( {\frac{1}{{{s^2}}} + \frac{6}{s}} \right)\end{align*}\]

Solve for \(Y(s)\).

\[\begin{align*}\left( {{s^2} + 3s + 2} \right)Y\left( s \right) & = \frac{2}{s} + {{\bf{e}}^{ - 6s}}\left( {\frac{1}{{{s^2}}} + \frac{4}{s}} \right) - {{\bf{e}}^{ - 10s}}\left( {\frac{1}{{{s^2}}} + \frac{6}{s}} \right) - 2\\ \left( {{s^2} + 3s + 2} \right)Y\left( s \right) & = \frac{{2 + 4{{\bf{e}}^{ - 6s}} - 6{{\bf{e}}^{ - 10s}}}}{s} + \frac{{{{\bf{e}}^{ - 6s}} - {{\bf{e}}^{ - 10s}}}}{{{s^2}}} - 2\\ Y\left( s \right) & = \frac{{2 + 4{{\bf{e}}^{ - 6s}} - 6{{\bf{e}}^{ - 10s}}}}{{s\left( {s + 1} \right)\left( {s + 2} \right)}} + \frac{{{{\bf{e}}^{ - 6s}} - {{\bf{e}}^{ - 10s}}}}{{{s^2}\left( {s + 1} \right)\left( {s + 2} \right)}} - \frac{2}{{\left( {s + 1} \right)\left( {s + 2} \right)}}\\ & \\ Y\left( s \right) & = \left( {2 + 4{{\bf{e}}^{ - 6s}} - 6{{\bf{e}}^{ - 10s}}} \right)F\left( s \right) + \left( {{{\bf{e}}^{ - 6s}} - {{\bf{e}}^{ - 10s}}} \right)G\left( s \right) - H\left( s \right)\end{align*}\]

Now, in the solving process we simplified things into as few terms as possible. Even doing this, it looks like we’ll still need to do three partial fractions.

We’ll leave the details of the partial fractioning to you to verify. The partial fraction form and inverse transform of each of these are.

\[\begin{align*}F\left( s \right) & = \frac{1}{{s\left( {s + 1} \right)\left( {s + 2} \right)}} = \frac{{\frac{1}{2}}}{s} - \frac{1}{{s + 1}} + \frac{{\frac{1}{2}}}{{s + 2}}\\ f\left( t \right) & = \frac{1}{2} - {{\bf{e}}^{ - t}} + \frac{1}{2}{{\bf{e}}^{ - 2t}}\end{align*}\] \[\begin{align*}G\left( s \right) & = \frac{1}{{{s^2}\left( {s + 1} \right)\left( {s + 2} \right)}} = - \frac{{\frac{3}{4}}}{s} + \frac{{\frac{1}{2}}}{{{s^2}}} + \frac{1}{{s + 1}} - \frac{{\frac{1}{4}}}{{s + 2}}\\ g\left( t \right) & = - \frac{3}{4} + \frac{1}{2}t + {{\bf{e}}^{ - t}} - \frac{1}{4}{{\bf{e}}^{ - 2t}}\end{align*}\] \[\begin{align*}H\left( s \right) & = \frac{2}{{\left( {s + 1} \right)\left( {s + 2} \right)}} = \frac{2}{{s + 1}} - \frac{2}{{s + 2}}\\ h\left( t \right) & = 2{{\bf{e}}^{ - t}} - 2{{\bf{e}}^{ - 2t}}\end{align*}\]

Putting this all back together is going to be a little messy. First rewrite the transform a little to make the inverse transform process possible.

\[Y\left( s \right) = 2F\left( s \right) + {{\bf{e}}^{ - 6s}}\left( {4F\left( s \right) + G\left( s \right)} \right) - {{\bf{e}}^{ - 10s}}\left( {6F\left( s \right) + G\left( s \right)} \right) - H\left( s \right)\]

Now, taking the inverse transform of all the pieces gives us the final solution to the IVP.

\[y\left( t \right) = 2f\left( t \right) - h\left( t \right) + {u_6}\left( t \right)\left( {4f\left( {t - 6} \right) + g\left( {t - 6} \right)} \right) - {u_{10}}\left( t \right)\left( {6f\left( {t - 10} \right) + g\left( {t - 10} \right)} \right)\]

where \(f(t)\), \(g(t)\), and \(h(t)\) are defined above.

So, the answer to this example is a little messy to write down, but overall the work here wasn’t too terribly bad.

Before proceeding with the next section let’s see how we would have had to solve this IVP if we hadn’t had Laplace transforms. To solve this IVP we would have had to solve three separate IVP’s. One for each portion of \(g(t)\). Here is a list of the IVP’s that we would have had to solve.

  1. \(0 < t < 6\) \[y'' + 3y' + 2y = 2,\hspace{0.25in}y\left( 0 \right) = 0\,\,\,\,\,\,\,\,y'\left( 0 \right) = - 2\]

    The solution to this IVP, with some work, can be made to look like,

    \[{y_1}\left( t \right) = 2f\left( t \right) - h\left( t \right)\]
  2. \(6 \le t < 10\) \[y'' + 3y' + 2y = t,\hspace{0.25in}y\left( 6 \right) = {y_1}\left( 6 \right)\,\,\,\,\,\,\,\,y'\left( 6 \right) = {y'_1}\left( 6 \right)\]

    where, \(y_{1}(t)\) is the solution to the first IVP. The solution to this IVP, with some work, can be made to look like,

    \[{y_2}\left( t \right) = 2f\left( t \right) - h\left( t \right) + 4f\left( {t - 6} \right) + g\left( {t - 6} \right)\]
  3. \(t \ge 10\) \[y'' + 3y' + 2y = 4,\hspace{0.25in}y\left( {10} \right) = {y_2}\left( {10} \right)\,\,\,\,\,\,\,\,y'\left( {10} \right) = {y'_2}\left( {10} \right)\]

    where, \(y_{2}(t)\) is the solution to the second IVP. The solution to this IVP, with some work, can be made to look like,

    \[{y_3}\left( t \right) = 2f\left( t \right) - h\left( t \right) + 4f\left( {t - 6} \right) + g\left( {t - 6} \right) - 6f\left( {t - 10} \right) - g\left( {t - 10} \right)\]

There is a considerable amount of work required to solve all three of these and in each of these the forcing function is not that complicated. Using Laplace transforms saved us a fair amount of work.