Solve the initial value problem y'+2y=g(t), y(0)=0, where g(t)={1, 0≤t≤1, 0, t>1.

This is again a typical first-order linear differential equation: y' + Py = Q

y = (1/e^{∫P})(∫e^{∫P} Q dx + c) <==Formula of the solution for any first-order linear differential equation.

P = 2

e^{∫P} = e^{2t}

For 0≤t≤1,

y = e^{-2t }[∫e^{2t} g(t) dt + c]

y = e^{-2t} [(1/2)e^{2t} + c]

y = (1/2) + ce^{-2t}

Plug in y(0) = 0,

0 = (1/2) + c

y = (1/2)(1- e^{-2t}) <==Answer 1

For t>1,

y = ce^{-2t}

Since y(1) = (1/2)(1- e^{-2}), (1/2)(1- e^{-2}) = ce^{-2}

c = (1/2)(e^{2} - 1)

y = (1/2)(e^{2} - 1)e^{-2t }<==Answer 2