# Thread: Solving ODE with IVP

1. ## Solving ODE with IVP

Ok, I'm stuck! I've tried everything and can't seem to solve this problem!

dy/dt+2y=1 y(0)=5/2; and find the value of the function t=3seconds

I first tried: dy=1-2y dt
then dy/1-2y=dt
next integrate both sides: u=1-2y u'=-2 dx=-1/2du=t
so after integrating: -1/2ln(1-2y)=t+C
When I plug in the IVP, I'm getting a negative log, So now I'm stuck!

2. Originally Posted by latavee
Ok, I'm stuck! I've tried everything and can't seem to solve this problem!

dy/dt+2y=1 y(0)=5/2; and find the value of the function t=3seconds

I first tried: dy=1-2y dt
then dy/1-2y=dt
next integrate both sides: u=1-2y u'=-2 dx=-1/2du=t
so after integrating: -1/2ln(1-2y)=t+C
When I plug in the IVP, I'm getting a negative log, So now I'm stuck!
$\int\frac{\,du}{u}=\ln{\color{red}\left|\right.}u{ \color{red}\left.\right|}+C$.

3. so the -1/2 ln(u) +C isn't correct? Thanks! I found your tutorials very helpful!

4. Originally Posted by latavee
Ok, I'm stuck! I've tried everything and can't seem to solve this problem!

dy/dt+2y=1 y(0)=5/2; and find the value of the function t=3seconds

I first tried: dy=1-2y dt
then dy/1-2y=dt
next integrate both sides: u=1-2y u'=-2 dx=-1/2du=t
so after integrating: -1/2ln(1-2y)=t+C
When I plug in the IVP, I'm getting a negative log, So now I'm stuck!
$dt = \frac{dy}{1 - 2y}$.

There are two approaches that will give you a greater chance of success:

1. Since the boundary condition will cause 1 - 2y to be negative, re-write the DE as $dt = - \frac{dy}{2y - 1}$, integrate in the usual way and then include the boundary condition in the usal way, or

2. Make y the subject before using the boundary condition.

5. Originally Posted by latavee
so the -1/2 ln(u) +C isn't correct? Thanks! I found your tutorials very helpful!
My understanding is it IS correct, but in complex domain. Now you have obtained
$-\tfrac{1}{2} \ln(1-2y) = t + C$ (1)

Put in $y(0)=\tfrac{5}{2}$, you get
$C=-\tfrac{1}{2}\ln(-4)$ (2)

Put (2) into (1), you should get
$-\tfrac{1}{2} \ln(1-2y) = t -\tfrac{1}{2}\ln(-4)$ (3)

- After some simplification, you will obtain
$-\tfrac{1}{2} \ln \frac{1-2y}{-4} = -\tfrac{1}{2} \ln \frac{2y-1}{4}= t$ (4)
which comes back to real domain.