First order differential equation (difficulties in understanding the solution) Problem
I need to solve differential equation which is defined as:
$$ y'=2+y,\quad y(0)=2 $$
Attempt to solve
Now we could write the equation in form of:
$$ \frac{dy(x)}{dx}=y(x)+2$$
Divide by $y(x)+2$
$$ \frac{\frac{dy(x)}{dx}}{y(x)+2}=1 $$
Now integral both sides
$$ \int{\frac{\frac{dy(x)}{dx}}{y(x)+2}}dx = \int{1} dx $$
Now here is the part i don't understand. This should equal the following:
$$ \int{\frac{1}{y+2}}dy=\int{1}dx $$
Solving left side with u-substitution shouldn't be problematic but the problem is i don't have good understanding what's going on here ? How do you get
$$ \int{\frac{\frac{dy(x)}{dx}}{y(x)+2}}dx=\int{\frac{1}{y+2}}dy $$
Another thing i don't understand is the notation used in the problem. there is $y(0)=2$ what i am suppose to do with this information ?
The solution set for this equation is:

But again i don't think i can fully understand this. 
If someone could provide some explanation whats going on here that would be highly appreciated. 
 A: As written the symbol $y$ is doing double duty: as the indeterminate function in the original differential equation, and as the variable of substitution. To untangle what's going on here, it might help to introduce a new symbol for the substitution variable. Your integral is
$$\int \frac{\frac{d}{dx} y(x)}{y(x) + 2} dx .$$
Substituting $$u = y(x) , \qquad du = \frac{d}{dx} y(x) \, dx ,$$
(here, as usual, we have computed $du$ using the chain rule) gives that the integral is
$$\int \frac{du}{u + 2} = \log\left\vert u + 2 \right\vert + C' = \log\left\vert y(x) + 2 \right\vert + C'.$$

Separately, note that we can change simplify slightly our original equation before separating variables, by writing $v(x) = y(x) + 2$. Then, $v'(x) = y'(x)$ and we can write the original equation as $$v'(x) = v(x) .$$
A: $$\int{\frac{\frac{dy(x)}{dx}}{y(x)+2}}dx=\int{\frac{1}{y(x)+2}\cdot \frac{dy(x)}{dx}}dx=\int\frac{1}{y(x)+2}dy(x)$$
$dx$ in the numerator simplifies with $dx$ in the denominator
which can be written, for brevity, $$\int{\frac{1}{y+2}}dy$$  but the meaning is the same.
$$\int{\frac{1}{y+2}}dy=\int\,dx$$ 
$$\log(y+2)=x+C$$
Hope this helps
$$y+2=e^{x+C}$$
to determinate $C$ you substitute $x=0$ and get
$2+2=e^C\to C=\log 4$
so the solution which solves the differential equation is
$$y=4e^x-2$$
A: You can solve this equation with an integration factor.
$$y'(x)=2+y(x)$$
$$e^{-x}y'(x)=e^{-x}(2+y(x))  $$
Now write one side as a derivative:
$$\Rightarrow (y(x)e^{-x})'=2e^{-x}$$
Now we just integrate, I renamed the variable to $\alpha$ to clarify its just a dummy variable. $x_0$ is just a constant.
$$\Rightarrow \int_{x_0}^x (y(\alpha)e^{-\alpha})'d\alpha=\int_{x_0}^x2e^{-\alpha}d\alpha$$
Integrate the expression:
$$y(x)e^{-x}-y(x_0)e^{-x_0}=-2e^{-x}+2e^{-x_0}.$$
This solution is not unique, it still has a constant that can have different values. Luckily we have given an initial condition $y(0)=2$. So, when we use it we get a unique solution. 
Just put $x_0=0$ and simplify the expression above:
$$y(x)e^{-x}-2=-2e^{-x}+2 \Rightarrow y(x)=-2+4e^x.$$
