How do I solve differential equation $\frac{dy}{dx}=-2y+2$ if the begining value is $y(1)=2$? How do I solve differential equation $\frac{dy}{dx}=-2y+2$ if the begining value is $y(1)=2$?
What have I done?
$\frac{dy}{-2y+2}=dx$
$\frac{-1}{2}ln(-2y+2)=x+c$
$y=\frac{-1}{2}e^{-2xC}-2$
I get that C is $ln(2)+2$. Is this good?
Than I just need to put it in $y=\frac{-1}{2}e^{-2xC}-2$

Simplify your life by setting $y-1=z$, so the equation becomes
$$
z'=-2z,\qquad z(1)=1
$$
Thus we get $z=ke^{-2x}$ and $1=z(1)=ke^{-2}$, so $k=e^2$. Hence
$$
y=z+1=1+e^2e^{-2x}=1+e^{2-2x}
$$
Where are you going wrong? When you separate the variables, you get
$$
\frac{y'}{2-2y}=1
$$
but it's better to write it as
$$
\frac{y'}{y-1}=-2
$$
Since $y(1)=2$, the denominator is positive in a neighborhood of $1$, so integrating we get
$$
\ln(y-1)=-2x+c
$$
or
$$
y=1+e^{-2x+c}
$$
Plugging in $x=1$, we conclude $c=2$.
You went wrong not taking into account the signs.
