= Solution
Set $u=x+1$, so the equation is linear: $y'-y/u=1+2/u$, with $u\ne0$. An <integrating factor> is $1/u$ on either connected side of $u=0$. Thus
$$
\frac d{dx}\left(\frac yu\right)=\frac1u+\frac2{u^2},\qquad
\frac yu=\log|u|-\frac2u+C.
$$
Consequently the full real solution is
$$
\boxed{y=(x+1)\left(C+\log|x+1|\right)-2,\qquad x\ne-1.}
$$
The original equation is undefined at $x=-1$, so a continuation of the formula through that point is not a solution on an interval containing it. Constants can be chosen independently on the two separated domain components.
Back to article page