# Check IVP

• Sep 11th 2007, 09:14 AM
Ideasman
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?
• Sep 11th 2007, 09:19 AM
Jhevon
Quote:

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
• Sep 11th 2007, 09:21 AM
red_dog
The mistake is when you found C.
Put $t=0$ and $\displaystyle y=\frac{5}{2}$:
$\displaystyle 0=-\frac{1}{2}\ln 4+C=-\ln 2+C\Rightarrow C=\ln 2$
• Sep 11th 2007, 09:21 AM
Ideasman
Quote:

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.
• Sep 11th 2007, 09:24 AM
Jhevon
Quote:

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
• Sep 11th 2007, 09:25 AM
Ideasman
Quote:

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?
• Sep 11th 2007, 09:28 AM
Ideasman
Quote:

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?
• Sep 11th 2007, 09:28 AM
Jhevon
Quote:

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
• Sep 11th 2007, 09:46 AM
Jhevon
• Sep 12th 2007, 07:41 AM
Ideasman
Quote:

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)
• Sep 12th 2007, 08:51 AM
Krizalid
You gotta find $y$ in terms of $t$

The general solution is $y=\frac12+ke^{-2t}$
• Sep 12th 2007, 09:15 AM
Jhevon
Quote:

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).

Quote:

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

The general solution is $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 :p
• Sep 12th 2007, 10:27 AM
Ideasman
Quote:

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 :p

So you're saying if I DID solve for y in terms of t, I would get $y=\frac12+ke^{-2t}$ and with the initial condition, k = 2? So what we have are equivalent?
• Sep 12th 2007, 10:37 AM
Jhevon
Quote:

Originally Posted by Ideasman
So you're saying if I DID solve for y in terms of t, I would get $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

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

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

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

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

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

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

and, of course, we could go the other way, from my solution to yours
• Sep 12th 2007, 11:33 AM
Krizalid
Actually, I solved this one as a linear ODE, it's faster.

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