Gradients, Directional Derivatives, and Optimization, MATH 215 Ch. 14 – Study Notes
offline

Difficulty: Intermediate | Prerequisites: Partial derivatives, chain rule for multivariable functions

TL;DR

The gradient ∇f points in the direction of steepest increase, and its magnitude gives the maximum rate of change. Directional derivatives measure how fast f changes in any direction, constrained by |D_u f| ≤ |∇f|. To find absolute extrema on a closed bounded region, check interior critical points and every point on the boundary.


Key Terms

Gradient ∇f

The vector of all partial derivatives: ∇f = (∂f/∂x, ∂f/∂y) in 2D or (∂f/∂x, ∂f/∂y, ∂f/∂z) in 3D. Think of it as an arrow that points uphill as steeply as possible from any given point.

Directional derivative D_u f

The rate of change of f in the direction of unit vector u: D_u f = ∇f · u. In simple terms, it tells you how fast f is changing if you walk in the direction u.

Critical point

A point where ∇f = 0 (or where ∇f does not exist). These are the candidates for local maxima, local minima, or saddle points.

Saddle point

A critical point that is neither a local max nor a local min. The function increases in some directions and decreases in others. The second derivative test identifies these when D = f_xx f_yy - (f_xy)² < 0.

Second derivative test (for two variables)

At a critical point, compute D = f_xx f_yy - (f_xy)². If D > 0 and f_xx > 0, it is a local min. If D > 0 and f_xx < 0, it is a local max. If D < 0, it is a saddle point. If D = 0, the test is inconclusive.

Absolute (global) extrema

The largest and smallest values of f on a closed bounded region. By the Extreme Value Theorem, these always exist for continuous f on compact sets. Found by checking interior critical points and all boundary points.

Level surface

For f(x, y, z), the set of points where f = c for some constant c. The gradient ∇f is perpendicular to the level surface at every point.


Gradient Computation and Directional Derivatives

Computing the gradient

For f(x, y) = xye^(x² - y⁵), the partial derivatives at (1, 1) are found using the product rule and chain rule:

  • f_x = ye^(x² - y⁵) + xy · 2x · e^(x² - y⁵) = ye^(x² - y⁵)(1 + 2x²)

  • f_y = xe^(x² - y⁵) + xy · (-5y⁴) · e^(x² - y⁵) = xe^(x² - y⁵)(1 - 5y⁴)

At (1, 1): e^(1-1) = e⁰ = 1, so f_x(1,1) = 1·(1+2) = 3 and f_y(1,1) = 1·(1-5) = -4.

Therefore ∇f(1, 1) = (3, -4), with magnitude |∇f| = √(9 + 16) = 5.

Directional derivative properties

Since D_u f = ∇f · u = |∇f| cos α (where α is the angle between ∇f and u), the directional derivative satisfies:

  • Maximum value: |∇f| (in the direction of ∇f)

  • Minimum value: -|∇f| (opposite to ∇f)

  • Zero: when u is perpendicular to ∇f

  • Any value between -|∇f| and |∇f| is achievable

Worked pattern: finding unit vectors for given directional derivatives (Exam Q2)

With ∇f(1,1) = (3, -4) and |∇f| = 5:

(b) Find u with D_u f = -5: We need ∇f · u = -5 = -|∇f|, so u must point opposite to ∇f. u = -∇f/|∇f| = (-3/5, 4/5).

(c) Find u with D_u f = 0: We need u perpendicular to ∇f = (3, -4). Any unit vector perpendicular to (3, -4) works: u = (4/5, 3/5) or u = (-4/5, -3/5).

(d) Find u with D_u f = 2π: Since 2π ≈ 6.28 > 5 = |∇f|, and directional derivatives are bounded by |∇f|, no such unit vector exists.

The gradient is perpendicular to level curves/surfaces

This fact is tested repeatedly. At any point P, ∇f(P) is perpendicular to the level curve f(x,y) = c (or level surface f(x,y,z) = c) passing through P.


Absolute Max/Min on Closed Bounded Regions

The method

To find the absolute maximum and minimum of f(x, y) on a closed bounded region R:

  1. Find all critical points of f in the interior of R (set f_x = 0 and f_y = 0).

  1. Find all candidates on the boundary of R. Parametrise each boundary segment and optimise f along it (reduce to a single-variable problem).

  1. Evaluate f at every candidate. The largest value is the absolute max; the smallest is the absolute min.

Worked pattern: triangle region (Exam Q7)

Find the absolute max and min of f(x, y) = 2xy - x - y on the triangle with vertices (0,0), (4,0), (0,4).

Interior critical points: f_x = 2y - 1 = 0, so y = 1/2. f_y = 2x - 1 = 0, so x = 1/2. The critical point (1/2, 1/2) is inside the triangle. f(1/2, 1/2) = 2(1/4) - 1/2 - 1/2 = -1/2.

Boundary 1: the segment from (0,0) to (4,0), where y = 0. f(x, 0) = -x. This ranges from 0 (at x = 0) to -4 (at x = 4).

Boundary 2: the segment from (0,0) to (0,4), where x = 0. f(0, y) = -y. This ranges from 0 (at y = 0) to -4 (at y = 4).

Boundary 3: the segment from (4,0) to (0,4), where x + y = 4, i.e. y = 4 - x with 0 ≤ x ≤ 4. f(x, 4-x) = 2x(4-x) - x - (4-x) = 8x - 2x² - 4. Taking the derivative: 8 - 4x = 0, so x = 2, y = 2. f(2, 2) = 8 - 8 - 4 = -4. Wait: let us recompute. f(2, 2) = 2(2)(2) - 2 - 2 = 8 - 4 = 4.

