Solivng differential equation by subtracting Y. I have the equation $$ \frac{dy}{dx} = y + 2$$ And normally u would isolate the y's and the x's but what if I subtract y and then solve the equation. That would like the following. $$ \frac{dy}{dx} - y =2 $$ $$ 
 \int(\frac{dy}{dx} - y)dx = \int2dx$$ $$ \int\frac{dy}{dx}dx - \int ydx = \int 2dx $$ $$ \int1dy - \int ydx = \int2dx $$ $$ y - yx = 2x + C$$ $$ y = \frac{2x+C}{1-x}$$ But when you check this u get an equation where your only solution that works is when x=0. What am is wrong with the math.

$$\frac{dy}{dx} - y =2$$
Multiply by $e^{-x}$ then you can integrate both sides:
$$\frac{dy}{dx}e^{-x} - ye^{-x} =2e^{-x}$$
$$\int \left(\frac{dy}{dx}e^{-x} - ye^{-x}\right)dx =2\int e^{-x} dx$$
$$\int (ye^{-x})'dx =2\int e^{-x} dx$$
$$\int d(ye^{-x}) =2\int e^{-x} dx$$
$$ye^{-x}=-2 e^{-x} +C$$
$$y(x)=-2+ Ce^{-x} $$
