# Thread: Laplace transform to solve the initial value

1. ## Laplace transform to solve the initial value

I'm not sure with my solution and I cannot get the final answer.

$y'+y=f(t), y(0)=0$ where f(t) = 1 when 0≤t<1 and f(t) = -1 when t≥1

$f(t) = 1(u(t-0)-u(t-1))+(-1)u(t-1)$

$f(t) = 1 - 2u(t-1)$

$L{f(t)} = \frac{1}{s} - \frac{2e^{-s}}{s}$

Then,

$sY(s) - y(0) + Y(s) = \frac{1}{s} - \frac{2e^{-s}}{s}$

$Y(s) = \frac{1}{s(s+1)} - \frac{2e^{-s}}{s(s+1)}$

After that,

$y(t) = L^{-1}[\frac{1}{s(s+1)} - \frac{2e^{-s}}{s(s+1)}]$

I used partial fraction: $\frac{1}{s(s+1)} = \frac{1}{s}-\frac{1}{s+1}$

Then,
$y(t) = L^{-1}[\frac{1}{s}]-L^{-1}[\frac{1}{s+1}]-2L^{-1}[\frac{e^{-s}}{s(s+1)}]$

$y(t) = 1 - e^{-t}-2L^{-1}[\frac{e^{-s}}{s(s+1)}]$

Is that correct? And how can I solve for $L^{-1}[\frac{e^{-s}}{s(s+1)}]$?

Thank you

2. Originally Posted by noppawit
I'm not sure with my solution and I cannot get the final answer.

$y'+y=f(t), y(0)=0$ where f(t) = 1 when 0≤t<1 and f(t) = -1 when t≥1

$f(t) = 1(u(t-0)-u(t-1))+(-1)u(t-1)$

$f(t) = 1 - 2u(t-1)$

$L{f(t)} = \frac{1}{s} - \frac{2e^{-s}}{s}$

Then,

$sY(s) - y(0) + Y(s) = \frac{1}{s} - \frac{2e^{-s}}{s}$

$Y(s) = \frac{1}{s(s+1)} - \frac{2e^{-s}}{s(s+1)}$

After that,

$y(t) = L^{-1}[\frac{1}{s(s+1)} - \frac{2e^{-s}}{s(s+1)}]$

I used partial fraction: $\frac{1}{s(s+1)} = \frac{1}{s}-\frac{1}{s+1}$

Then,
$y(t) = L^{-1}[\frac{1}{s}]-L^{-1}[\frac{1}{s+1}]-2L^{-1}[\frac{e^{-s}}{s(s+1)}]$

$y(t) = 1 - e^{-t}-2L^{-1}[\frac{e^{-s}}{s(s+1)}]$

Is that correct? And how can I solve for $L^{-1}[\frac{e^{-s}}{s(s+1)}]$?

Thank you
I haven't checked your work but assuming the final result is correct you can use partial fractions and the shifting theorem to get the inverse Laplace transform.

3. Hello everyone!

Originally Posted by mr fantastic
I haven't checked your work but assuming the final result is correct you can use partial fractions and the shifting theorem to get the inverse Laplace transform.
I have checked his work, it seems to be correct.

But the following lines have a typo in it:

Of course it is f(t) = u(t) - 2 u (t-1)

He also could use an approximation

$e^{-s} = 1-s+\frac{s^2}{2}-\frac{s^3}{6}+...$

Regards
Rapha