The general solution of the differential equation \(\displaystyle\frac{dy}{dx} - \frac{y}{x} = xe^x\), \(x \gt 0\), is
Answer & explanation
Correct answer: option 3
The correct answer is Option (3) → \(y = xe^x + Cx\)
This is a linear equation \(\frac{dy}{dx} + Py = Q\) with
\( \displaystyle P = -\frac{1}{x}, \quad Q = xe^x \)
The integrating factor is
\( \displaystyle e^{\int P\,dx} = e^{-\log x} = \frac{1}{x} \)
The solution is \(y \cdot \text{IF} = \int Q \cdot \text{IF}\,dx + C\):
\( \displaystyle \frac{y}{x} = \int xe^x \cdot \frac{1}{x}\,dx = \int e^x\,dx \)
\( \displaystyle \frac{y}{x} = e^x + C \)
Multiplying by x:
\( y = xe^x + Cx \)