TITLE: Am I using the right substitution to solve this differential equation?
QUESTION [5 upvotes]: I want to find the general solution of the following:
$$\frac{dy}{dx} = \frac{y}{x+y+2}$$
I substitute $u = x + y+2$ and got the following $du/dx = 1 + dy/dx$.
Then I got an expression as such:
$$\frac{du}{dx} = 2 - \frac{x+2}{u}$$
But from this expression,  I cannot seem to separate it further. Using an integrating factor also doesn't seem to work. It also doesn't have the form of a bernoulli's equation, due to the $+2$.
How should I further proceed?

REPLY [3 votes]: To solve
$$
\frac{\mathrm{d}y}{\mathrm{d}x}=\frac{y}{x+y+2}
$$
we can substitute $u=x+2$:
$$
\frac{\mathrm{d}y}{\mathrm{d}u}=\frac{y}{u+y}
$$
Then simple manipulation gives $y\,\mathrm{d}u-u\,\mathrm{d}y=y\,\mathrm{d}y$; therefore,
$$
\begin{align}
\mathrm{d}\frac uy
&=\frac{y\,\mathrm{d}u-u\,\mathrm{d}y}{y^2}\\
&=\frac{\mathrm{d}y}y\\[6pt]
&=\mathrm{d}\log(y)
\end{align}
$$
Solving yields
$$
x+2=y(c+\log(y))
$$