First of all you calculate dy/dx. To do this you look at each x individually. For the first x you multiply it by it's power and then minus 1 from the power to get 3x^2. Then multiply the next x by the power and minus 1 to get 4x. As 1 is the same as 1 multiplied by x^0, this means that you multiply 1 by 0 to get 0. Therefore dy/dx is 3x^2 + 4. Now substitute in x=3 to get dy/dx=31. This is the gradient.