Calculate:

d/dx[(e^x + xsin(x))/(tan(x))]

I got this far:

[tan(x) * e^x + 1cos(x)]-[e^x + xsin(x) * sex^2(x)]/[tan(x)]

But my book says it's supposed to be;

[tan(x) * e^x + sin(x) + xcos(x)]-[e^x + xsin(x) * sex^2(x)]/[tan(x)]

How come those things...?