1. ## Check IVP

I was wondering if someone could check my diff eq I had to solve with an initial condition:

dy/dt + 2y = 1, y(0) = 5/2

MY WORK:

dy/dt = 1 - 2y => dy = (1 - 2y) dt => dt = 1/(1 - 2y) dy

Take integral of both sides:

t = -1/2 * ln|2y - 1| + C

Using the initial condition:

0 = -1/2 * ln|2*0 - 1| + C

0 = 0 + C

Thus C = 0.

And therefore the solution is t = -1/2 * ln|2y - 1|.

Anyone see any mistakes?

2. Originally Posted by Ideasman
I was wondering if someone could check my diff eq I had to solve with an initial condition:

dy/dt + 2y = 1, y(0) = 5/2

MY WORK:

dy/dt = 1 - 2y => dy = (1 - 2y) dt => dt = 1/(1 - 2y) dy

Take integral of both sides:

t = -1/2 * ln|2y - 1| + C

Using the initial condition:

0 = -1/2 * ln|2*0 - 1| + C

0 = 0 + C

Thus C = 0.

And therefore the solution is t = -1/2 * ln|2y - 1|.

Anyone see any mistakes?
you should have solved for y. and you plugged in the initial conditions wrong. (y = 5/2 when t = 0, you plugged in y = t = 0)

this is a regular first-order inhomogeneous equation. use the method of integrating factor

3. The mistake is when you found C.
Put $\displaystyle t=0$ and $\displaystyle \displaystyle y=\frac{5}{2}$:
$\displaystyle \displaystyle 0=-\frac{1}{2}\ln 4+C=-\ln 2+C\Rightarrow C=\ln 2$

4. Originally Posted by Jhevon
you should have solved for y. and you plugged in the initial conditions wrong. (y = 5/2 when t = 0, you plugged in y = t = 0)

this is a regular first-order inhomogeneous equation. use the method of integrating factor
Oh, y is a function of t! And I see that I messed up plugging in the values! Let me try re-work it. I'm not quite sure what the method of integrating factor is.

5. Originally Posted by Ideasman
I'm not quite sure what the method of integrating factor is.
see the first post here. make sure it's on page 3

6. Originally Posted by Jhevon
you should have solved for y. and you plugged in the initial conditions wrong. (y = 5/2 when t = 0, you plugged in y = t = 0)

this is a regular first-order inhomogeneous equation. use the method of integrating factor
Hmm. So I have dy/dt = 1-2y.. then 1/(1-2y) dy = dt.. so the integrals should both stay the same.

That is:

t = -1/2 * ln|2y - 1| + C

So do I solve for y here first? Does it even matter? Can't I just plug the values in now?

7. Originally Posted by Jhevon
see the first post here. make sure it's on page 3
Oh, I think we did this in class! It's used for homogeneous terms of the same degree right?

Is this where you make a substitution: y = ut or t = vy, where u and v are the new dep. variables?

8. Originally Posted by Ideasman
Hmm. So I have dy/dt = 1-2y.. then 1/(1-2y) dy = dt.. so the integrals should both stay the same.

That is:

t = -1/2 * ln|2y - 1| + C

So do I solve for y here first? Does it even matter? Can't I just plug the values in now?
you can plug in the values and solve for C. it's fine. it's just not the way i would do it. and you may be required to give the answer in the form y(t) = something. if that's the case, this method causes too much trouble for you

9. post your solution when finished

10. Originally Posted by Jhevon

Luckily for me, my prof. doesn't care if its in the form y(t) = something.

So here goes my solution:

dy/dt + 2y = 1

dy/dt = 1 - 2y => dy = (1 - 2y)dt => dt = 1/(1 - 2y) dy

Take integral of both sides:

t = -1/2 * ln|2y - 1| + C

Using the intial condition:

0 = -1/2 * ln|2*(5/2) - 1| + C

0 = -ln(2) + C

=> C = ln(2)

And thus, the solution is:

t = -1/2 * ln|2y - 1| + ln(2)

11. You gotta find $\displaystyle y$ in terms of $\displaystyle t$

The general solution is $\displaystyle y=\frac12+ke^{-2t}$

12. Originally Posted by Ideasman

Luckily for me, my prof. doesn't care if its in the form y(t) = something.

So here goes my solution:

dy/dt + 2y = 1

dy/dt = 1 - 2y => dy = (1 - 2y)dt => dt = 1/(1 - 2y) dy

Take integral of both sides:

t = -1/2 * ln|2y - 1| + C

Using the intial condition:

0 = -1/2 * ln|2*(5/2) - 1| + C

0 = -ln(2) + C

=> C = ln(2)

And thus, the solution is:

t = -1/2 * ln|2y - 1| + ln(2)
that's fine. good job.

i got Krizalid's solution though (with k = 2).

Originally Posted by Krizalid
You gotta find $\displaystyle y$ in terms of $\displaystyle t$

The general solution is $\displaystyle y=\frac12+ke^{-2t}$
we can probably turn them into the same thing with some algebraic manipulation, but if your professor doesn't care, why bother

13. Originally Posted by Jhevon
that's fine. good job.

i got Krizalid's solution though (with k = 2).

we can probably turn them into the same thing with some algebraic manipulation, but if your professor doesn't care, why bother
So you're saying if I DID solve for y in terms of t, I would get $\displaystyle y=\frac12+ke^{-2t}$ and with the initial condition, k = 2? So what we have are equivalent?

14. Originally Posted by Ideasman
So you're saying if I DID solve for y in terms of t, I would get $\displaystyle y=\frac12+ke^{-2t}$ and with the initial condition, k = 2? So what we have are equivalent?
yes, they are equivalent. I'll show you

$\displaystyle t = - \frac {1}{2} \ln |2y - 1| + \ln 2$

$\displaystyle \Rightarrow -2t = \ln |2y - 1| - 2 \ln 2$

$\displaystyle \Rightarrow -2t = \ln |2y - 1| - \ln 4$

$\displaystyle \Rightarrow -2t = \ln \left| \frac {2y - 1}{4} \right|$

$\displaystyle \Rightarrow e^{-2t} = \frac {2y - 1}{4}$

$\displaystyle \Rightarrow y = \frac {1}{2} + 2 e^{-2t}$

and, of course, we could go the other way, from my solution to yours

15. Actually, I solved this one as a linear ODE, it's faster.

When Ideasman look at $\displaystyle y'+P(x)y=Q(x)$, he will see