Solution (source code)

= Solution

On a branch with $y\ne0$, the given <derivative> is nonzero wherever the original equation is defined, so use <inverse-function linearization of a first-order equation> and regard $x$ as a <function> of $y$:
$$
\frac{dx}{dy}=\frac{x+y+2}{y},\qquad
\frac{dx}{dy}-\frac xy=1+\frac2y.
$$
The <integrating factor> $1/y$ gives
$$
\frac d{dy}\left(\frac xy\right)=\frac1y+\frac2{y^2},
\qquad \frac xy=\ln|y|-\frac2y+C.
$$
Thus the nonzero solutions are given implicitly by
$$
\boxed{x+2=y(\ln|y|+C),\qquad y\ne0.}
$$
Each branch must also retain \b[$x+y+2\ne0$]; at those excluded points the original right-hand side is undefined and the inverse graph cannot represent a regular $y(x)$. Differentiating the implicit equation gives $y'=1/(\ln|y|+C+1)$, equal to the required quotient wherever these restrictions hold.

The additional solution \b[$y=0$], on any interval avoiding $x=-2$, was lost when dividing by $y$ and must be included. It is not defined through the point $(x,y)=(-2,0)$ in the original equation.