Ma · Mathematics

Why Is the Gradient Orthogonal to a Level Set?

Published By the 9to5Science editorial team

At a glance

  1. 1. Define the level set

    Write the surface as all points where a differentiable function has constant value.

  2. 2. Choose a tangent curve

    Represent any differentiable curve on the level set and differentiate the constant function value.

  3. 3. Apply the chain rule

    The derivative becomes a dot product between the gradient and the curve’s tangent vector.

  4. 4. Interpret the result

    A zero dot product means the gradient is perpendicular to every tangent direction.

A level set of a function is the collection of points where the function has a fixed value. For example, the surface x2+y2+z2=4x^2+y^2+z^2=4 is the level set f(x,y,z)=4f(x,y,z)=4 of f(x,y,z)=x2+y2+z2f(x,y,z)=x^2+y^2+z^2.

The key fact is that, at a regular point where the gradient is nonzero, ∇f\nabla f is perpendicular to the level set. The proof is a direct application of the chain rule.

The geometric setup

Let f:Rn→Rf:\mathbb{R}^n\to\mathbb{R} be continuously differentiable, and fix a number cc. Its level set is

Lc={x∈Rn:f(x)=c}.L_c=\{x\in\mathbb{R}^n:f(x)=c\}.

Suppose p∈Lcp\in L_c is a regular point, meaning that ∇f(p)≠0\nabla f(p)\ne 0. By the implicit function theorem, the level set is locally a C1C^1 manifold near pp. A tangent direction at pp can be represented by the velocity of a differentiable curve r(t)r(t) that lies on the level set and passes through pp. Thus,

r(0)=pandf(r(t))=cr(0)=p \qquad\text{and}\qquad f(r(t))=c

for all tt near 00.

Because f(r(t))f(r(t)) is constant, its derivative is zero. The multivariable chain rule gives

ddtf(r(t))=∇f(r(t))⋅r′(t).\frac{d}{dt}f(r(t))=\nabla f(r(t))\cdot r'(t).

Evaluating at t=0t=0 gives

0=∇f(p)⋅r′(0).0=\nabla f(p)\cdot r'(0).

The vector r′(0)r'(0) is tangent to the level set, so the gradient has zero dot product with every tangent vector. Therefore, ∇f(p)\nabla f(p) is orthogonal to the level set at pp.

Why the chain rule proves perpendicularity

Two vectors are orthogonal exactly when their dot product is zero. The equation

∇f(p)⋅r′(0)=0\nabla f(p)\cdot r'(0)=0

says that the gradient is perpendicular to the tangent vector of every curve on the level set.

At a regular point, the collection of velocities of all such curves forms the tangent space to the level set. Consequently, the gradient is a normal vector to that tangent space, and hence a normal vector to the level set itself.

This argument applies to level curves in R2\mathbb{R}^2, level surfaces in R3\mathbb{R}^3, and more generally level sets in Rn\mathbb{R}^n.

Worked example: a sphere

Consider the sphere

x2+y2+z2=4.x^2+y^2+z^2=4.

Define

f(x,y,z)=x2+y2+z2.f(x,y,z)=x^2+y^2+z^2.

Then the sphere is the level set f=4f=4, and

∇f(x,y,z)=(2x,2y,2z).\nabla f(x,y,z)=(2x,2y,2z).

At the point p=(1,1,2)p=(1,1,\sqrt{2}), which lies on the sphere because

12+12+(2)2=1+1+2=4,1^2+1^2+(\sqrt{2})^2=1+1+2=4,

the gradient is

∇f(p)=(2,2,22).\nabla f(p)=(2,2,2\sqrt{2}).

A curve on the sphere passing through pp has a tangent vector vv satisfying

(2,2,22)⋅v=0.(2,2,2\sqrt{2})\cdot v=0.

For instance, v=(1,−1,0)v=(1,-1,0) is tangent because

(2,2,22)⋅(1,−1,0)=2−2+0=0.(2,2,2\sqrt{2})\cdot(1,-1,0)=2-2+0=0.

