01 / 21

The Gradient Vector

Learn to compute and interpret \(\nabla f\): the vector that reveals the direction of steepest ascent and the maximum rate of change of a multivariable function.

Multivariable Calculus

What Is the Gradient?

Given a scalar function \(f(x,y)\), the gradient is a vector of its partial derivatives. It collects all the "rate of change" information into a single vector:

The symbol \(\nabla\) is called "nabla" or "del". In three dimensions the gradient extends naturally: \(\nabla f = \left\langle f_x,\, f_y,\, f_z \right\rangle\).

Why Does \(\nabla f\) Matter?

Direction
\(\nabla f\) points in the direction of steepest ascent of \(f\) at any given point.
Magnitude
\(\|\nabla f\|\) equals the maximum rate of change of \(f\) at that point.
Level Curves
\(\nabla f\) is always perpendicular to the level curves (contours) of \(f\).

Visualizing \(\nabla f\) on Contour Maps

\(f=4\)
\(f=3\)
\(f=2\)
\(f=1\)
Key
\(\nabla f\)
Point Contour

The Formal Definition

Input
A differentiable scalar function \(f\) and a point \(\mathbf{a}\)
Output
A vector in \(\mathbb{R}^n\) (same dimension as the domain)

Gradient and Directional Derivative

The gradient is the engine behind the directional derivative. For any unit vector \(\hat{\mathbf{u}}\):

1
Maximum: \(D_{\hat{\mathbf{u}}} f\) is maximized when \(\hat{\mathbf{u}}\) points in the direction of \(\nabla f\). The max value is \(\|\nabla f\|\).
2
Zero: \(D_{\hat{\mathbf{u}}} f = 0\) when \(\hat{\mathbf{u}}\) is perpendicular to \(\nabla f\) (along a level curve).
3
Minimum: \(D_{\hat{\mathbf{u}}} f\) is most negative when \(\hat{\mathbf{u}}\) points opposite to \(\nabla f\). The min value is \(-\|\nabla f\|\).

Gradient vs. Partial Derivatives

Gradient \(\nabla f\) Partial Derivative \(f_x\)
Type Vector Scalar
Components All partial derivatives combined Rate of change along one axis
Direction info Points toward steepest ascent Only along the \(x\)-axis
Magnitude \(\|\nabla f\| =\) max rate of change Rate of change in \(x\) only
Dimension Same as domain (\(\mathbb{R}^n\)) Always \(\mathbb{R}^1\)

How to Compute \(\nabla f\)

1
Identify the function \(f(x,y)\) (or \(f(x,y,z)\)) and the point of evaluation.
2
Compute \(f_x\): differentiate \(f\) with respect to \(x\), treating all other variables as constants.
3
Compute \(f_y\): differentiate \(f\) with respect to \(y\), treating all other variables as constants.
4
Assemble: \(\nabla f = \langle f_x,\, f_y \rangle\). For 3D, include \(f_z\) as the third component.
5
Evaluate at the given point by plugging in the coordinates.

Example 1: Polynomial

Find \(\nabla f(1,2)\) for \(f(x,y) = x^2y + 3xy^2\).

1
Compute \(f_x\): \(\frac{\partial}{\partial x}(x^2y + 3xy^2) = 2xy + 3y^2\)
2
Compute \(f_y\): \(\frac{\partial}{\partial y}(x^2y + 3xy^2) = x^2 + 6xy\)
3
Assemble: \(\nabla f = \langle 2xy + 3y^2,\; x^2 + 6xy \rangle\)
4
Evaluate at \((1,2)\): \(\nabla f(1,2) = \langle 2(1)(2)+3(2^2),\; (1)^2+6(1)(2) \rangle = \langle 4+12,\; 1+12 \rangle = \langle 16,\,13 \rangle\)

Example 2: Trigonometric

Find \(\nabla f\) for \(f(x,y) = \sin(x)\,e^{2y}\).

1
Compute \(f_x\): \(\cos(x)\,e^{2y}\) (treat \(e^{2y}\) as a constant)
2
Compute \(f_y\): \(2\sin(x)\,e^{2y}\) (treat \(\sin(x)\) as a constant, chain rule on \(e^{2y}\))
3
Assemble: \(\nabla f = \langle \cos(x)\,e^{2y},\; 2\sin(x)\,e^{2y} \rangle\)

