Differentiating functions: Find the error