# Thread: differential equation with y^2

1. ## differential equation with y^2

Hello.

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

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

Appreciate any help.

2. Did you try this?

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

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

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

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

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

continue..

3. Originally Posted by pickslides
Did you try this?

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

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

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

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

$\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 $\frac{dy}{dx}$ to $\frac{dx}{dy}$

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

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

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

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

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

factor out $\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.

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

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

Is this correct? How can I use the $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.

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

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

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

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

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

I was thinking

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

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

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

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

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

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

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

.
.
.
.

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

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