# Step Function IVP Differential Equation w/ Laplace Transform

## Homework Statement

(didn't know how to make piecewise function so I took screenshot) ## The Attempt at a Solution My issue here with this problem is that I have absolutely no idea where to start... I have read through the text book numerous times, and searched all over the internet, and I found examples but they make no sense to me no matter how much I break it down and try to follow the steps.

I am having trouble understanding where to even start, and more importantly WHY to start there and WHY to do these things.

Ray Vickson
Homework Helper
Dearly Missed

## Homework Statement

(didn't know how to make piecewise function so I took screenshot) ## The Attempt at a Solution My issue here with this problem is that I have absolutely no idea where to start... I have read through the text book numerous times, and searched all over the internet, and I found examples but they make no sense to me no matter how much I break it down and try to follow the steps.

I am having trouble understanding where to even start, and more importantly WHY to start there and WHY to do these things.

If ##f(t)## is your piecewise function on the right and ##Y(s)## is the Laplace transform of ##y(t)## you will have
$$s^2 Y(s) - y'(0) - s y(0) + Y(s) = g(s),$$
where ##g(s)## is the transform of ##f(t)##. Just apply the definition of Laplace transform to ##f(t)## and do the integrals involved. Alternatively, you can try to express ##f(t)## in terms of "unit step-functions" ##u(t-a)## and then apply standard tabulated Laplace transform results, but that seems to be more trouble than just going ahead and performing some elementary integrations.

HallsofIvy
Homework Helper
As I have expressed before, I really dislike the "Laplace Transform" method! Are you required to use it? I have yet to find a differential equations problem that cannot be solved more simply using the usual "direct methods" and this is no exception. Even if you are required to use the Laplace transform this might help as a check.

The associated homogeneous equation is $y''+ y= 0$ which has characteristic equation $r^2+ 1= 0$ so characteristic roots -i and i and so general solution $y_h= A cos(t)+ B sin(t)$. To get a "right hand side" of t, we look for a solution of the form y= At+ B so y'= A and y''= 0. The differential equaton becomes 0+ At+ B= t. In order that this be true for all t, we must have A= 1, B= 0. The general solution to this part of the equation is $y(t)= A cos(t)+ B sin(t)+ t$ so that $y'(x)= -A sin(t)+ B cos(t)+ 1$. To satisfy the initial conditions we must have $y(0)= A(1)+ B(0)+ 0= 0$ and $y'(0)= -A(0)+ B(1)+ 1= 0$. That is, A= 0 and B+ 1= 0 so B= -1. For $0\le t\le 1$ we must have $y(t)= t- sin(t)$, $y'(t)= 1- cos(t)$. Evaluating that at t= 1, $y(1)= 1- sin(1)$, $y'(1)= 1- cos(1)$.

So for $1\le t\le 2$ we must solve $y''+ y= 2- t$ with $y(1)= 1- sin(1)$, $y'(1)= 1- cos(1)$, which, of course, can be done in the same way.

Ray Vickson
Homework Helper
Dearly Missed

## Homework Statement

(didn't know how to make piecewise function so I took screenshot) ## The Attempt at a Solution My issue here with this problem is that I have absolutely no idea where to start... I have read through the text book numerous times, and searched all over the internet, and I found examples but they make no sense to me no matter how much I break it down and try to follow the steps.

I am having trouble understanding where to even start, and more importantly WHY to start there and WHY to do these things.

HallslofIvy has spoken against the Laplace method, but I personally prefer it. The fact is that if you are going to face a variety of problems it is good to have a toolbox containing a variety of methods; sometimes Laplace is the very best way to do a problem, and sometimes the opposite is the case. Do not be guided by either of our prejudices, just learn as much as you can about as many methods as you can absorb. In any case, if the question tells you to use Laplace, then that is what you must do.

BTW: to do piecewise functions in LaTeX, use the "\cases" environment, which gives the following typeset result:
$$f(t) = \begin{cases} t &, 0 \leq t < 1\\ 2-t &, 1 \leq t < 2 \\ 0 &, \text{otherwise} \end{cases}$$
You can see the commands used just by right-clicking on the equation and choosing "display as tex".

HallsofIvy
Homework Helper
Personally, I think the whole purpose of the "Laplace transform" is to give engineers a "mechanism" they can mindlessly apply to differential equations!

If ##f(t)## is your piecewise function on the right and ##Y(s)## is the Laplace transform of ##y(t)## you will have
$$s^2 Y(s) - y'(0) - s y(0) + Y(s) = g(s),$$
where ##g(s)## is the transform of ##f(t)##. Just apply the definition of Laplace transform to ##f(t)## and do the integrals involved. Alternatively, you can try to express ##f(t)## in terms of "unit step-functions" ##u(t-a)## and then apply standard tabulated Laplace transform results, but that seems to be more trouble than just going ahead and performing some elementary integrations.

As I have expressed before, I really dislike the "Laplace Transform" method! Are you required to use it? I have yet to find a differential equations problem that cannot be solved more simply using the usual "direct methods" and this is no exception. Even if you are required to use the Laplace transform this might help as a check.

Ray: How do you just apply the definition of Laplace for the g(s) and f(t), I keep reading up on the unit step functions and they just don't seem to make much sense to me. I don't know how I would apply integrals to it, besides doing the laplace transform, and even then, I don't know how to do the laplace transform for a piecewise!

HallsofIvy: I think I agree with you on this one, I'm not sure I'm fond of Laplace, though that could just be that I'm not understanding it at the moment, I just really don't understand how to transform the piecewise still. Sadly, this problem MUST be answered using Laplace.

All in all, I think the piecewise is what's getting in my way. I don't understand the step method, or how to transform it otherwise. I was able to do all other laplace problems fine, however.

Last edited:
vela
Staff Emeritus
Homework Helper
My issue here with this problem is that I have absolutely no idea where to start... I have read through the text book numerous times, and searched all over the internet, and I found examples but they make no sense to me no matter how much I break it down and try to follow the steps.

I am having trouble understanding where to even start, and more importantly WHY to start there and WHY to do these things. [/B]
Well, it looks like you did actually start the problem.

You started with ##y''+y = f(t)## where
$$f(t) = \begin{cases} t, & 0 \le t < 1 \\ 2-t, & 1 \le t < 2 \\ 0, & \text{otherwise}\end{cases}$$ Now you want to apply the Laplace transform operator ##\mathcal{L}## to both sides, giving you
\begin{align*}
y'' + y &= f(t) \\
\mathcal{L}[y'' + y] &= \mathcal{L}[f(t)] \\
Y(s)(s^2+1) &= F(s)
\end{align*} where Y(s) and F(s) are the Laplace transforms of y(t) and f(t) respectively. What you didn't do in your work was apply the operator to the righthand side. To calculate F(s), do what Ray suggested.

Why do you do this? The Laplace transform operator changes a differential equation into an algebraic equation. Instead of derivatives, you have powers of ##s##. Once you solve for Y(s) algebraically, you invert it to find y(t). Ultimately, it's just another method to solve this class of linear differential equations (and to annoy HallsofIvy).

vela
Staff Emeritus
Homework Helper
Ray: How do you just apply the definition of Laplace for the g(s) and f(t), I keep reading up on the unit step functions and they just don't seem to make much sense to me. I don't know how I would apply integrals to it, besides doing the laplace transform, and even then, I don't know how to do the laplace transform for a piecewise!
This should get you started:
$$F(s) = \int_0^\infty f(t)e^{-st}\,dt = \int_0^1 f(t)e^{-st}\,dt + \int_1^2 f(t)e^{-st}\,dt + \int_2^\infty f(t)e^{-st}\,dt.$$ The last integral vanishes because f(t) = 0 for ##t\ge 2##.

Well, it looks like you did actually start the problem.

You started with ##y''+y = f(t)## where
$$f(t) = \begin{cases} t, & 0 \le t < 1 \\ 2-t, & 1 \le t < 2 \\ 0, & \text{otherwise}\end{cases}$$ Now you want to apply the Laplace transform operator ##\mathcal{L}## to both sides, giving you
\begin{align*}
y'' + y &= f(t) \\
\mathcal{L}[y'' + y] &= \mathcal{L}[f(t)] \\
Y(s)(s^2+1) &= F(s)
\end{align*} where Y(s) and F(s) are the Laplace transforms of y(t) and f(t) respectively. What you didn't do in your work was apply the operator to the righthand side. To calculate F(s), do what Ray suggested.

Why do you do this? The Laplace transform operator changes a differential equation into an algebraic equation. Instead of derivatives, you have powers of ##s##. Once you solve for Y(s) algebraically, you invert it to find y(t). Ultimately, it's just another method to solve this class of linear differential equations (and to annoy HallsofIvy).

Yes, I know I had to apply that to the right hand side, I did the left hand side work because I wanted to show that I at least knew how to do part of the problem. My big problem ultimately lies with the right hand side, and HOW to apply that Laplace to a piecewise function.

So far after reading things up on this subject forever... I have come to terms that I must take the piecewise function as some function... say g(t), write it as a unit step equation, then do something with that...

I express it as a unit step like so...

## g(t)= t[1-u_{1}] + (2-t)[u_{1} - u_{2}] + 0[u_{2}] ##

## g(t) = t - tu_{1} + 2u_{1} - 2u_{2} - tu_{1} + tu_{2} ##

## g(t) = t + (-t + 2 - t)u_{1} + (t - 2)u_{2} ##

I don't know what to do after I get to this point... Not sure If I have to use a table for transforms or something

vela
Staff Emeritus
Homework Helper
Use the time-delay property of the Laplace transform: L[f(t-a)ua] = e-asF(s). For example, the last term, (t-2)u2, is the function t shifted by 2 to the right, so its transform would be the transform of ##t## multiplied by e-2s.

Ray's suggestion of evaluating the integral directly, though, is probably easier, though it would be good to understand how to do it both ways.

Use the time-delay property of the Laplace transform: L[f(t-a)ua] = e-asF(s). For example, the last term, (t-2)u2, is the function t shifted by 2 to the right, so its transform would be the transform of ##t## multiplied by e-2s.

Ray's suggestion of evaluating the integral directly, though, is probably easier, though it would be good to understand how to do it both ways.

Okay, thank you, now I can get it done because I know the property, I didn't understand it before.

Personally, I think the whole purpose of the "Laplace transform" is to give engineers a "mechanism" they can mindlessly apply to differential equations!

Come on, face it: solving these kind of differential equations is just boring. I'd rather learn a quick, mindless trick like the Laplace transform that can deal with a lot of them. Then I have time to do some more interesting math that solving ODEs.

Ray Vickson
Homework Helper
Dearly Missed
Ray: How do you just apply the definition of Laplace for the g(s) and f(t), I keep reading up on the unit step functions and they just don't seem to make much sense to me. I don't know how I would apply integrals to it, besides doing the laplace transform, and even then, I don't know how to do the laplace transform for a piecewise!

**************************

The Laplace transform ##F(s)## of your ##f(t)## is just
$$F(s) = \int_0^{\infty} e^{-st} f(t) dt = \int_0^1 e^{-st} t \, dt + \int_1^2 e^{-st} (2-t) \, dt + \int_2^{\infty} e^{-st} 0 \, dt$$
and both integrals ##\int_0^1 e^{-st} t \, dt ## and ##\int_1^2 e^{-st} (2-t) \, dt ## are more-or-less elementary. So, there is nothing at all special about piecewise functions; we just need to apply the definition of Laplace, and split the integration into pieces, because we are dealing with a different formula over different ##t##-regions. That's all there is to it!

Alternately (and not, in my opinion the best way) we can write
$$f(t) = t + u(t-1) (2 - 2t) + u(t-2)(t-2)$$
This works because the rhs above equals ##t## when ##0 \leq t < 1##, equals ##t + 2 - 2t = 2-t## when ##1 \leq t < 2## and equals ##2 - t + t - 2 = 0## when ##t \geq 2##.

***************************

HallsofIvy: I think I agree with you on this one, I'm not sure I'm fond of Laplace, though that could just be that I'm not understanding it at the moment, I just really don't understand how to transform the piecewise still. Sadly, this problem MUST be answered using Laplace.

All in all, I think the piecewise is what's getting in my way. I don't understand the step method, or how to transform it otherwise. I was able to do all other laplace problems fine, however.