# Homework Help: Differential Equations Help

1. Feb 19, 2014

### BOAS

Hello

1. The problem statement, all variables and given/known data

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$

2. Relevant equations

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

2. Feb 19, 2014

### vela

Staff Emeritus
$$\left(y+\frac1y\right)^{-1} \ne \frac{1}{y} + y$$

3. Feb 19, 2014

### Ray Vickson

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

4. Feb 19, 2014

### BOAS

I've only just started learning DE's and this may sound silly, but how do I substitute it in?

5. Feb 19, 2014

### BOAS

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

I'll see if I can solve it now

6. Feb 19, 2014

### vela

Staff Emeritus
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.

7. Feb 19, 2014

### Ray Vickson

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?

8. Feb 19, 2014

### BOAS

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)