proving gradient of a function is always perpendicular to the contour lines Can someone give an explanation of how such a proof would go, given a function
example:   $y = f(x)$
 A: Here's a hint / outline of a proof:
Consider the contour line (or more generally contour-hypersurface) $L := \{ x | f(x) = M \}$ for a given constant $M.$ Pick an $a\in L$. Let $I \subseteq \mathbb R$ be an interval containing $0$ and $c:I\rightarrow L$ a smooth curve that runs inside of $L$ such that $c(0) = a.$ Then, by construction, we have $f(c(t)) = M$ for all $t \in I.$ This implies
$$
0 = \frac{d}{dt}f(c(t)) = grad\ f(c(t)) \cdot c'(t)
$$
where $c'(t)$ is the tangent vector at $c$ in the point $c(t).$ By setting $t = 0,$ we see that $grad\ f(a)$ is orthogonal to every tangent vector at $L$ in $a$ (we can choose $c$ such that $c'(0)$ is any given tangent vector at $L$ in $a$). This means that $grad\ f(a)$ is perpendicular to $L$ in $a,$ as desired.
A: I have an intuitive (not formal, just to get a good image) answer for you: What is a gradient? It is the direction of fastest increase for the  function $g$. What is a contour line? It is a line on which $g$ has the same value everywhere. But what direction must the gradient have with respect to the contour line to prevent the function $g$ from changing its value? - Perpendicular.
A: Gradient Vector and level curves
The gradient vector is orthogonal to the tangent vector of a level curve.
Proof.  Intuitively as the greatest value of the directional derivative is in the direction of the gradient vector it seems logical that the steepest slope would be across rather than parallel to a contour line.
The following is a mathematical proof to confirm this.
$y=f_x$
The slope of the tangent is           $f_x^1$
The equivalent level curve is
$$z=0=f_x-y$$
$$∇f_xy=<├ ∂/(∂x,)-1>$$
The slope of this vector is the "$j$" component over the "$I$" component
$(-1)/(∂/∂x)$
This is at right angles to $f_x^1$
eg    $y=2x^2$
slope$= 4x$
level curve is 
$$z=0=2x^2-y$$
$$∇f_xy=<├ 4x-1>$$
slope$=(-1)/4x$
