Concept:
When the equation contains \(e^{-y}\), multiply the equation by \(e^y\) because:
\[
e^y\frac{dy}{dx}=\frac{d}{dx}(e^y)
\]
Step 1: Given:
\[
\frac{dy}{dx}=e^{x-y}+x^2e^{-y}
\]
Step 2: Rewrite the right side.
\[
e^{x-y}=e^x e^{-y}
\]
So:
\[
\frac{dy}{dx}=e^x e^{-y}+x^2e^{-y}
\]
\[
\frac{dy}{dx}=e^{-y}(e^x+x^2)
\]
Step 3: Multiply both sides by \(e^y\).
\[
e^y\frac{dy}{dx}=e^x+x^2
\]
Step 4: Observe that:
\[
e^y\frac{dy}{dx}=\frac{d}{dx}(e^y)
\]
Therefore:
\[
\frac{d}{dx}(e^y)=e^x+x^2
\]
Step 5: Integrate both sides with respect to \(x\).
\[
\int d(e^y)=\int (e^x+x^2)\,dx
\]
\[
e^y=e^x+\frac{x^3}{3}+c
\]
Therefore,
\[
\boxed{e^y=e^x+\frac{x^3}{3}+c}
\]