Apply the product rule:

----------------------------------------------------

----------------------------------------------------

EDIT: I factored that wrong. It should be:

I have no idea how I managed that. It's a good thing pickslides pointed that out.

So you were right about the derivative.