$xy' + 1 = e^{x-y}$ I need help solving this differential equation
$xy' + 1 = e^{x-y}$
I wrote this as $xe^ydy = (e^x-e^y)dx$ and tried finding integrating factor but unsuccessfully. Any help will be much appreciated. I found this problem from entrance exam for some university 
 A: Multiplying by $e^y$ gives $$xy'e^y+e^y=\frac{d}{dx}(xe^y)=e^x,$$so we get the general solution $$y=\ln\frac{e^x+C}x,$$ immediately.
A: From the way you have written your ODE, it is very likely that you were trying to solve your problem as an exact differential equation. Hence, I will continue using your approach.

As you have written it, there is no need to find an integrating factor. Recall that given functions $P (x,y) $ and $Q (x,y) $ with continuous partial derivatives in a certain domain $D $, the equation $P (x,y)~dx+Q (x,y)~dy=0$ is exact if and only if:
$$\frac {\partial P}{\partial y}=\frac {\partial Q}{\partial x} $$
Here, we have $P(x,y)=e^y-e^x $ and $Q (x,y)=xe^y $, and the condition satisfies. 
Now just apply the standard procedure to solve such.
A: $$e^{x-y}=\frac{e^x}{e^y}$$hence $$xy' + 1 = \frac{e^x}{e^y}\implies xy'e^y+e^y=e^x$$set $y=\ln u,e^y=u,y'=\frac {u'}u$ to get $$x\frac{u'}uu+u=e^x\implies xu'+u=e^x$$also note that $\dfrac{d}{dx}(xu)=xu'+u$ so we get $$\dfrac{d}{dx}(xu)=e^x\implies xu=\int e^x=e^x+c\implies u=\frac{e^x+c}{x}$$now remember that $y=\ln u$ to get $$\boxed {y=\ln\left(\frac{e^x+c}{x}\right)}$$
A: Hint 
Substitute $y=\ln(f(x))$ and $f(x)=e^y$
Then equation become simple...
I got 
$$f'+\frac f x= \frac {e^x} x$$
$$xf'+ f =  {e^x}$$
$$(xf)' =  {e^x}$$
$$f=\frac {e^x+K} x$$
$$y =\ln(f)=\ln (\frac {e^x+K} x)$$
A: We need to solve $$xy' + 1 = e^{x-y}$$ First multiply both sides by $e^{y}$ to get $$xy'e^{y} + e^{y} = e^{x}$$ Then notice that the left side is a total derivative
$$ (xe^{y})' = e^{x}$$ Integrate both sides to get $$ (xe^{y}) = e^{x} +C$$ Divide both sides by $x$ to get $$ e^{y} = (e^{x} +C)/x$$ Therefore $$ y = ln((e^{x} +C)/x).$$
