Answer
$ye^y=e^x(x-1)+C_1$
Work Step by Step
We are given:
$$(1+y)y'=xe^{(x-y)}$$
Rewrite as:
$$(1+y)\frac{dy}{dx}=xe^xe^{-y}$$
Integrating both sides:
$$\int e^y(1+y)dy=\int xe^xdx$$
To solve the left side, assume that $u=1+y \rightarrow du=dy$
And $dv=e^ydy \rightarrow v=e^y$
The equation becomes:
$$e^y(1+y)-\int e^ydy=e^y(1+y)-e^y=ye^y+C$$
Doing same shift for the right side:
$$\int xe^xdx=xe^x-e^x+C$$
The equation becomes:
$$\int e^y(1+y)dy=\int xe^xdx$$
$$ye^y+C=xe^x-e^x+C$$
$$ye^y=e^x(x-1)+C_1$$
The general solution is $ye^y=e^x(x-1)+C_1$