Using the chain rule