I have difficulties to solve these two differential equations:
1) $ y'(x)=\frac{x-y(x)}{x+y(x)} $ with the initial condition $ y(1)=1 $ .I'm arrived to prove that $$ y=x(\sqrt{2-e^{-2(\ln x+c)}}-1) $$ but I don't know if it's correct. If it's right, how do I find the constant $ c $? Because WolframAlpha says that the solution is $ y(x)=\sqrt{2}\sqrt{x^2+1}-x $.
2) $ y'(x)=\frac{2y(x)-x}{2x-y(x)} $ . I'm arrived to prove that $ \frac{z-1}{(z+1)^3}=e^{2c}x^{2} $ but I don't know if it's correct. If it's right, how do I explain $ z $ to substitute it in $ y=xz $? Then, how do I find the constant $ c $ ?
Thanks for any help!
$$y'(y+x)=x-y$$ $$y'x+y=x-y'y$$ $$(xy)'=x-\frac 12 (y^2)'$$ Integrate $$xy=\frac 12 x^2-\frac 12y^2+C$$ $$y^2-x^2+2xy=C$$ Evaluate the constant : $$y(1)=1 \implies C=2$$ $$(y+x)^2=2(x^2+1)$$ Finally, $$\boxed {y(x)=\sqrt {2(x^2+1)}-x}$$
You are on the right track $$y=x(\sqrt{2-e^{-2(\ln x+c)}}-1)$$ $$y=x(\sqrt{2-\frac {e^{-2c}}{x^2}}-1)$$ Note that $e^{-2c}=k$ $$y=\sqrt{2x^2-k}-x$$ $$y=\sqrt{2x^2+2}-x$$