First Order ODE/exp x (1 + x) dx = (x exp x - y exp y) dy

Theorem
The first order ordinary differential equation:


 * $(1): \quad e^x \left({1 + x}\right) \mathrm d x = \left({x e^x - y e^y}\right) \mathrm d y$

has the solution:


 * $2 x e^x e^{-y} + y^2 + C$

Proof
Dividing $(1)$ through by $e^y$:
 * $(2): \quad \left({1 + x}\right) e^x e^{-y} \, \mathrm d x = \left({x e^x e^{-y} - y}\right) \mathrm d y$

Let $z = x e^x e^{-y}$.

Then:
 * $\dfrac {\mathrm d z} {\mathrm d x} = \left({1 + x}\right) e^x e^{-y} - x e^x e^{-y} \dfrac {\mathrm d y} {\mathrm d x}$

or:
 * $\mathrm d z = \left({1 + x}\right) e^x e^{-y} \, \mathrm d x - x e^x e^{-y} \, \mathrm d y$

Substituting $z$ and $\mathrm d z$ in $(2)$:
 * $\mathrm d z = \left({z - y}\right) \mathrm d y - z \, \mathrm d y = - y \, \mathrm d y$

which directly leads to:
 * $\displaystyle \int \, \mathrm d z = -\int y \, \mathrm d y$

from which:
 * $z = - \dfrac {y^2} 2 + k$

Substituting for $z$ and letting $C = 2 k$:
 * $2 x e^x e^{-y} + y^2 + C$