Homework Help: Solving a separable ODE.

1. Oct 20, 2011

1. The problem statement, all variables and given/known data
solve y(xy+1)dx + x(1+x^2y^2)dy=0

3. The attempt at a solution

well, I substituted u=xy. Here is what I've done so far.
du = xdy + ydx -> xdy= du - ydx -> xdy = du - (u/x)dx

(u/x)(u+1)dx + x(1+u^2)dy=0
(u/x)(u+1)dx + (1 + u^2)(du - (u/x)dx)=0
(u^2/x)dx + (u/x)dx + du - (u/x)dx + (u^2)du - (u^3/x)dx = 0
(u^2)dx + xdu + (u^2x)du - (u^3)dx = 0

dx/x + (1+u^2)/(u^2 - u^3)du = 0

hence, dx/x = (1+u^2)/(u^3 - u^2)du, if we integrate it we'll have:

ln|x| = -ln|u| + ln|u+1| + ln|u-1| + C
ln|x| = ln|(u^2 - 1)/u| + lnC'

x = C(u^2 -1)/u -> x = C(xy - 1/(xy)).

but the book says that the final answer is ln|(1-xy)^2/y| + 1/(xy) = C. :|

Have I differentiated u correctly? I can't find out why my answer is incorrect.

2. Oct 20, 2011

vela

Staff Emeritus
Seems you made an algebra error somewhere. According to Mathematica, you should get
$$\frac{1+u^2}{u^3-u^2} = \frac{2}{u-1}-\frac{1}{u}-\frac{1}{u^2}$$

3. Oct 20, 2011

HallsofIvy

You seem to have factored $x^3- x^2$ as $x(x- 1)(x+ 1)$. That is incorrect: $x(x- 1)(x+ 1)= x^3- x$. Rather, factor out the full "$x^2$" to get $x^2(x- 1)$.

4. Oct 20, 2011

Thanks. but there is still a little problem. now I have:

ln|x| = 1/u - ln|u| + 2ln|1-u| + C -> ln|x| = 1/(xy) - ln|xy| + ln|(1-xy)^2| + C
ln|x| = 1/(xy) - ln|x| +ln|((1-xy)^2)/y| + C.

but I need to cancel out ln|x|. I'm sorry that I'm asking you to find my algebra errors, it's because I lack concentration now and when I make a naive algebra error I can't find it myself even if I double check everything I've done from the beginning.

5. Oct 20, 2011

vela

Staff Emeritus
I don't see anything wrong in your work. It could be the book's wrong or you copied the original problem down wrong.

6. Oct 20, 2011

SammyS

Staff Emeritus
ln(|xy|) = ln(|x||y|) = ln(|x|) + ln(|y|)

Then subtract ln(|x|) from both sides.