Solving Differential Equations with Initial Conditions

BOAS
Messages
546
Reaction score
19
Hello

Homework Statement



Find the general solution of the following diff erential equations. In each case if
y = 2 when x = 1, fi nd y when x = 3.

x \frac{dy}{dx} = \frac{1}{y} + y

Homework Equations





The Attempt at a Solution



x \frac{dy}{dx} = \frac{1}{y} + y

x . \frac{1}{dx} =( \frac{1}{y} + y) \frac{1}{dy}

\frac{1}{x} dx = y + \frac{1}{y} dy

\int \frac{1}{x} dx = \int y + \frac{1}{y} dy

ln|x| + c_{1} = \frac{y^{2}}{2} + ln|y| + c_{2}

ln|x| - \frac{y^{2}}{2} - ln|y| = c_{2} - c_{1}

ln|x| - \frac{y^{2}}{2} - ln|y| = c

If y = 2 and x = 1, c = -2

(assuming I have found the general solution correctly...)

But I don't see how I can find y, when x = 3 because there are two terms involving y.

I think the most likely explanation is that I've done something wrong, so i'd really appreciate some help!

thanks,

BOAS :)
 
Physics news on Phys.org
$$\left(y+\frac1y\right)^{-1} \ne \frac{1}{y} + y$$
 
BOAS said:
Hello

Homework Statement



Find the general solution of the following diff erential equations. In each case if
y = 2 when x = 1, fi nd y when x = 3.

x \frac{dy}{dx} = \frac{1}{y} + y

Homework Equations





The Attempt at a Solution



x \frac{dy}{dx} = \frac{1}{y} + y

x . \frac{1}{dx} =( \frac{1}{y} + y) \frac{1}{dy}

\frac{1}{x} dx = y + \frac{1}{y} dy

\int \frac{1}{x} dx = \int y + \frac{1}{y} dy

ln|x| + c_{1} = \frac{y^{2}}{2} + ln|y| + c_{2}

ln|x| - \frac{y^{2}}{2} - ln|y| = c_{2} - c_{1}

ln|x| - \frac{y^{2}}{2} - ln|y| = c

If y = 2 and x = 1, c = -2

(assuming I have found the general solution correctly...)

But I don't see how I can find y, when x = 3 because there are two terms involving y.

I think the most likely explanation is that I've done something wrong, so i'd really appreciate some help!

thanks,

BOAS :)

Always substitute your alleged 'solution' into the original DE, to see if it works. My guess is that you have not done that yet.
 
Ray Vickson said:
Always substitute your alleged 'solution' into the original DE, to see if it works. My guess is that you have not done that yet.

I've only just started learning DE's and this may sound silly, but how do I substitute it in?
 
vela said:
$$\left(y+\frac1y\right)^{-1} \ne \frac{1}{y} + y$$

( \frac{1}{y} + y)^{-1} = \frac{1}{\frac{1}{y} + y}

I'll see if I can solve it now
 
No, it wouldn't. You can't distribute the exponent over the sum.

Just try it with y=1. On the lefthand side, you end up with 1/2; on the righthand side you end up with 2.
 
BOAS said:
I've only just started learning DE's and this may sound silly, but how do I substitute it in?

In the obvious way: try it and see. Your solution says that x and y are related by
ln|x| - \frac{y^{2}}{2} - ln|y| = c,
while the DE says they are related by
x dy = \left( y + \frac{1}{y} \right) dx .
Do these two statements agree? Can you take the first form and show that it satisfies the second?
 
vela said:
No, it wouldn't. You can't distribute the exponent over the sum.

Just try it with y=1. On the lefthand side, you end up with 1/2; on the righthand side you end up with 2.

I think I have identified and fixed the problem, or the second problem that was stopping me from making sense of your help :)

x \frac{dy}{dx} = \frac{1}{y} + y

x . \frac{1}{dx} =( \frac{1}{y} + y) \frac{1}{dy}

\frac{1}{x} dx = ( \frac{1}{y} + y)^{-1} dy

\int \frac{1}{x} dx = \int ( \frac{1}{y} + y)^{-1} dy

ln|x| + c_{1} = \frac{ln|y^{2} + 1|}{2} + c_{2}

ln|x| - \frac{ln|y^{2} + 1|}{2} = c_{2} - c_{1}

ln|x| - \frac{ln|y^{2} + 1|}{2}| = c

(whilst trying to implement your help, I was trying to differentiate that section when I needed to be integrating it)
 
Back
Top