Implicit and Explicit Solution with Initial Condition $\frac{dy}{dt}+2y=1$

310 Views Asked by At

$\newcommand{\diff}{\frac{dy}{dt}}$ I was given the following ODE: $$\begin{align}\diff+2y&=1 \\ \diff&=-2y+1\\ \frac{dy}{-2y+1}&=dt\end{align} $$

Then I was given the following initial condition: $y(0)=\frac{5}2$. I began to answer the following questions, implicitly, and explicitly solve the ODE.

Implicit Result

I then decided to take the integral of both sides. $$\begin{align} \int\frac{dy}{-2y+1}&=\int dt \\ \int_{\frac{5}2}^y \frac{ds}{-2s+1}&=\int_{0}^{t}dv \\ [\frac{\ln\vert-2s+1\rvert}{-2}]\Bigg\vert_{\frac{5}2}^y&=t \\ -\frac{\ln\lvert-2y+1\rvert}{2}+\frac{\ln(4)}{2}&=t \end{align}$$ Thus, this being the implicit solution:

$$-\frac{\ln\lvert-2y+1\rvert}{2}=t-\frac{\ln(4)}2$$ To bring it into the explicit form. $$\begin{align}\ln\lvert -2y+1\rvert &= \ln(4) - 2t \\ -2y+1&=e^{\ln(4)-2t}=e^{\ln(4)}e^{-2t} \\ y&=\frac{4e^{-2t}-1}2\end{align}$$

Is my method, and answer correct?

Edit 1

How do we account for the different various solutions that can be used in this given the separable ODE that I was given in this case? I am going off the idea that it may be due to the absolute value sign, and yes I realized I made a sign mistake in my work initially.

3

There are 3 best solutions below

2
On BEST ANSWER

In my opinion, a better method that avoids absolute values in the log.

$y' + 2y=1 \implies (e^{2t}y)'=e^{2t}\implies \int_0^t (e^{2s}y(s))'\, ds=\int_0^t e^{2s}\, ds$

so $e^{2t}y(t)-y(0)=\frac{1}{2}(e^{2t}-1)$. Therefore, $$ y(t)=y(0)e^{-2t}+\frac{1}{2}(1-e^{-2t})=\frac{1}{2}(1+4e^{-2t}). $$

2
On

Starting from this line of your answer: $$\int_{\frac{5}2}^y \frac{ds}{-2s+1}=\int_{0}^{t}dv \\$$ $$-\frac 12[{\ln\vert s-\dfrac 12\rvert}]\Bigg\vert_{\frac{5}2}^y=t \\ $$ $$\ln|y-\dfrac 12| -\ln 2=-2t $$ $$ y-\dfrac 12 = 2e^{-2t} $$ $$\implies y=\dfrac 12 + 2e^{-2t} $$

2
On

The $+1$ is annoying you ?

Well this is a linear ODE so solve the homogeneous equation $y'+2y=0\iff y(t)=Ce^{-2t}$

Then add a particular solution of equation with RHS, which here is simply the constant $\frac 12$ (since $y'=0$ in that case, so $2y=1$ remains).

Finally determine $C$ for initial condition $y(0)=\frac 52=\frac 12+Ce^0\iff C=2$

Thus $$y(t)=\frac 12+2e^{-2t}$$

Sometimes it is good to come back to basics...