Advertisements
Advertisements
Question
Advertisements
Solution
We have,
\[x\frac{dy}{dx} - y = \left( x - 1 \right) e^x \]
\[ \Rightarrow \frac{dy}{dx} - \frac{1}{x}y = \left( \frac{x - 1}{x} \right) e^x . . . . . \left( 1 \right)\]
Clearly, it is a linear differential equation of the form
\[\frac{dy}{dx} + Py = Q\]
where
\[P = - \frac{1}{x} \]
\[Q = \left( \frac{x - 1}{x} \right) e^x \]
\[ \therefore \text{I.F.} = e^{\int P\ dx} \]
\[ = e^{- \int\frac{1}{x} dx} \]
\[ = e^{- \log x} \]
\[ = \frac{1}{x}\]
\[\text{Multiplying both sides of } \left( 1 \right)\text{ by I.F.} = \frac{1}{x},\text{ we get }\]
\[\frac{1}{x} \left( \frac{dy}{dx} - \frac{1}{x}y \right) = \frac{1}{x}\left( \frac{x - 1}{x} \right) e^x \]
\[ \Rightarrow \frac{1}{x}\frac{dy}{dx} - \frac{1}{x^2}y = \left( \frac{x - 1}{x^2} \right) e^x \]
Integrating both sides with respect to x, we get
\[\frac{1}{x}y = \int\left( \frac{1}{x} - \frac{1}{x^2} \right) e^x dx + C\]
\[ \Rightarrow \frac{1}{x}y = \frac{e^x}{x} + C\]
\[ \Rightarrow y = e^x + Cx\]
\[\text{ Hence, }y = e^x + Cx\text{ is the required solution }.\]
