Steply

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

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²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⟩

Your turn

Try this one yourself, then check:

Find the gradient of f(x, y) = 2x2y
Show the answer
∇f(2, 1) = ⟨8, 8⟩

More from Gradient and directional derivative

The whole lesson: Gradient and directional derivative →