# Thread: differential equation with y^2

1. ## differential equation with y^2

Hello.

I'm stuck at this differential equation:
$\displaystyle x\cdot y'+y^{2}=1,$ $\displaystyle y(1)=0$

Not even sure where to start, because everything I tried failed.

Appreciate any help.

2. Did you try this?

$\displaystyle x y'+y^{2}=1$

$\displaystyle x y'= 1-y^{2}$

$\displaystyle \frac{dy}{dx}= \frac{1-y^{2}}{x}$

$\displaystyle \frac{dy}{1-y^{2}}= \frac{dx}{x}$

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

continue..

3. Originally Posted by pickslides
Did you try this?

$\displaystyle x y'+y^{2}=1$

$\displaystyle x y'= 1-y^{2}$

$\displaystyle \frac{dy}{dx}= \frac{1-y^{2}}{x}$

$\displaystyle \frac{dy}{1-y^{2}}= \frac{dx}{x}$

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

continue..
Ahh thank you I'll try to continue from there. I started in a similar way but I I'm so tired I accidentally swapped the $\displaystyle \frac{dy}{dx}$ to $\displaystyle \frac{dx}{dy}$

4. I got stuck again.
I got to:
$\displaystyle \frac{1}{2}ln(y+1)-\frac{1}{2}ln(y-1)=lnx+C$
How can I continue from here?

I know $\displaystyle y(1)=0$ but inserting 1 will not work here..

5. $\displaystyle \frac{1}{2}\ln(y+1)-\frac{1}{2}\ln(y-1)$

factor out $\displaystyle \frac{1}{2}$ then combine logs, let me know how you go.

6. Originally Posted by pickslides
$\displaystyle \frac{1}{2}\ln(y+1)-\frac{1}{2}\ln(y-1)$

factor out $\displaystyle \frac{1}{2}$ then combine logs, let me know how you go.
Alright. I got here now, not sure if I made any mistakes though there are so many steps.

$\displaystyle \frac{y+1}{y-1}=x^{2}+e^{2C}$

$\displaystyle y=\frac{x^{2}+e^{2C}+1}{x^{2}+e^{2C}-1}$

Is this correct? How can I use the $\displaystyle y(1)=0$ here?

7. Originally Posted by pumbster
Alright. I got here now, not sure if I made any mistakes though there are so many steps.

$\displaystyle \frac{y+1}{y-1}=x^{2}+e^{2C}$

$\displaystyle y=\frac{x^{2}+e^{2C}+1}{x^{2}+e^{2C}-1}$

Is this correct? How can I use the $\displaystyle y(1)=0$ here?
I solved it! I realized a made an error, it should of course be:
$\displaystyle y=\frac{x^{2}e^{2C}+1}{x^{2}e^{2C}-1}$

And I ended up with the answer:
$\displaystyle y = \frac{x^2-1}{x^2+1}$

Thank you so much for all the help! Really appreciated!

I was thinking

$\displaystyle \frac{1}{2}\ln(y+1)-\frac{1}{2}\ln(y-1) = \ln x +C$

$\displaystyle \frac{1}{2}\ln\frac{(y+1)}{(y-1)} = \ln x +\ln C$

$\displaystyle \ln\sqrt{\frac{(y+1)}{(y-1)}} = \ln x +\ln C$

$\displaystyle \ln\sqrt{\frac{(y+1)}{(y-1)}} = \ln (Cx)$

$\displaystyle \sqrt{\frac{(y+1)}{(y-1)}} = Cx$

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

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

.
.
.
.

$\displaystyle y = \frac{2}{Cx^2-1}+1$

Then use the initial condition $\displaystyle y(1)=0$ to find $\displaystyle C$