I need to find the first and second derivative of

g(x) = (e^x)/x.

I found g'(x) to be e^x(x-1)/(x^2).

I then found g"(x) to be (e^x)/x^3 but the book's answer is more involved.

According to the book, the complete answer is

(e^x)/(x^3) times (x^2-2x+2).

Where does the trinomial come from?