TITLE: Gradient of a function as the direction of steepest ascent/descent
QUESTION [5 upvotes]: I am trying to really understand why the gradient of a function gives the direction of steepest ascent intuitively.
Assuming that the function is differentiable at the point in question,
a) I had a look at a few resources online and also looked at this 
Why is gradient the direction of steepest ascent? , a popular question on this stackexchange site.
The accepted answer basically says that we multiply the gradient with an arbitrary vector and then say that the product is maximum when the vector points in the same direction as the gradient? This to me really does not answer the question, but it has 31 upvotes so can someone please point out what I am obviously missing?
b) Does the gradient of a function tell us a way to reach the maxima or minima? if yes, then how and which one - maxima or minima or both?
Edit: I read the gradient descent algorithm and that answers this part of my question.
c) Since gradient is a feature of the function at some particular point - am I right in assuming that it can only point to the local maxima or minima?

REPLY [5 votes]: Let’s try coming at it from a different direction, so to speak.  
Consider the plane in $\mathbb R^3$ given by $ax+by=z$. The vector $\mathbf n=\langle a,b,-1\rangle$ is normal to this plane. A bit of thought should convince you that the projection of $\mathbf n$ onto the $xy$ plane, $\langle a,b\rangle$, points in the direction in which this plane is steepest. It’s fairly straightforward to prove this analytically, but you can also see this by visualizing cutting a cylinder centered on the $z$-axis with this plane and imagining what happens to the high point of the cut as you tilt the plane in various directions. Displacing the plane from the origin doesn’t change its inclination, so $\langle a,b\rangle$ also gives the steepest direction for any other plane with the same normal, i.e., for $ax+by-z=c$.  
Moving now to a curved surface, by analogy with functions of one dimension, we define instantaneous rates of change in terms of tangents to the surface. We’re assuming that the function which defines our surface is suitably well-behaved, so all of these tangents lie in a well-defined tangent plane to the surface. Looking at it another way, this tangent plane captures the rates of change of the function in all directions. As above, then, a “downward” normal to this plane will give us the direction of fastest increase. All we need to do now is find such a normal vector.  
Let a surface in $\mathbb R^3$ be given by $F(x,y,z)=c$. Consider a curve $\gamma: t\mapsto(x(t),y(t),z(t))$ on this surface that passes through the point $P_0 = \gamma(0)$, so that we have $(F\circ\gamma)(t)=c$. (Again, we’re assuming that these functions are suitably well-behaved so that this parametrization exists.) Differentiating both sides with respect to $t$ and applying the chain rule gives $$F_x(P_0)x'(0)+F_y(P_0)y'(0)+F_z(P_0)z'(0)=\nabla F(P_0)\cdot\gamma'(0)=0.$$ Now, $\gamma'(0)$ is tangent to $\gamma$ at $P_0$ and thus lies in the tangent plane. Since $\gamma$ was arbitrary, we can conclude that $\nabla F$ is orthogonal to every tangent vector to the surface at $P_0$, i.e., that it is normal to the tangent plane.  
For a surface given by $z=f(x,y)$ this normal vector is $\langle f_x,f_y,-1\rangle$, and its projection $\nabla f$ thus points in the direction of steepest ascent along the surface, i.e., the direction in which $f$ increases fastest.  
Afterthought: Going back to the original plane example at the top, we can see why this result is plausible. A plane in $\mathbb R^3$ is completely specified by its $x$-slope/rate-of-change $a$, its $y$-slope $b$ and a point on the plane. For the tangent plane to the surface $z=f(x,y)$, these rates of change in the directions of the coordinate axes are given by the partial derivatives of $f$, which are encoded in its gradient.