Solution (source code)

= Solution

For this <separable differential equation>, away from $x=1$, separation gives $\ln|y+1|=\ln|x-1|+C$, or $y+1=K(x-1)$ on a connected interval. The <initial condition> gives $2=-K$, hence
$$
\boxed{y=1-2x}.
$$
The maximal interval containing $x=0$ on which this solves the printed <differential equation> is $\boxed{-\infty<x<1}$. Although the linear formula extends through one, the right-hand side there is $0/0$ and the original equation is undefined. The <equilibrium> solution $y=-1$, lost if one divides by $y+1$, does not satisfy the <initial condition>.