Thus the gradient points in the radial direction, while every tangent direction lies in the plane perpendicular to that radial direction.

The level-curve version in two dimensions

For a function f(x,y)f(x,y), a level curve is given by

f(x,y)=c.f(x,y)=c.

Suppose the curve is parametrized by

r(t)=(x(t),y(t)).r(t)=(x(t),y(t)).

Since f(x(t),y(t))=cf(x(t),y(t))=c, differentiation gives

ddtf(x(t),y(t))=fx(x(t),y(t))x′(t)+fy(x(t),y(t))y′(t)=0.\frac{d}{dt}f(x(t),y(t)) =f_x(x(t),y(t))x'(t)+f_y(x(t),y(t))y'(t)=0.

In vector form,

(fx,fy)⋅(x′(t),y′(t))=0.\bigl(f_x,f_y\bigr)\cdot\bigl(x'(t),y'(t)\bigr)=0.

Here (fx,fy)=∇f(f_x,f_y)=\nabla f is normal to the curve, and (x′(t),y′(t))(x'(t),y'(t)) is tangent to it.

If the curve can locally be written as y=g(x)y=g(x) with gg differentiable, the same fact follows by implicit differentiation. From f(x,g(x))=cf(x,g(x))=c,

fx+fyg′(x)=0.f_x+f_y g'(x)=0.

The tangent vector is (1,g′(x))(1,g'(x)), and

∇f⋅(1,g′(x))=fx+fyg′(x)=0.\nabla f\cdot(1,g'(x))=f_x+f_y g'(x)=0.

The necessary regularity condition

The qualification used above is essential: the gradient must be nonzero at the point under consideration. A point pp with

∇f(p)≠0\nabla f(p)\ne 0

is called a regular point of the level set. Near such a point, the implicit function theorem ensures that the level set behaves like a C1C^1 curve or surface, and the gradient gives its normal direction.

If ∇f(p)=0\nabla f(p)=0, the gradient is the zero vector. The zero vector is orthogonal in the dot-product sense to every vector, but it does not determine a geometric normal direction. Moreover, the level set may have a corner, crossing, cusp, or isolated point there.

For example, let

f(x,y)=x2−y2.f(x,y)=x^2-y^2.

The level set f=0f=0 is the pair of lines y=xy=x and y=−xy=-x, which cross at the origin. At (0,0)(0,0),

∇f(0,0)=(0,0).\nabla f(0,0)=(0,0).

There is no single tangent line or single normal direction at the crossing, so the usual geometric statement cannot be made there.

Common mistakes

Confusing the gradient with a tangent vector

Where it is nonzero, the gradient points in the direction of greatest increase of ff. Along a level set, ff does not change, so at a regular point the gradient is normal, not tangent.

Forgetting that the function must be constant along the curve

The proof uses f(r(t))=cf(r(t))=c. If the curve does not remain on one level set, its derivative need not be zero, and its tangent need not be orthogonal to the gradient.

Treating a zero gradient as a useful normal

At a critical point, ∇f=0\nabla f=0 does not provide a nonzero normal direction. Check regularity before applying the geometric conclusion.

Using only one tangent direction

Showing orthogonality to one particular tangent vector is not enough to establish that the gradient is normal to the entire level set. The chain-rule argument works for every differentiable curve on the level set, and therefore every tangent direction.

A useful equivalent statement

For a regular level set f=cf=c, the tangent space at pp is

TpLc={v∈Rn:∇f(p)⋅v=0}.T_pL_c=\{v\in\mathbb{R}^n:\nabla f(p)\cdot v=0\}.

Thus the gradient is not merely one vector that happens to be perpendicular to a tangent: it describes the entire normal direction to the level set. In three dimensions, a normal line is spanned by ∇f(p)\nabla f(p), and a tangent plane consists precisely of vectors perpendicular to that gradient.

References

  1. Calculus, Michael Spivak
  2. Calculus: Early Transcendentals, James Stewart

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.