Step 1: Use a new variable:
Let $z = e^{y}$. Then $\frac{dz}{dx} = e^{y}\frac{dy}{dx}$. The aim is to bring the given equation into a form with $\frac{dz}{dx}$ on one side.
Step 2: Convert the equation:
Multiply the given equation by $e^{y}$: $e^{y}\frac{dy}{dx} = e^{y}e^{x-y} + x^2e^{y}e^{-y}$. The powers of $e^{y}$ cancel, which leaves $\frac{dz}{dx} = e^{x} + x^2$.
Step 3: Integrate directly:
The right side no longer depends on $z$, so we simply integrate with respect to $x$: $z = e^{x} + \frac{x^3}{3} + c$. Put back $z = e^{y}$ to get $e^{y} = e^{x} + \frac{x^3}{3} + c$.
Step 4: Compare with the options:
This matches option (C). Option (B) has $x^3$ without the division by $3$. If we differentiate it we get $3x^2$ instead of $x^2$. Option (D) has $2x$, which differentiates to $2$, not $x^2$. Option (A) is not even in the form of $e^y$.
Final Answer:
With $z = e^y$, the answer is $e^y = e^x + \frac{x^3}{3} + c$, option (C).
\[ \boxed{e^y = e^x + \frac{x^3}{3} + c} \]