Proving $\frac{2(1+y)\sqrt{1+x}+y\sqrt{1+y}}{2(1+x)\sqrt{1+y}+x\sqrt{1+x}} = \frac{1}{(1+x)^2}$ with $x\sqrt{1+y}+y\sqrt{1+x}=0$ I want to find $\frac{dy}{dx}$ in $x\sqrt{1+y}+y\sqrt{1+x}=0$ and I proceed through 2 different ways expecting the same answer.
Method:-1
$x\sqrt{1+y}=-y\sqrt{1+x}$
$\implies x^2(1+y)=y^2(1+x)$
$\vdots$
$\implies y=-1+\frac{1}{1+x}$
$$\frac{dy}{dx}=\frac{-1}{(1+x)^2}$$
Method:-2
$\phi(x,y)=x\sqrt{1+y}+y\sqrt{1+x}=0$
$$\frac{dy}{dx}=-\frac{\frac{\partial {\phi}}{\partial x}}{ \frac{\partial {\phi}}{\partial y}  }$$
$$\frac{dy}{dx}=-\frac{2(1+y)\sqrt{1+x}+y\sqrt{1+y}}{2(1+x)\sqrt{1+y}+x\sqrt{1+x}}$$
But I could not find any way to convert $\frac{2(1+y)\sqrt{1+x}+y\sqrt{1+y}}{2(1+x)\sqrt{1+y}+x\sqrt{1+x}}$ to
$\frac{1}{(1+x)^2}$.
Thank you for your help!

Your expression is $$\frac{2(1+y)\sqrt{1+x}+y\sqrt{1+y}}{2(1+x)\sqrt{1+y}+x\sqrt{1+x}}$$
Taking $\sqrt{1+y}$ common from numerator and $\sqrt{1+x}$ common from denominator, we get $$\frac{\sqrt{1+y}}{\sqrt{1+x}}\cdot\frac{2\sqrt{1+y}\sqrt{1+x}+y}{2\sqrt{1+x}\sqrt{1+y}+x}$$
Given that $x\sqrt{1+y}+y\sqrt{1+x}=0\implies\frac{\sqrt{1+y}}{\sqrt{1+x}}=-\frac yx$. Also, $\sqrt{1+x}\sqrt{1+y}=-\frac yx(1+x)$. Putting these in the working expression, we get $$-\frac yx\cdot\frac{-2\frac yx(1+x)+y}{-2\frac yx(1+x)+x}\\=-\frac yx\cdot\frac{-2y-2xy+xy}{-2y-2x+x^2}\\=\frac {y^2}x\cdot\frac{x+2}{-2y-2x+x^2}$$
Since our objective is to obtain the final answer only in $x$, so, we have to take out the value of $y$ solely in terms of $x$ the way you have done in your first method. So, putting $y=-1+\frac{1}{1+x}$ here, our expression does reduce to the following$$\frac1{(1+x)^2}$$
