Key idea: The function y is a sum of two terms. The first is x3 times the variable power (cosx)x, so we need logarithmic differentiation for (cosx)x and then the product rule. The second term needs the chain rule.
Step 1 — Differentiate (cosx)x.
Let u=(cosx)x, taken where cosx>0. Taking the natural logarithm brings the power down.
logu=xlogcosx
By the product rule, the derivative of xlogcosx is logcosx+x⋅cosx−sinx.
u1dxdu=logcosx−xtanx
dxdu=(cosx)x(logcosx−xtanx)
Step 2 — Differentiate x3(cosx)x by the product rule.
The derivative of x3 is 3x2, and the derivative of (cosx)x comes from Step 1.