Example 3: Three Variables

Find \(\nabla f(1,-1,2)\) for \(f(x,y,z) = x^2z - 3y^2z^2\).

1
\(f_x = 2xz\): At \((1,-1,2)\): \(f_x = 2(1)(2) = \) \(4\)
2
\(f_y = -6yz^2\): At \((1,-1,2)\): \(f_y = -6(-1)(2^2) = \) \(24\)
3
\(f_z = x^2 - 6y^2z\): At \((1,-1,2)\): \(f_z = (1)^2 - 6(-1)^2(2) = 1 - 12 = \) \(-11\)

Gradient is Perpendicular to Level Curves

\(x\)
\(y\)
\(f = c_1\)
\(f = c_2\)
\(P\)
\(\nabla f\)
tangent

Key Properties of \(\nabla f\)

1
Linearity: \(\nabla(af + bg) = a\,\nabla f + b\,\nabla g\) for constants \(a, b\).
2
Product Rule: \(\nabla(fg) = f\,\nabla g + g\,\nabla f\).
3
Chain Rule: \(\nabla(h \circ f) = h'(f)\,\nabla f\) for \(h:\mathbb{R}\to\mathbb{R}\).
4
Zero Gradient: If \(\nabla f(\mathbf{a}) = \mathbf{0}\), then \(\mathbf{a}\) is a critical point (local max, local min, or saddle).

Application: Steepest Ascent

A hiker is at point \((2,1)\) on a terrain modeled by \(f(x,y) = 100 - x^2 - 3y^2\). In which direction should they walk to climb most steeply?

1
\(f_x = -2x\), so at \((2,1)\): \(f_x = -4\)
2
\(f_y = -6y\), so at \((2,1)\): \(f_y = -6\)
3
\(\nabla f(2,1) = \langle -4, -6 \rangle\). Walk in direction \(\langle -4,-6 \rangle\).
4
Unit direction: \(\hat{\mathbf{u}} = \frac{1}{\sqrt{52}}\langle -4,-6 \rangle \approx \langle -0.555, -0.832 \rangle\)

Common Mistakes

✕ Forgetting the Vector
Writing \(\nabla f = 2xy + 3y^2\) instead of \(\nabla f = \langle 2xy + 3y^2,\, x^2 + 6xy \rangle\). The gradient is a vector, not a scalar.
✕ Wrong Variable Held Constant
When finding \(f_x\), accidentally differentiating \(y\) instead of treating it as a constant. Leads to entirely wrong components.
✕ Not Evaluating at the Point
Leaving the gradient as a formula instead of plugging in the coordinates. The question asks for a specific vector at a point.

Summary at a Glance

Concept Formula / Fact
Gradient (2D) \(\nabla f = \langle f_x, f_y \rangle\)
Gradient (3D) \(\nabla f = \langle f_x, f_y, f_z \rangle\)
Directional Derivative \(D_{\hat{\mathbf{u}}} f = \nabla f \cdot \hat{\mathbf{u}}\)
Max Rate of Change \(\|\nabla f\|\), in direction of \(\nabla f\)
Perpendicularity \(\nabla f \perp\) level curves / surfaces
Critical Points \(\nabla f = \mathbf{0}\)

Question 1 of 5

If \(f(x,y) = 3x^2 + 2xy\), what is \(\nabla f(1,4)\)?

Question 2 of 5

The gradient \(\nabla f\) at a point is always perpendicular to:

Question 3 of 5

For \(f(x,y) = xe^y\), what is the maximum rate of change of \(f\) at \((2, 0)\)?

Question 4 of 5

If \(\nabla f(a,b) = \langle 3, -4 \rangle\) and \(\hat{\mathbf{u}} = \langle 0, 1 \rangle\), what is the directional derivative \(D_{\hat{\mathbf{u}}} f(a,b)\)?

Question 5 of 5

For \(f(x,y,z) = x^2 + y^2 + z^2\), the gradient \(\nabla f\) at any point \((x,y,z)\) is: