TITLE: Solving the differential equation $\frac{dy}{dt}=e^{t-y}$
QUESTION [5 upvotes]: I am working on the equation 
$$\frac{dy}{dt}=e^{t-y},\qquad y(0) = 1$$ 
This is what I have tried to get it to its exact solution:
$$\frac{dy}{dt}=e^{t}e^{-y}$$
$$\frac{1}{e^{-y}}dy=e^{t}dt$$
$$e^{y}dy=e^{t}dt$$
$$\int e^{y}dy=\int e^{t}dt$$
$$e^{y}=e^{t}+C $$
$$e^{1}-e^{0}=C <y=1, t=0>$$
$$e^{1}-1=C$$
going back:
$$e^{y}=e^{t}+\ln(e^{1}-1) $$
$$\ln(e^{y})=\ln(e^{t}+e-1) $$
$$y=\ln(e^{t}+e-1)$$
Latex made me see my problem, Thank you for helping if you answered!

REPLY [4 votes]: You're fine until you tried to take logarithms of both sides. First, you do not know that $C>0$ initially, so that step may not even make sense. Second, more importantly, it is not true that $\ln(e^y - e^t) = \ln(e^y) - \ln(e^t)$. Instead you should leave $e^t$ on the other side, and do:
$$e^y = e^t + C \\
\ln(e^y) = \ln(e^t + C) \\
y = \ln(e^t + C)$$

REPLY [3 votes]: Your mistake was where you went:
$$e^{y}-e^{t}=C \implies \ln(e^{y})-\ln(e^{t})=C$$
Instead, you should have:
$$e^{y}-e^{t}=C \implies \ln(e^{y}-e^{t})=C$$
(I would plug in the values for $y$ and $t$ in the RHS of the implication above.  No need to solve further for $C$.)