# Please tell me what I did wrong when solving this DE

1. Sep 3, 2013

### asdfghhjkl

Hello everyone,

I have a brief question. I am trying to solve the following simple differential equation:
$x\dfrac{dy}{dx}= y^2-1$
I manage to solve it one way, but when I try to solve it in the following way, I cannot get the correct answer. I would really appreciate if someone could point out my mistake :)

$\dfrac{dy}{y^2-1}= \dfrac{dx}{x}$
Rewriting the fraction on the left as the sum of two fractions
$\dfrac{1}{2}(\dfrac{-1}{y+1}+\dfrac{1}{y-1})dy= \dfrac{dx}{x}$
Integrating both sides:
$\dfrac{1}{2}∫(\dfrac{-1}{y+1}+\dfrac{1}{y-1})dy= ∫\dfrac{dx}{x}$
$\dfrac{1}{2}∫(-1ln(y+1)+ln (y-1))dy= ln(x)+c$
$\dfrac{1}{2} ln(\dfrac{y-1}{y+1})= ln(x)+c$
It is given that when x=1, y=0, thus c=0
$\dfrac{1}{2} ln(\dfrac{y-1}{y+1})= ln(x)$
$\dfrac{y-1}{y+1}= x^2$
Which gives:
$y= \dfrac{1+x^2}{1-x^2}$
But, he correct result is:
$y= \dfrac{1-x^2}{1+x^2}$

I would really appreciate if anyone could point out the mistake. Thank you. :)

2. Sep 3, 2013

### Tanya Sharma

Hi asdfghhjkl

Welcome to Physicsforums !!!

$\dfrac{y-1}{y+1}= x^2$ should be $\dfrac{|y-1|}{|y+1|}= x^2$

and this will give you $\dfrac{1-y}{y+1}= x^2$ .You can check that from the initial conditions.

Remember ∫(1/x)dx =ln|x|.

3. Sep 3, 2013

### asdfghhjkl

Oh, I see thank you very much for your help :)