Also check endpoints of this segment: f(4, 0) = -4 and f(0, 4) = -4.

Summary of all candidates:

Point

f(x,y)

(1/2, 1/2)

-1/2

(0, 0)

0

(4, 0)

-4

(0, 4)

-4

(2, 2)

4

Absolute maximum value: 4 (at (2, 2)). Absolute minimum value: -4 (at (4, 0) and (0, 4)).


Second Derivative Test and Classification

The discriminant D

At a critical point (a, b) where ∇f = 0:

D = f_{xx}(a,b) \cdot f_{yy}(a,b) - [f_{xy}(a,b)]^2
  • D > 0 and f_xx > 0: local minimum

  • D > 0 and f_xx < 0: local maximum

  • D < 0: saddle point

  • D = 0: inconclusive (need other methods)

Saddle points do not add

If f and g each have a saddle point at (0, 0), f + g does not necessarily have a saddle point there. For example, f(x, y) = x² - y² and g(x, y) = -x² + 2y² both have saddle points at the origin, but f + g = y² has a local minimum there. This is tested on the exam (Q3a, answer: False).


Common Misconceptions

  • Students often think the directional derivative can take any value. It cannot: D_u f is bounded between -|∇f| and |∇f|. If the requested value exceeds |∇f|, no such unit vector exists.

  • Students sometimes compute the gradient but forget to evaluate it at the given point before computing directional derivatives. Always substitute the specific coordinates first.

  • When finding absolute extrema, students frequently forget to check the boundary. Interior critical points alone are not sufficient on a closed region. Every boundary segment must be parametrised and optimised separately.

  • Students sometimes assume that if two functions each have a saddle at a point, their sum does too. This is false; the second derivative test must be applied to the sum independently.

  • On the boundary of a triangle, students sometimes only check vertices and miss critical points along the edges. You must also take the derivative along each edge and solve for any turning points.


Why It Matters / Exam Flags

⚠️ Gradient and directional derivative questions appear on every MATH 215 midterm. Know the formula D_u f = ∇f · u cold.

⚠️ The bound |D_u f| ≤ |∇f| is tested via "find u such that D_u f = [some value]" problems. If the value exceeds |∇f|, the answer is "no such u exists."

⚠️ Absolute max/min on a closed region is a high-point-value question (14 points on this exam). The method is mechanical but long: interior critical points, then each boundary segment.

⚠️ For the boundary of a triangle, you have three segments. Each one is a single-variable optimisation problem. Do not skip the derivative along each edge.

⚠️ True/false questions frequently test whether properties of individual functions carry over to sums, products, or compositions. Think of specific counterexamples.

⚠️ The direction perpendicular to ∇f gives D_u f = 0. Two perpendicular unit vectors exist; either is valid.


Quick Self-Test

  1. True or false: The gradient ∇f always points toward the nearest local maximum. False (it points in the direction of steepest local increase, which need not be toward a local max).

  1. Fill in the blank: If |∇f(P)| = 7, the maximum possible directional derivative at P is ___. 7.

  1. True or false: If D_u f = 0 for some unit vector u, then f has a critical point. False (D_u f = 0 just means u is perpendicular to ∇f, which can happen anywhere ∇f is nonzero).

  1. Fill in the blank: To find absolute extrema on a closed region, check ___ critical points and ___ candidates. interior; boundary.

  1. True or false: D < 0 at a critical point means local minimum. False (D < 0 means saddle point).


Practice Q&A

Q: Let f(x,y) = xye^(x² - y⁵). Compute ∇f(1, 1).

A: f_x(1,1) = 3, f_y(1,1) = -4. So ∇f(1, 1) = (3, -4).

Q: With ∇f(1,1) = (3, -4), does a unit vector u exist such that D_u f(1,1) = 2π? Explain.

A: No. |∇f(1,1)| = 5, and 2π ≈ 6.28 > 5. Since |D_u f| ≤ |∇f| = 5, no unit vector can achieve D_u f = 2π.

Q: Find the absolute maximum and minimum of f(x,y) = 2xy - x - y on the triangle with vertices (0,0), (4,0), (0,4).

A: Interior critical point at (1/2, 1/2) gives f = -1/2. On the hypotenuse x + y = 4, the critical point (2, 2) gives f = 4. The vertices (4,0) and (0,4) give f = -4, and (0,0) gives f = 0. Absolute max = 4, absolute min = -4.

Q: If f(x,y,z) is smooth, does a unit vector u always exist with D_u f(1,2,3) = -∂f/∂x(1,2,3)?

A: Yes. Choose u = (-1, 0, 0). Then D_u f = ∇f · (-1,0,0) = -f_x. Since (-1,0,0) is already a unit vector, this always works.

Q: Give a counterexample showing that the sum of two functions with saddle points at the origin need not have a saddle point there.

A: f(x,y) = x² - y² and g(x,y) = -x² + 2y². Both have saddle points at (0,0), but (f+g)(x,y) = y² has a local minimum at (0,0).


Related Terms / Search Tags

Gradient, directional derivative, partial derivative, critical point, saddle point, local maximum, local minimum, absolute maximum, absolute minimum, second derivative test, discriminant, Hessian, closed bounded region, Extreme Value Theorem, level curve, level surface, normal vector, unit vector, chain rule multivariable, MATH 215, Calculus III, multivariable optimisation, UMich Math 215