We begin by addressing the differential equation: \(\frac{dy}{dx} - xy = e^{\frac{x^2}{2}}\). This is a first-order linear differential equation in standard form \(\frac{dy}{dx} + P(x)y = Q(x)\), where \(P(x) = -x\) and \(Q(x) = e^{\frac{x^2}{2}}\).
To solve this, we find an integrating factor \(\mu(x) = e^{\int P(x) dx}\). Here, \(\int P(x) dx = \int -x dx = -\frac{x^2}{2}\). Thus, the integrating factor is \(e^{-\frac{x^2}{2}}\).
Multiplying the entire differential equation by this integrating factor gives:
\(e^{-\frac{x^2}{2}}\frac{dy}{dx} - xe^{-\frac{x^2}{2}}y = e^{-\frac{x^2}{2}}e^{\frac{x^2}{2}}\).
This simplifies to:
\(e^{-\frac{x^2}{2}}\frac{dy}{dx} - xe^{-\frac{x^2}{2}}y = 1\).
The left side is now the derivative of the product \(y \cdot e^{-\frac{x^2}{2}}\):
\(\frac{d}{dx}(ye^{-\frac{x^2}{2}}) = 1\).
Integrating both sides with respect to \(x\) gives:
\(ye^{-\frac{x^2}{2}} = \int 1 \, dx = x + C\), where \(C\) is the integration constant.
Solving for \(y\), we multiply through by \(e^{\frac{x^2}{2}}\):
\(y = (x + C)e^{\frac{x^2}{2}}\).
This is the general solution to the differential equation.
Thus, the correct answer is \(y = (x + c)e^{\frac{x^2}{2}}\), where \(C\) is a constant.