General solution of the differential equation \( \displaystyle\frac{dy}{dx}=e^{\frac{x^2}{2}}+xy \) is:
(where C is an arbitrary constant)
Answer & explanation
Correct answer: option 4
The correct answer is Option (4) → \( y=(x+\mathrm{C})e^{\frac{x^2}{2}} \)
The equation is linear, of the form \( \frac{dy}{dx}+Py=Q \):
\( \displaystyle \frac{dy}{dx}-xy=e^{\frac{x^2}{2}} \)
\( \displaystyle 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+\mathrm{C} \):
\( \displaystyle y\,e^{-\frac{x^2}{2}}=\int e^{\frac{x^2}{2}}\cdot e^{-\frac{x^2}{2}}\,dx+\mathrm{C} \)
\( \displaystyle =\int 1\,dx+\mathrm{C} \)
\( \displaystyle =x+\mathrm{C} \)
\( \displaystyle y=(x+\mathrm{C})e^{\frac{x^2}{2}} \)
Shortcut: Differentiate Option (4): \( y'=e^{\frac{x^2}{2}}+(x+\mathrm{C})\,x\,e^{\frac{x^2}{2}}=e^{\frac{x^2}{2}}+xy \), which is exactly the given equation.