Steply

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

Step by step, with the reason for every step · Gradient and directional derivative · Calculus 3

Step by step

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⟩

Your turn

Try this one yourself, then check:

Find the gradient of f(x, y) = 2x3 − xy
Show the answer
∇f(2, 3) = ⟨21, −2⟩

More from Gradient and directional derivative

The whole lesson: Gradient and directional derivative →