Steply

Gradient and directional derivative

Calculus 3 · 20 problems, easy to harder

▶ Watch the first one solved

How we do it

  1. The partial derivatives
  2. Find the gradient
  3. Find the length
  4. Check

The steps for Maximum rate of change of f(x, y) = x^2 + 3y^2 at (2, 1). Every solution names its steps, so you always know what comes next.

Worked examples

Gradient of f(x, y) = x^2 y at (1, 2) Easy

The question

Question: find the gradient of f(x, y) = x²y at (1, 2).

f(x, y) = x2y

1 The partial derivatives

Term by term.

In x²y, y is fixed and waits in front.

x² gives 2x.

So 2xy.

So ∂f/∂x = 2xy.

∂f∂x = 2xy

Term by term.

In x²y, x² is fixed and waits in front.

y gives 1.

So x².

So ∂f/∂y = x².

∂f∂y = x2

2 Find the gradient

The gradient ∇f puts the partial derivatives together as one vector.

∇f = ⟨∂f∂x, ∂f∂y⟩

So ∇f = ⟨2xy, x²⟩.

∇f = ⟨2xy, x2⟩

At the point, put x = 1 and y = 2 in: ∇f(1, 2) = ⟨4, 1⟩.

∇f(1, 2) = ⟨4, 1⟩

Careful!

The answer has two parts: one for each letter.

It is an arrow, not one number.

Careful: the gradient is a vector, not one number

3 Check

Let's look at it on the xy grid.

The blue curve is a level curve: f is 2 all along it.

The gradient points straight uphill, at a square corner to the level curve.

A tiny step of 0.01 along the arrow: f grows from 2 to about 2.041.

Uphill.

Right!

f(1.0097, 2.0024) ≈ 2.041 > f(1, 2) = 2

Let's look back.

First: the partial derivatives.

Then: find the gradient.

Last: check.

Answer
∇f(1, 2) = ⟨4, 1⟩

▶ Watch it solved

Gradient of f(x, y) = x^3 - xy at (2, 1) Medium

The question

Question: find the gradient of f(x, y) = x³ − xy at (2, 1).

f(x, y) = x3 − xy

1 The partial derivatives

Term by term.

x³: the power 3 comes down.

The power goes down by 1.

So 3x².

In xy, y is fixed and waits in front.

x gives 1.

So y.

So ∂f/∂x = 3x² − y.

∂f∂x = 3x2 − y

Term by term.

x³ has no y: it is a fixed number, so it gives 0.

In xy, x is fixed and waits in front.

y gives 1.

So x.

∂f∂y = 0 − x

Drop the zeros: ∂f/∂y = −x.

∂f∂y = −x

2 Find the gradient

The gradient ∇f puts the partial derivatives together as one vector.

∇f = ⟨∂f∂x, ∂f∂y⟩

So ∇f = ⟨3x² − y, −x⟩.

∇f = ⟨3x2 − y, −x⟩

At the point, put x = 2 and y = 1 in: ∇f(2, 1) = ⟨11, −2⟩.

∇f(2, 1) = ⟨11, −2⟩

Careful!

The answer has two parts: one for each letter.

It is an arrow, not one number.

Careful: the gradient is a vector, not one number

3 Check

Let's look at it on the xy grid.

The blue curve is a level curve: f is 6 all along it.

The gradient points straight uphill, at a square corner to the level curve.

A tiny step of 0.01 along the arrow: f grows from 6 to about 6.112.

Uphill.

Right!

f(2.0098, 0.9982) ≈ 6.112 > f(2, 1) = 6

Let's look back.

First: the partial derivatives.

Then: find the gradient.

Last: check.

Answer
∇f(2, 1) = ⟨11, −2⟩

▶ Watch it solved

Maximum rate of change of f(x, y) = x^2 + 3y^2 at (2, 1) Harder

The question

Question: find the fastest rate of change of f(x, y) = x² + 3y² at (2, 1), and its direction.

f(x, y) = x2 + 3y2

1 The partial derivatives

Term by term.

x²: the power 2 comes down.

The power goes down by 1.

So 2x.

3y² has no x: it is a fixed number, so it gives 0.

∂f∂x = 2x + 0

Drop the zeros: ∂f/∂x = 2x.

∂f∂x = 2x

Term by term.

x² has no y: it is a fixed number, so it gives 0.

3y²: the power 2 comes down: 3 times 2 is 6.

The power goes down by 1.

So 6y.

∂f∂y = 0 + 6y

Drop the zeros: ∂f/∂y = 6y.

∂f∂y = 6y

2 Find the gradient

The gradient ∇f puts the partial derivatives together as one vector.

∇f = ⟨∂f∂x, ∂f∂y⟩

