Finding the derivative of a composite function by the chain rule