\[ y'(x)-e^{x-y(x)}+e^x=0 \] ✓ Mathematica : cpu = 0.0202831 (sec), leaf count = 18
\[\left \{\left \{y(x)\to \log \left (e^{c_1-e^x}+1\right )\right \}\right \}\]
✓ Maple : cpu = 0.192 (sec), leaf count = 20
\[ \left \{ y \left ( x \right ) =-{{\rm e}^{x}}+\ln \left ( -1+{{\rm e}^{{{\rm e}^{x}}+{\it \_C1}}} \right ) -{\it \_C1} \right \} \]
\begin {align} y^{\prime } & =e^{x-y}-e^{x}\nonumber \\ y^{\prime } & =e^{x}\left ( e^{-y}-1\right ) \nonumber \\ \frac {1}{e^{-y}-1}dy & =e^{x}dx\tag {1} \end {align}
Integrating both sides. \(\int \frac {1}{e^{-y}-1}dy\). Let \(e^{-y}=u\), then \(\frac {du}{dy}=-e^{-y}=-u\). Hence \(dy=-\frac {du}{u}\), therefore the integral becomes\[ \int \frac {1}{u-1}\left ( -\frac {du}{u}\right ) =-\int \frac {1}{u\left ( u-1\right ) }du \] But \(\frac {1}{u\left ( u-1\right ) }=-\left ( \frac {1}{u}-\frac {1}{u-1}\right ) \), hence\begin {align*} -\int \frac {1}{u\left ( u-1\right ) }du & =\int \left ( \frac {1}{u}-\frac {1}{u-1}\right ) du\\ & =\ln u-\ln \left ( u-1\right ) \\ & =\ln e^{-y}-\ln \left ( e^{-y}-1\right ) \\ & =-\left ( \ln \left ( e^{-y}-1\right ) -\ln e^{-y}\right ) \end {align*}
But \(\ln x-\ln y=\ln \left ( \frac {x}{y}\right ) \) and the above becomes\begin {align*} \int \frac {1}{e^{-y}-1}dy & =-\left [ \ln \left ( \frac {e^{-y}-1}{e^{-y}}\right ) \right ] \\ & =-\ln \left ( 1-e^{y}\right ) \end {align*}
Back to (1), when we integrate both sides, and since \(\int e^{x}dx=e^{x}+C\)\begin {align*} -\ln \left ( 1-e^{y}\right ) & =e^{x}+C\\ \ln \left ( 1-e^{y}\right ) & =-e^{x}+C_{1} \end {align*}
Hence\begin {align*} 1-e^{y} & =\exp \left ( -e^{x}+C_{1}\right ) \\ e^{y} & =1-\exp \left ( -e^{x}+C_{1}\right ) \end {align*}
Taking logs\[ y=\ln \left ( 1-\exp \left ( -e^{x}+C_{1}\right ) \right ) \] Let \(e^{C_{1}}=C_{2}\) then\[ y=\ln \left ( 1-C_{2}e^{-e^{x}}\right ) \] Verification
ode:=diff(y(x),x)=exp(x-y(x))-exp(x); my_sol:=log(1-_C1*exp(-exp(x))); odetest(y(x)=my_sol,ode); 0