Not sure if this is a Calc or a trig question. But I wanted to take the derivative of this function:

Through simple steps I got:

However the answer in the book is...

So presumably my calculus is wrong, or I didn't simplify enough. I have tried various transformations but never quite end up with that. Can anybody show me how to simplify to that?