You have the separable differential equation
y' = 2y
with the boundary condition
y(0) = 2
It can be solved by integrating
∫(dy/y) = ∫(2dx)
ln(y) = 2x +c
The boundary condition tells you
ln(2) = 2·0 +c
so the constant is
c = ln(2)
and the equation is
ln(y) = 2x + ln(2)
Taking antilogs, we have
y = 2·e^(2x)