What is the Gradient function?
The gradient function is a simple way of finding the slope of a function at any given point.
Usually, for a straight-line graph, finding the slope is very easy. One simply divides the "rise" by the "run" - the amount a function goes "up" or "down" over a certain interval. For a curved line, the technique is pretty similar - pick an interval, and calculate the amount of "rise" or "fall" the graph undergoes over this interval. We want to make the interval rather small, however - otherwise we can end up with some pretty funny values!
Take, for instance, the function of sin(x). We know that
#sin(0) = 0# #sin(pi) = 0#
If we were to calculate rise/run in this case, we'd get