I am learning about general solutions to differential equations and would like to ask whether my solution is mathematically correct.
I was asked to find the general solution to the differential equation
$$\frac{dy}{dx} = 2e^{x-y}$$
So I did the following -
$$\int e^y dy = 2\int e^x dx$$ $$e^y = 2 e^x + C $$ $$y = \ln (2 e^x + C) $$
Now, my book says that the solution in the form $y = f(x)$ is $y = \ln (2 e^x + C) $.
However, I progressed further and did the following:
$$y = \ln (2 e^x + C) $$ $$ = \ln (e^{{x}^{2}} + C) $$ $$y = x^2 + C' $$
where $C'$ is a modified constant from the original constant $C$.
Is this an acceptable solution?
You went wrong in two places. First you replaced $2e^x$ with $e^{x^2}$. It seems you were thinking about $2 \ln a= \ln (a^2)$, but note that the $2$ is outside the log here. Second, you are thinking that $e^{x^2}=(e^x)^2$, but the convention is that $e^{x^2}=e^{(x^2)}$ because you can replace $(e^x)^2$ by $e^{2x}$