So ∇f = ⟨2x, 6y⟩.

∇f = ⟨2x, 6y⟩

At the point, put x = 2 and y = 1 in: ∇f(2, 1) = ⟨4, 6⟩.

∇f(2, 1) = ⟨4, 6⟩

3 Find the length

The fastest growth is the length of the gradient.

Its direction is the gradient itself.

The length ‖∇f‖ is Pythagoras with two parts.

Square each part, add, then take the square root.

‖∇f‖ = √42 + 62

4 squared is 16.

6 squared is 36.

‖∇f‖ = √16 + 36

Add: 16 plus 36 is 52.

‖∇f‖ = √52

But 52 has a square number in it: 4.

52 is 4 times 13.

‖∇f‖ = √4 × 13

A root of a times splits into two roots.

‖∇f‖ = √4 × √13

√4 is 2.

2 × 2 = 4

So ‖∇f‖ = 2√13.

That is the exact answer, made simple.

‖∇f‖ = 2√13

With a calculator, that is about 7.2, to the nearest tenth.

‖∇f‖ ≈ 7.2

4 Check

Let's look at it on the xy grid.

The blue curve is a level curve: f is 7 all along it.

The gradient points straight uphill, at a square corner to the level curve.

A tiny step of 0.001 along the arrow: f changes about 7.21 per step.

That is about 7.2.

Right!

along ∇f: f(…) − f(2, 1)0.001 ≈ 7.213

Let's look back.

First: the partial derivatives.

Then: find the gradient.

Then: find the length.

Last: check.

Answer
‖∇f‖ ≈ 7.2

▶ Watch it solved

Practice

Try each one, then open the answer. Stuck? Open the problem to watch every step.

Easy

  1. gradient of f(x, y) = x^2 y at (1, 2)
    Answer
    ∇f(1, 2) = ⟨4, 1⟩
  2. gradient of f(x, y) = 3x^2 + y^2 at (1, 1)
    Answer
    ∇f(1, 1) = ⟨6, 2⟩
  3. gradient of f(x, y) = xy at (2, 3)
    Answer
    ∇f(2, 3) = ⟨3, 2⟩
  4. gradient of f(x, y) = x^2 + y^3 at (2, 1)
    Answer
    ∇f(2, 1) = ⟨4, 3⟩
  5. gradient of f(x, y) = 4x - 2y + xy at (1, 2)
    Answer
    ∇f(1, 2) = ⟨6, −1⟩
  6. gradient of f(x, y, z) = xy + yz^2 at (1, 1, 2)
    Answer
    ∇f(1, 1, 2) = ⟨1, 5, 4⟩

Medium

  1. gradient of f(x, y) = x^3 - xy at (2, 1)
    Answer
    ∇f(2, 1) = ⟨11, −2⟩
  2. directional derivative of f(x, y) = xy^2 at (2, 1) in the direction of <3, -4>
    Answer
    Duf = −135
  3. directional derivative of f(x, y) = x^2 + y^2 at (1, 2) in the direction of <3, 4>
    Answer
    Duf = 225
  4. directional derivative of f(x, y) = xy at (2, 1) in the direction of <4, 3>
    Answer
    Duf = 2
  5. directional derivative of f(x, y) = x^2 y at (1, 3) in the direction of <0, 1>
    Answer
    Duf = 1
  6. directional derivative of f(x, y) = 3x^2 - y at (1, 2) in the direction of <-3, 4>
    Answer
    Duf = −225
  7. directional derivative of f(x, y) = x^3 + 2y^2 at (1, -1) in the direction of <5, 12>
    Answer
    Duf = −3313
  8. directional derivative of f(x, y) = 2xy - y^2 at (3, 1) in the direction of <1, 0>
    Answer
    Duf = 2
  9. gradient of f(x, y, z) = x^2 + y^2 + z^2 at (1, 2, 2)
    Answer
    ∇f(1, 2, 2) = ⟨2, 4, 4⟩

Harder

  1. maximum rate of change of f(x, y) = x^2 + 3y^2 at (2, 1)
    Answer
    ‖∇f‖ ≈ 7.2
  2. maximum rate of change of f(x, y) = xy at (3, 4)
    Answer
    ‖∇f‖ = 5
  3. maximum rate of change of f(x, y) = x^2 y at (2, 1)
    Answer
    ‖∇f‖ ≈ 5.7
  4. maximum rate of change of f(x, y) = 3x + 4y at (1, 1)
    Answer
    ‖∇f‖ = 5
  5. gradient of f(x, y, z) = xyz at (1, 2, 3)
    Answer
    ∇f(1, 2, 3) = ⟨6, 3, 2⟩