Find the derivative of each function.

Answer

- That product sin xcot x looks awfully suspicious. It can be simplified:

We can rewrite the function as

*f*(*x*) = *e*^{x}(*x*^{2} + 4*x*)cos *x*,

which has three factors instead of four. This is definitely an improvement. Since we have three factors we'll use the product rule twice. Break up the function as

*f*(*x*) = (*e*^{x}(*x*^{2} + 4*x*))(cos *x*).

Then the outermost application of the product rule says that

*f'*(*x*) = (*e*^{x}(*x*^{2} + 4*x*))'(cos *x*) + (*e*^{x}(*x*^{2} + 4*x*))(cos *x*)'.

We need to use the product rule again to find one of those derivatives:

(*e*^{x}(*x*^{2} + 4*x*))' = (*e*^{x})'(*x*^{2} + 4*x*) + *e*^{x}(*x*^{2} + 4*x*)'

= *e*^{x}(*x*^{2} + 4*x*) + *e*^{x}(2*x* + 4).

This can be simplified by factoring out *e*^{x}:

= e^{x}(*x*^{2} + 4*x* + 2*x* + 4)

=* e*^{x}(*x*^{2} + 6*x* + 4)

Now go back to the outermost application of the product rule.

*f'*(*x*) = (*e*^{x}(*x*^{2} + 4*x*))'(cos *x*) + (*e*^{x}(*x*^{2} + 4*x*))(cos *x*)'

= (*e*^{x}(*x*^{2} + 6*x* + 4))cos *x* + (*e*^{x}(*x*^{2} + 4*x*))(-sin *x*)

= (*e*^{x}(*x*^{2} + 6*x* + 4))cos *x*-(*e*^{x}(*x*^{2} + 4*x*))(sin *x*)

Since each term has a factor of e^{x}, we'll factor that out:

*f'*(*x*) = ({ *e*^{x}}(*x*^{2} + 6*x* + 4))cos *x*-({ e^{x}}(*x*^{2} + 4*x*))(sin *x*)

= { *e*^{x}}[(*x*^{2} + 6*x* + 4)cos *x*-(*x*^{2} + 4*x*)sin *x*]

And now we are done!