Gradients, Directional Derivatives, and Level Sets, MATH 215 – Study Notes
offline

Difficulty: Intermediate | Prerequisites: Partial derivatives, vectors and dot product


Big Picture

The gradient ties together partial derivatives into a single vector that points in the direction of steepest increase of a function. This concept is central to optimisation (finding maxima and minima), to understanding how functions change in space, and to describing surfaces via their level sets. If you are comfortable with partial derivatives and the dot product, you have what you need. This topic shows up throughout the rest of the course, from Lagrange multipliers to surface integrals.

TL;DR

The gradient ∇f points in the direction where f increases fastest, and its magnitude is the rate of that increase. The directional derivative in any direction u is ∇f · u, which is maximised when u aligns with ∇f. The gradient is always perpendicular to the level curves (2D) or level surfaces (3D) of the function.


Key Terms

Gradient vector (∇f)

The vector of all first partial derivatives of a function: ∇f(x, y) = ⟨fₓ, f_y⟩ in 2D, or ∇f(x, y, z) = ⟨fₓ, f_y, f_z⟩ in 3D. Think of it as an arrow that points uphill, in the direction where the function value increases most steeply.

Directional derivative (D_u f)

The rate of change of f in the direction of a unit vector u. Computed as D_u f = ∇f · u = |∇f| cos(θ), where θ is the angle between ∇f and u. In simple terms, it tells you how fast f changes if you walk in a particular direction.

Level curve

The set of points (x, y) where f(x, y) = k for some constant k. In simple terms, a contour line on a topographic map.

Level surface

The set of points (x, y, z) where f(x, y, z) = k. For a linear function like T = 2x + y + 3z + 27, each level set is a plane.

Normal vector to a surface

A vector perpendicular to a surface at a given point. The gradient ∇f at a point is always normal to the level surface f = k passing through that point.


Core Content

Computing the Gradient

  • For f(x, y, z) = 2x + y + 3z + 27, the gradient is ∇f = ⟨2, 1, 3⟩. Since f is linear, the gradient is constant everywhere.

  • The gradient always points in the direction of steepest increase of f.

Directional Derivative

  • D_u f = ∇f · u, where u must be a unit vector (|u| = 1).

  • The maximum value of the directional derivative is |∇f|, achieved when u points in the same direction as ∇f.

  • The minimum value is −|∇f|, achieved in the opposite direction.

  • When u is perpendicular to ∇f, the directional derivative is zero (you are moving along a level set, so f does not change).

  • If |∇f(1, 1)| = 5, no unit vector can produce a directional derivative of 10. The maximum possible value is 5.

Gradient is Perpendicular to Level Sets

  • This is one of the most important geometric facts in multivariable calculus.

  • In 2D: ∇f(x₀, y₀) is perpendicular to the level curve f(x, y) = k through (x₀, y₀).

  • In 3D: ∇f(x₀, y₀, z₀) is perpendicular to the level surface f(x, y, z) = k through that point.

  • This property is why the directional derivative is zero along a level set: the dot product of ∇f with a tangent vector to the level set is zero.

Level Sets of Linear Functions

  • For a linear function T(x, y, z) = 2x + y + 3z + 27, the level sets T = k are planes of the form 2x + y + 3z = k − 27.

  • The normal vector to every such plane is ∇T = ⟨2, 1, 3⟩, which is the same for all level planes (since the gradient of a linear function is constant).

Shortest Distance from a Point to a Level Plane

  • The plane for T = 30°C: 2x + y + 3z − 3 = 0.

  • Point-to-plane distance formula: d = |Ax₀ + By₀ + Cz₀ + D| / √(A² + B² + C²).

  • With P(0, 1, 2): d = |2(0) + 1(1) + 3(2) − 3| / √(4 + 1 + 9) = |0 + 1 + 6 − 3| / √14 = 4/√14.

  • The shortest path from a point to a plane is always along the normal direction, which is the gradient direction.


Formulas

\nabla f(x,y,z) = \left\langle \frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}, \frac{\partial f}{\partial z} \right\rangle
D_{\mathbf{u}} f = \nabla f \cdot \mathbf{u} = |\nabla f| \cos\theta
d = \frac{|Ax_0 + By_0 + Cz_0 + D|}{\sqrt{A^2 + B^2 + C^2}}

Real-World Applications

Gradients are used in machine learning (gradient descent optimises model parameters by walking downhill on a loss surface) and in meteorology (weather maps show level curves of pressure; the gradient of the pressure field determines wind direction). The point-to-plane distance formula appears in robotics and computer vision for fitting planes to data.

Common Misconceptions

  • Students often think the gradient is tangent to the level curve. It is perpendicular to the level curve, pointing in the direction of steepest increase.

  • Students sometimes forget that the directional derivative formula requires u to be a unit vector. If you use a non-unit vector, you must normalise it first.

  • Students sometimes believe that D_u f can exceed |∇f|. It cannot. The maximum directional derivative equals the magnitude of the gradient.

  • Students sometimes confuse "level curve" (2D, where f(x,y) = k) with "level surface" (3D, where f(x,y,z) = k). The gradient is perpendicular to both, but the geometric object differs.

Why It Matters / Exam Flags

⚠️ "In which direction is the directional derivative maximised?" is a standard exam question. The answer is always: in the direction of the gradient.

⚠️ The perpendicularity of the gradient to level sets is tested both as a conceptual true/false and as part of distance-to-plane calculations.

⚠️ Know how to identify the geometry of level sets. For a linear function, they are planes. For x² + y² + z², they are spheres.


Quick Self-Test

  1. True or false: the gradient vector is perpendicular to the level surface. (True)

  1. Fill in the blank: the directional derivative is maximised in the direction of the ______. (gradient)

  1. True or false: if |∇f| = 5, there exists a unit vector u with D_u f = 10. (False)

  1. Fill in the blank: the level sets of a linear function in three variables are ______. (planes)

  1. True or false: the gradient is tangent to the level curve. (False, it is perpendicular)

Practice Q&A

Q: Given T(x, y, z) = 2x + y + 3z + 27, what are the level sets of T?

A: Planes. Each level set T = k is the plane 2x + y + 3z = k − 27.

Q: Find the shortest distance from P(0, 1, 2) to the plane where T = 30.

A: The plane is 2x + y + 3z − 3 = 0. Distance = |2(0) + 1(1) + 3(2) − 3| / √(4 + 1 + 9) = 4/√14.

Q: In which direction is the directional derivative D_u f(x₀, y₀) maximised?

A: In the direction of the gradient vector ∇f(x₀, y₀).

Q: What is the relationship between ∇f(a, b, c) and the level surface f(x, y, z) = k at (a, b, c)?

A: The gradient is normal (perpendicular) to the level surface at that point.

Q: True or false: a unit vector u exists such that D_u f(1, 1) = 10 when |∇f(1, 1)| = 5.

A: False. The maximum directional derivative is |∇f| = 5. A value of 10 is impossible.


Connections to Other Topics

The gradient connects directly to Lagrange multipliers: at a constrained extremum, ∇f is parallel to ∇g. It also connects to surface integrals, where the gradient provides the normal vector to a surface. The point-to-plane distance formula is a specific case of projecting a vector onto the normal direction, which is itself a dot product application.

Related Terms / Search Tags

gradient, nabla, del operator, directional derivative, level curve, level surface, contour line, isotherm, normal vector, perpendicular to level set, point to plane distance, linear function level sets, steepest ascent, steepest descent, gradient descent, MATH 215, Calculus III, multivariable calculus, University of Michigan