Which direction climbs fastest?
The question
At P = (−1, −0.5) on a contour map, which direction gives the greatest initial rise per unit distance?
Place an arrow before opening the calculation.
- 1 SeePlace an uphill arrow on a map.
- 2 TryTest a step and meet three goals.
- 3 ProveBuild the maximum-rate argument.
- 4 ApplySolve five problems.
Before you start · 3 quick checks on partial derivatives, dot products, and length
Two ideas before you start
2 ideasCollect the coordinate slopes
The slice x² + 1 and its tangent at the selected x-coordinate.
For f(x, y) = x² + y², hold y = 1 and move along the slice. The gradient collects both coordinate slopes.
Exact definition
For a differentiable real-valued function of two variables, its gradient at a point P is \(\nabla f(P)=(f_x(P),f_y(P))\). The symbol \(\nabla\), read “nabla,” packages the partial derivatives into a vector. Its entries depend on where P is. The partial derivatives lesson explains how each entry measures the slope of a coordinate slice.
Compare directions at the same speed
A vector v and the unit vector pointing the same way.
Divide a nonzero vector by its length to keep its direction and give it unit length. Otherwise a faster walker can appear to have a better direction.
Exact definition
Use perpendicular Cartesian axes with the same distance unit. For a vector v, \(\|v\|=\sqrt{v_x^2+v_y^2}\). A unit direction u has \(\|u\|=1\). Starting at P, the path \(P+tu\) travels one unit of distance in the coordinate plane per unit of t. The directional derivative is
\[D_u f(P)=\lim_{t\to0}\frac{f(P+tu)-f(P)}{t}.\]It measures the initial rate along that straight path. For \(v\ne0\), normalize with \(u=v/\|v\|\). The dot product lesson supplies the vector arithmetic used below.
Fine print: what distance means here
Throughout the lesson, f is differentiable at the interior point under discussion, and every nearby direction is allowed. Distance means Euclidean distance in the input plane. On a terrain map, it is horizontal map distance, not distance along the sloping ground. The two map axes have equal scales. If coordinates represent different quantities, such as temperature and pressure, choose meaningful scales before comparing unit directions. Changing those scales changes the optimization question.
Place your direction on the map
- Drag the round arrow tip, use its arrow keys, or change the angle control. Angles run counterclockwise from the positive x-axis.
- Press Check my direction to see your rate, the greatest possible rate, and how far your arrow is from the best direction.
- Try again on this point or move to the next point. Start over clears all three rounds.
Reading the map and score
What happens after a step?
The next question compares an initial rate with a completed move. Choose before opening the calculation.
Use the formula to meet three goals
Use what you found above. Here \(q(x,y)=x^2+y^2\), P = (1, 0), and u is the direction set by the angle control. The step ends at \(P+hu\), where h is a positive distance. The graph shows the change along the whole straight path, with t as distance from P. The dashed line is the first-order estimate.
A tangent direction and a level curve
A differentiable curve r(s) that stays on a level set satisfies \(f(r(s))=c\). Differentiating gives \(\nabla f(P)\cdot r'(s)=0\) at \(r(s)=P\). Thus a nonzero gradient is perpendicular to every nonzero tangent vector there. This uses only the derivative of a constant and differentiability; it does not assume the level curve is straight.
Where the level curve bends, moving along its tangent line leaves the level set. A zero initial rate therefore need not preserve the function value after a finite step. To stay on the level set, the path may need to turn. The gradient is normal to a level curve in the input plane; it is not a normal vector to the graph in three-dimensional space.
Why no unit direction does better
Let f be differentiable at an interior point P of an open region in the plane. Use Euclidean length and allow every unit direction. Write \(g=\nabla f(P)\). Then \(D_u f(P)=g\cdot u\). If \(g\ne0\), the greatest rate is \(\|g\|\), attained only at \(u=g/\|g\|\). The least is \(-\|g\|\), attained only at the opposite direction. If \(g=0\), every unit direction has rate zero.
Bridge from the tangent plane to the directional derivative
Differentiability is stronger than just having partial derivatives. It means
\[\begin{aligned}f(P+h)&=f(P)+g\cdot h+R(h),\\ \frac{R(h)}{\|h\|}&\to0.\end{aligned}\]The last limit is over all nonzero small displacement vectors h. Put \(h=tu\), where u is fixed and unit length. Dividing by t leaves \(g\cdot u+R(tu)/t\). The remainder tends to zero, since its absolute value is \(|R(tu)|/|t|\). That proves the directional formula, including when t approaches zero from either side. Continuous partial derivatives near P are a sufficient condition for this argument, as proved in the partial derivatives lesson.
Build the nonzero-gradient case. In every line assume \(g\ne0\) and \(\|u\|=1\). Put \(m=\|g\|\) and \(w=g/m\). These conditions apply to every option, including the wrong ones.
Draw two unit arrows u and w from the same origin. Their squared separation cannot be negative. Expanding that one fact gives the upper bound on their dot product. The equality case matters: it identifies a unique maximizing direction, rather than merely supplying an upper bound.
What if the gradient vanishes?
At a zero gradient, the directional formula gives zero in every direction. Normalizing the gradient is then impossible, and no direction is singled out by first-order information. A peak, a valley, or a saddle can have this same property. The lesson on critical points explains how curvature and higher-order terms distinguish them.
For a nonzero gradient, apply the upper bound to \(-u\): \(D_u f(P)=-D_{-u}f(P)\ge-m\). Equality requires \(-u=w\), so the opposite direction uniquely attains the least rate. A positive directional derivative guarantees an increase for sufficiently small positive steps in that fixed direction. It supplies no universal step length and no promise about a distant endpoint. Recompute the gradient as the point changes if you want to keep following the locally best direction.
Compute a rate, then interpret it
Enter one number per problem. Hints and full solutions are available. Each box states an absolute tolerance for checking arithmetic; the formulas and conclusions remain exact unless marked as approximations.
Further reading
- J. Stewart, Calculus: Early Transcendentals, section 14.6, “Directional Derivatives and the Gradient Vector.”
- J. E. Marsden and A. Tromba, Vector Calculus, chapter 2, “Differentiation.”