Using the chain rule to get the error
derivatives