Worked example: Derivative of cos³(x) using the chain rule