General solution of the differential equation \(\displaystyle\frac{dy}{dx}=e^{\frac{x^2}{2}}+xy\) is
Answer & explanation
Correct answer: option 3
The correct answer is Option (3) → \(y = (x+c)e^{\frac{x^2}{2}}\), where c is constant of integration.
Moving the y-term to the left gives a linear differential equation \(\frac{dy}{dx} + Py = Q\):
\(\displaystyle \frac{dy}{dx} - xy = e^{\frac{x^2}{2}}\)
\(P = -x,\quad Q = e^{\frac{x^2}{2}}\)
\(\displaystyle \text{I.F.} = e^{\int -x\,dx} = e^{-\frac{x^2}{2}}\)
The solution is \(y \cdot \text{I.F.} = \int Q \cdot \text{I.F.}\,dx + c\):
\(\displaystyle y\,e^{-\frac{x^2}{2}} = \int e^{\frac{x^2}{2}}\cdot e^{-\frac{x^2}{2}}\,dx\)
\(\displaystyle = \int 1\,dx = x + c\)
\(y = (x + c)\,e^{\frac{x^2}{2}}\)
Shortcut: Differentiating the option checks it directly. For \(y = (x + c)e^{\frac{x^2}{2}}\):
\(\displaystyle \frac{dy}{dx} = e^{\frac{x^2}{2}} + (x + c)\,x\,e^{\frac{x^2}{2}} = e^{\frac{x^2}{2}} + xy\)