Originally Posted by

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

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

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

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

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

Then,

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

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

After that,

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

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

Then,

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

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

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

Thank you