Show by substitution $z=xe^y$ that $x \dfrac{dy}{dx} = e^{-(x+y)} - 1 -x$ reduces to $\dfrac{dz}{dx} + z = e^{-x}$ I've been trying to work this out but can't seem to find the way to do it. 
Show by the substitution of $z=xe^y$ that
$x \dfrac{dy}{dx} = e^{-(x+y)} - 1 -x$ 
reduces to 
$\dfrac{dz}{dx} + z = e^{-x}$
And once this has been shown, find the particular solution to the original differential equation for $y(1) = -1$
 A: In view of your comments, let me try address the question by properly interpreting the problem.
You're given the differential equation $xu'(x)=e^{-x-u(x)}-1-x$.
Let $y$ be a differentiable function.
Now consider a new function $z$, given by $z(x)=xe^{y(x)}$.
The problem now asks you to prove that for all $x$ in a certain interval $I$ which contains $1$ (because of the initial condition), the following holds: $$xy'(x)=e^{-x-y(x)}-1-x\iff z'(x)+z(x)=e^{-x}\tag{EQ}$$
Due to divisions by $x$ that will be performed, it's better to assume from the start that $0\not \in I$.
Given $x\in I$, some useful facts are:


*

*$z(x)\neq 0$;

*$z'(x)=e^{y(x)}+xy'(x)e^{y(x)}=(1+xy'(x))e^{y(x)}$, which is equivalent to

*$z'(x)e^{-y(x)}-1=xy'(x)$;

*Since $z(x)=xe^{y(x)}\iff e^{-y(x)}=\dfrac x{z(x)}$, the line above is equivalent to

*$xy'(x)=z'(x)\dfrac{x}{z(x)}-1$


Now I'll prove the equivalence $(\text{EQ})$.
$\boxed{\implies}$
Suppose $xy'(x)=e^{-x-y(x)}-1-x$. The fifth bullet above justifies the first equality below, while the third bullet justifies the last equality:
$$z'(x)\dfrac x{z(x)}-1=e^{-x-y(x)}-1-x=e^{-x}e^{-y(x)}-1-x=e^{-x}\dfrac x{z(x)}-1-x.$$
So $$z'(x)\dfrac x{z(x)}=e^{-x}\dfrac x{z(x)}-x.$$ 
Thus  $z'(x)+z(x)=e^{-x}$, as required.
$\boxed{\Longleftarrow}$ Since all of the above are actually equivalences, this follows immediately. You should verify this. Note further that this direction is the one that actually matters because it tells you that if $z$ is a solution of $u'+u=\dfrac 1\exp$, then $y$ given by $y(x)=\log \left(\dfrac{z(x)}x\right)$ is a solution to the original differential equation.
I'll leave actually solving the differential equation to you.
A: $$z=xe^y\implies \frac{dz}{dx}=e^y+xe^y\frac{dy}{dx}=e^y(1+x\frac{dy}{dx})$$
$$\implies x\frac{dy}{dx}=e^{-y}\frac{dz}{dx}-1=\frac xz\frac{dz}{dx}-1\  \ \ \ (1)$$
and $$e^{-(x+y)}-1-x=e^{-x}\cdot\frac xz-1-x\ \ \ \  (2)$$
Equate  $(1),(2)$  and multiply either sides by $z$
