Calculate the derivative using the appropriate rule or combination of rules.