Gradient and Directional Derivative Explained with Worked Examples

The gradient is , and the directional derivative in the direction of a unit vector is .

Write 2x or 2*x to multiply, ^ for powers, and ; between simultaneous equations. You can also type factor, expand, derivative of, integrate … from a to b, limit … as x->0 or 15% of 80.

Try an example

Before you start

This page is easier if you are comfortable with:

What Gradient and directional derivative means

The gradient points in the direction in which increases fastest, and its magnitude is that greatest rate of increase. It is perpendicular to the level curves of .

To find the rate of change in another direction, take the dot product of the gradient with a unit vector in that direction.

The directional derivative is largest in the direction of , where it equals . The gradient is built from partial derivatives (partial derivatives commute), it is normal to the tangent plane, and it is the key tool in Lagrange multipliers and the Hessian second-derivative test.

This page is part of Multivariable calculus in Calculus. Topics that work alongside it: Partial derivatives commute (Clairaut), Tangent plane, Lagrange multipliers, Total differential, Jacobian for a change of variables, Hessian and second-derivative test and Multivariable chain rule.

What is it used for?

The gradient ∇f points in the direction in which f increases fastest, and its size is that fastest rate. The directional derivative is the rate of change in any chosen direction.

How to use gradient and directional derivative

  1. Find the partial derivatives.
  2. Form at the point.
  3. Make the direction a unit vector.
  4. Take the dot product.

Graph

Level curve x² + y² = 2 and the gradient (2, 2) at (1, 1) pointing outwardsgradient (2, 2)-2.5-2-1.5-1-0.500.511.522.53-2-10123Level curve x² + y² = 2 and the gradient (2, 2) at (1, 1) pointing outwardsxyGraph with x from -2.5 to 3 and y from -2.5 to 3. Shows x² + y² = 2 (73); point gradient (2, 2) at (1, 1).

The gradient is perpendicular to the level curve and points in the direction of steepest increase.

Worked examples

These examples are worked by hand, step by step, so you can compare your own working.

Example 1: a gradient

Find for at .

Worked example
Answer
(2, 4)(2,\,4)
  1. Partial derivatives
  2. Evaluate at (1, 2)

Example 2: a directional derivative

Find the directional derivative of at in the direction of .

Worked example
Answer
4.44.4
  1. Dot product
  2. Calculate

Example 3: the gradient of xy

Find for at .

Worked example
Answer
(3, 2)(3,\ 2)
  1. Partial derivatives
  2. Evaluate at (2, 3)

Special cases

A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.

f = x² + y² at (1, 2)

∇f = (2x, 2y) = (2, 4)

Gradient.

u = (0.6, 0.8)

D_u f = 2(0.6) + 4(0.8)

4.4.

Maximum rate

|∇f| = √20

4.4721.

f = xy at (2, 3), u = (1, 1)/√2

∇f = (3, 2)

3.5355.

Word problems

∇f = (f_x, f_y, f_z). The directional derivative along a unit vector u is D_u f = ∇f · u; it is largest (= |∇f|) in the direction of ∇f.

Gradient

f = x² + y² at (1, 2): f_x = 2x.

  1. 2
  2. Check: ✓2

Directional

u = (0.6, 0.8): ∇f·u = (2, 4)·u.

  1. 1.2 + 3.2
  2. Check: ✓4.4

Steepest Higher

Maximum rate |∇f|.

  1. √(4 + 16)
  2. Check: ✓4.4721

Another function Higher

f = xy at (2, 3), ∇f = (3, 2), u = (1, 1)/√2.

  1. 5/√2
  2. Check: ✓3.5355

Common mistakes

Non-unit direction

using (1, 1) ✗

normalise first ✓

Unit vector.

Gradient points uphill?

confusion ✗

direction of steepest increase ✓

Yes.

Mixing ∇f with f

scalar ✗

vector ✓

Gradient.

Maximum rate = ∇f

vector ✗

|∇f| ✓

Magnitude.

Exam tips

  1. ∇f = (f_x, f_y).
  2. u must be a unit vector.
  3. D_u f = ∇f·u.
  4. Max rate |∇f|.
  5. ∇f ⟂ level curves.

Practice questions

Try each one on paper, then open the answer. Use the solver above to see the full working.

1. |∇f| for ∇f = (3, 4) Foundation

5

2. ∇f·u for ∇f = (2, 4), u = (1, 0) Foundation

2

3. ∇f·u for ∇f = (3, 4), u = (0.6, 0.8) Foundation

5

4. f_x of x²y at (1, 1) Higher

2

5. |∇f| for f = x² + y² at (3, 4) Higher

10

6. ∇f·u for ∇f = (1, 1), u = (1, 1)/√2 to 4 d.p. Higher

1.4142

Practice generator

Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.

Solve: …

Key terms

Gradient (∇f)
Vector of partials.
Directional derivative
Rate along u.
Unit vector
Length 1.
Level curve
f = constant.
Steepest ascent
Direction of ∇f.
Dot product
∇f·u.

Frequently asked questions

What is the gradient?

The vector of partial derivatives.

What is the directional derivative?

D_u f = ∇f · u for a unit vector u.

In which direction is f increasing fastest?

That of ∇f.

What is the maximum rate?

|∇f|.

Which page covers partial derivatives commuting?

partial derivatives commute.

Which page covers arc length?

arc length.

More in Calculus and the formula sheets.