Euler Hall — free maths guides

The gradient vector

Compute the gradient of a function of two variables. The idea in plain words, a worked example, and a check with the answers shown — part of the free Calculus III guides.

One slope per direction, collected

The gradient off(x,y)f(x,y) is the vector of its partial derivatives:

∇f=⟨fx, fy⟩.\nabla f = \langle f_x,\, f_y\rangle.

At a point it is a single arrow with two facts in it: its direction is the way of steepest increase, and its length is how steep that way is.

A worked gradient.f=x2y+y3f = x^2y + y^3:

fx=2xy,fy=x2+3y2,∇f=⟨2xy, x2+3y2⟩.f_x = 2xy, \qquad f_y = x^2 + 3y^2, \qquad \nabla f = \langle 2xy,\ x^2+3y^2\rangle.

At(1,1)(1,1) that is⟨2, 4⟩\langle 2,\, 4\rangle: uphill mostly in theyy-direction, and steepest there.

It is a vector FIELD. Every point has its own gradient, so the gradient is not one arrow but an arrow attached to every point — the same way a contour map has a slope everywhere.

Why the gradient's length is the steepest slope

The rate in a unit directionu\mathbf{u} is∇f⋅u\nabla f\cdot\mathbf{u}, which equals∥∇f∥cos⁡θ\|\nabla f\|\cos\theta for the angle between them. That is largest whencos⁡θ=1\cos\theta = 1, that is whenu\mathbf{u} points along the gradient — and its value is then∥∇f∥\|\nabla f\|.

So the gradient's direction gives the steepest way and its length gives the rate along it. Both facts fall out of one dot product.

A gradient evaluated

Question, in the shape the practice takes.f=x2yf=x^2y, find∇f(2,3)\nabla f(2,3).

Work it through.fx=2xy=12f_x = 2xy = 12,fy=x2=4f_y = x^2 = 4, so∇f=⟨12,4⟩\nabla f = \langle 12, 4\rangle at that point.

By the end you can
  • Compute the gradient of a function of two variables
  • Evaluate it at a point
  • Say which way it points
Check yourself

What is∇f\nabla f forf=xyf = xy?

Answers

⟨y,x⟩\langle y, x\rangle — the two partials, with the variables swapped relative to the product.

Work out where to start — free, no accountAnswer six real questions — free, no account