In your code you have asked for the derivative of the constant 1, and of course its derivative will be zero. You need to find the expression for the derivative of f with respect to x and only then evaluate it for x = 1. That is, do diff(f,x) first, then find its numerical value at x = 1.
Best Answer