Differential Equation Question

Hi again, not posted in a while but started my degree course now and getting back into the swing of things.

Anyway, I was reading ahead in the differential equations module and had a go at a couple of questions. Not got any answers for them though so if someone would be kind enough to take a quick look would be appreciated :)

Solve $\displaystyle xy' + x +y = e^x$

First divide through by x, $\displaystyle y' + x^{-1}y = x^{-1}e^x - 1$

Then using the integrating factor of $\displaystyle e^{\int{\frac{1}{x}}}$, I get the following equation:

$\displaystyle xy' + y = e^x - x$

Integrating both sides gives me:

$\displaystyle xy = e^x - \frac{x^2}{2} + C$

Which can be tidied up to give $\displaystyle y = \frac{e^x}{x} - \frac{x}{2} + \frac{C}{x}$

Just realised that if I had spotted the implicit differentiation I could have saved myself a lot of time, however is my rather long winded attempt still ok?

Thanks

Craig