To work out the gradient of a function f(x), we need to differentiate it with respect to x, to give us f'(x). If x = a at a point, then the gradient of f(x) at that point is f'(a) (substitute a in place of x in the equation). Each term of f(x) can be differentiated separately (one at a time) to give f'(x).
If another function g(x) = xn, the differential of the function g'(x) = nxn-1. We can apply this to our function f(x) by writing the power of x in each term (to make it easier).
f(x) = 2x2 + 3x1 -7x0
f'(x) = 22x1 + 31x0 -7*0x-1
f'(x) = 4x + 3
We then substitute our value of x into f'(x). x = -2, therefore f'(-2) = 4*-2 + 3 = -5.
The gradient of f(x) at x = -2 is -5.