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

## Solve the initial value problem?

# 2 Answers

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

On interval [0,1] we have y' + 2y = 1. Multiplying by integrating factor μ = e^{2x} gives

e^{2}^{x }y' + 2e^{2x} = e^{2x}

e^{2}^{x} y = ∫ e^{2x} dx = e^{2x}/2 + C

y = 1/2 + Ce^{-2x}

Using the initial value, you have y(0) = 1/2 + C = 0 so that C = -1/2.

Thus you have y = (1 - e^{-2x})/2.

On the interval (1,∞) you have y' = -2y which is easily solved as y = Ce^{-2x}.

If we want a continuous function at x = 1, we have (1 - e^{-}^{2})/2 = Ce^{-2}.

This makes C = (e^{2 }- 1)/2 so that y = (e^{2} - 1)e^{-2x}/2.

Note, though the function we get is continuous at x = 1, it is not differentiable at that point.