First Year Engineering is coming soon

We're still writing and reviewing the notes for every subject, and we'll open it when every subject is ready. Meanwhile you can practise aptitude, ask Aria about any subject, or see the branches that are ready.

Maxima and minima of functions of two variables

Maxima and minima of functions of two variables: finding, classifying (using first and second derivatives), and confirming absolute extrema on domains, including boundary checks.

Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Engineers optimize designs: minimize material or energy use, maximize strength or efficiency, or find safe operating points. These are often modeled by functions of two variables, such as stress as a function of thickness and width, or heat loss versus temperature and area. Knowing how to locate and classify maxima, minima, and saddle points helps make correct design decisions.

Key ideas

  • Partial derivatives: fₓ(x, y) = ∂f/∂x and fᵧ(x, y) = ∂f/∂y measure the rate of change in x and y directions, holding the other variable constant. Higher partials: fₓₓ, fᵧᵧ, fₓᵧ = fᵧₓ (if f is C², i.e., has continuous second partials; Clairaut’s theorem).

  • Gradient: ∇f(x, y) = (fₓ, fᵧ). It points in the direction of steepest increase of f (where ∇f ≠ 0) and is perpendicular to level curves f(x, y) = constant.

  • Critical (stationary) point: A point (a, b) where fₓ(a, b) = 0 and fᵧ(a, b) = 0 (gradient is zero), or where one or both partial derivatives do not exist while (a, b) is in the interior of the domain. For interior local extrema of differentiable f, the gradient must be zero (necessary condition).

  • Local maximum/minimum (local extremum): f has a local maximum at (a, b) if there exists r > 0 such that f(x, y) ≤ f(a, b) for all (x, y) with √[(x − a)² + (y − b)²] < r. Similarly, a local minimum if f(x, y) ≥ f(a, b) in that neighborhood.

  • Saddle point: A critical point that is not a local maximum or minimum; the function increases in some directions and decreases in others.

  • Hessian matrix: H(a, b) = [[fₓₓ(a, b), fₓᵧ(a, b)], [fᵧₓ(a, b), fᵧᵧ(a, b)]]. It encodes the second-order curvature near (a, b). For C² functions, fₓᵧ = fᵧₓ.

  • Second derivative test (two variables) — Exact statement: Let f be C² in a neighborhood of a critical point (a, b), so fₓ(a, b) = fᵧ(a, b) = 0. Define D(a, b) = fₓₓ(a, b)·fᵧᵧ(a, b) − [fₓᵧ(a, b)]².

    • If D(a, b) > 0 and fₓₓ(a, b) > 0, then f has a strict local minimum at (a, b).
    • If D(a, b) > 0 and fₓₓ(a, b) < 0, then f has a strict local maximum at (a, b).
    • If D(a, b) < 0, then f has a saddle point at (a, b).
    • If D(a, b) = 0, the test is inconclusive (higher-order analysis is needed). Assumptions: f ∈ C² near (a, b) to ensure Taylor expansion and symmetry of mixed partials.
  • Why the second derivative test works (derivation universities ask):

    1. Use the two-variable Taylor expansion about (a, b) up to second order (see “Taylor’s and Maclaurin’s series” topic): f(a + h, b + k) = f(a, b) + fₓ(a, b)h + fᵧ(a, b)k + 1/2 [fₓₓ h² + 2 fₓᵧ hk + fᵧᵧ k²] + higher order terms.
    2. At a critical point, fₓ = fᵧ = 0, so the first-order terms vanish. The leading variation is the quadratic form Q(h, k) = 1/2 [fₓₓ h² + 2 fₓᵧ hk + fᵧᵧ k²].
    3. Classify Q by its definiteness (from Linear Algebra): for a 2×2 symmetric matrix, Q is positive definite iff fₓₓ > 0 and D > 0; negative definite iff fₓₓ < 0 and D > 0; indefinite iff D < 0. The sign of Q determines whether f increases in all directions (minimum), decreases in all directions (maximum), or increases in some and decreases in others (saddle). If D = 0, higher-order terms decide.
  • Extreme Value Theorem (Weierstrass) — Exact statement for ℝ²: If f is continuous on a nonempty, closed, and bounded set S ⊆ ℝ², then f attains its absolute maximum and absolute minimum on S; i.e., there exist points p, q ∈ S such that f(p) ≥ f(x, y) ≥ f(q) for all (x, y) ∈ S. Use this when asked to find absolute (global) extrema on a closed region. If the domain is not closed and bounded, absolute extrema may not exist; analyze behavior on the boundary and as x² + y² → ∞ as appropriate.

  • Strategy to find absolute maxima/minima on a closed region:

    1. Find all critical points in the interior: solve fₓ = 0 and fᵧ = 0.
    2. Evaluate f on the boundary. For curves given explicitly (e.g., x = g(y) or y = h(x)), reduce to a single-variable function. For circles or ellipses, parametrize (e.g., x = a cos t, y = b sin t). For polygonal boundaries, check each edge (line segment) and its endpoints. If boundaries have constraints, see also “Lagrange’s method of multipliers”.
    3. Compare all values from steps (1) and (2); the largest is the absolute maximum, the smallest is the absolute minimum.
  • Geometric intuition (what to draw in an exam):

    • Draw level curves (contours) near a point (a, b): • For a local minimum: concentric closed curves with increasing values outward (label f = c₀ at center, f = c₀ + δ on an outer curve). The gradient arrows point outward. • For a local maximum: similar but values decrease outward (label f = c₀ − δ outward). Gradient arrows point inward. • For a saddle: hyperbola-like level curves crossing; along one axis values rise, along the perpendicular axis values fall. Mark the axes of increase/decrease.
    • For boundary problems: sketch the domain (e.g., a disk x² + y² ≤ R²), mark interior critical points, trace the boundary path with the parameter t, and indicate where extrema occur.
  • Relation to eigenvalues of the Hessian: At a critical point, if both eigenvalues of H are positive, local minimum; both negative, local maximum; opposite signs, saddle. For 2×2, this agrees with the determinant test. You need not compute eigenvalues in exams unless asked; the D test is quicker.

  • When the test is inconclusive (D = 0): Use higher-order terms of Taylor expansion, or analyze f directly (e.g., show f ≥ 0 near the point), or change variables to study behavior along different directions.

Formulas

∇f(x, y) = (fₓ(x, y), fᵧ(x, y))

  • ∇f: gradient vector (units of f per unit of x and y), fₓ = ∂f/∂x, fᵧ = ∂f/∂y. Applies for differentiable f.

H(x, y) = [[fₓₓ(x, y), fₓᵧ(x, y)], [fᵧₓ(x, y), fᵧᵧ(x, y)]]

  • H: Hessian matrix, entries are second partial derivatives (units: f per square of x or y). Applies for C² functions.

D(a, b) = fₓₓ(a, b)·fᵧᵧ(a, b) − [fₓᵧ(a, b)]²

  • D: Hessian determinant at (a, b), unit is (unit of f)² per (unit of x²·y²). Used in second derivative test at a critical point.

f(a + h, b + k) ≈ f(a, b) + 1/2 [fₓₓ(a, b) h² + 2 fₓᵧ(a, b) hk + fᵧᵧ(a, b) k²]

  • Taylor approximation near a critical point (fₓ = fᵧ = 0). h, k have same units as x, y.

x = a cos t, y = b sin t

  • Standard parametrization for ellipse boundary x²/a² + y²/b² = 1, t in [0, 2π]. Units: x, y same as a, b. Use to reduce boundary evaluation to one variable t.

Q(h, k) = 1/2 [h k] · H(a, b) · [h k]ᵀ

  • Quadratic form governing second-order change; sign of Q classifies the critical point when D ≠ 0.

Worked examples

Example 1: Classify critical points using the second derivative test Given f(x, y) = x³ + y³ − 3xy.

  1. Compute first partial derivatives:

    • fₓ = 3x² − 3y
    • fᵧ = 3y² − 3x
  2. Find critical points by solving fₓ = 0 and fᵧ = 0:

    • 3x² − 3y = 0 ⇒ y = x²
    • 3y² − 3x = 0 ⇒ x = y² Substitute: x = (x²)² = x⁴ ⇒ x⁴ − x = 0 ⇒ x(x³ − 1) = 0 ⇒ x = 0 or x = 1. For x = 0 ⇒ y = x² = 0. For x = 1 ⇒ y = x² = 1. Critical points: (0, 0) and (1, 1).
  3. Compute second partial derivatives:

    • fₓₓ = 6x
    • fᵧᵧ = 6y
    • fₓᵧ = fᵧₓ = −3
  4. Evaluate D and apply the test:

    • At (0, 0): fₓₓ = 0, fᵧᵧ = 0, fₓᵧ = −3 ⇒ D = (0)(0) − (−3)² = −9 < 0 ⇒ saddle point.
    • At (1, 1): fₓₓ = 6, fᵧᵧ = 6, fₓᵧ = −3 ⇒ D = 6·6 − (−3)² = 36 − 9 = 27 > 0 and fₓₓ > 0 ⇒ local minimum.
  5. Values at points (for confirmation): f(0, 0) = 0 (saddle), f(1, 1) = 1 + 1 − 3 = −1 (local minimum). There is no local maximum.

Answer: (0, 0) is a saddle point; (1, 1) is a local minimum with value −1.

Example 2: Find absolute maxima and minima on a closed region Find the absolute maximum and minimum of f(x, y) = x² + y² − 2x − 4y on the disk S: x² + y² ≤ 9.

  1. Interior critical point(s):

    • fₓ = 2x − 2 = 0 ⇒ x = 1
    • fᵧ = 2y − 4 = 0 ⇒ y = 2 Candidate: (1, 2). Check it lies in S: 1² + 2² = 5 ≤ 9 ⇒ inside.
  2. Classify interior point (optional since convex quadratic):

    • fₓₓ = 2 > 0, fᵧᵧ = 2 > 0, fₓᵧ = 0 ⇒ D = 2·2 − 0 = 4 > 0 and fₓₓ > 0 ⇒ local (and here global) minimum in ℝ².
    • Value: f(1, 2) = 1 + 4 − 2 − 8 = −5.
  3. Boundary x² + y² = 9: Parametrize x = 3 cos t, y = 3 sin t, t ∈ [0, 2π]. Then

    • f(t) = (3 cos t)² + (3 sin t)² − 2(3 cos t) − 4(3 sin t) = 9 − 6 cos t − 12 sin t.
    • Write as f(t) = 9 − R cos(t − φ) with R = √(6² + 12²) = 6√5 and φ = atan2(12, 6).
    • Therefore, minimum on boundary: f_min,bound = 9 − R = 9 − 6√5. Maximum on boundary: f_max,bound = 9 + R = 9 + 6√5.
  4. Compare interior and boundary:

    • Interior minimum: −5.
    • Boundary minimum: 9 − 6√5 ≈ 9 − 13.416 ≈ −4.416 (greater than −5).
    • Boundary maximum: 9 + 6√5 ≈ 22.416.
  5. Locate point of maximum on the boundary:

    • Maximum occurs when cos(t − φ) = −1 ⇒ t = φ + π.
    • Then (cos t, sin t) = −(cos φ, sin φ) = −(6/R, 12/R) = −(1/√5, 2/√5).
    • Hence (x, y) = 3(−1/√5, −2/√5) = (−3/√5, −6/√5).

Answer: Absolute minimum is −5 at (1, 2). Absolute maximum is 9 + 6√5 at (−3/√5, −6/√5).

Example 3: Inconclusive second derivative test (D = 0) and resolution Classify the critical point at the origin for f(x, y) = x⁴ + y⁴.

  1. First partials: fₓ = 4x³, fᵧ = 4y³ ⇒ critical at (0, 0).
  2. Second partials: fₓₓ = 12x², fᵧᵧ = 12y², fₓᵧ = 0 ⇒ at (0, 0): fₓₓ = 0, fᵧᵧ = 0, fₓᵧ = 0 ⇒ D = 0 ⇒ test inconclusive.
  3. Higher-order analysis: For all (x, y), f(x, y) = x⁴ + y⁴ ≥ 0, with equality only at (0, 0). Therefore, (0, 0) is a strict local (indeed global) minimum with value 0.

Answer: (0, 0) is a strict local minimum; second derivative test is inconclusive because D = 0, but nonnegativity of x⁴ + y⁴ resolves it.

Common mistakes

  • Using the second derivative test without first checking that the point is critical (applying D and fₓₓ at noncritical points).
  • Miscomputing D as fₓₓ + fᵧᵧ − fₓᵧ instead of D = fₓₓ fᵧᵧ − (fₓᵧ)².
  • Assuming D > 0 always means a minimum; forgetting to check the sign of fₓₓ to distinguish max vs min.
  • Concluding “no extremum” when D = 0; the correct statement is “test inconclusive” and then proceed with higher-order or direct analysis.
  • Ignoring boundary evaluation when asked for absolute (global) extrema on a closed region.
  • Dropping units or context: while many exam problems are unitless, in applications the variables and f have units; answers should be consistent.
  • Algebra slips in parametrization (e.g., wrong signs for sin/cos when finding where maximum occurs on a circle).

For your exam

  • Theorems/short notes: State and explain the second derivative test; state the Extreme Value Theorem for closed and bounded regions; note the case D = 0. A full-marks answer gives the exact statement, conditions (C² near the point), and classification rules based on D and fₓₓ.
  • Derivations: Derive the second derivative test from the two-variable Taylor expansion, identify the quadratic form Q, and use definiteness conditions (link to properties of 2×2 symmetric matrices). Include the expression for D and the decision table.
  • Procedural problems: “Find and classify the critical points of f(x, y) = …” Show all steps: compute partials, solve fₓ = fᵧ = 0, compute second partials, compute D and fₓₓ, conclude. If D = 0, add a higher-order argument.
  • Absolute extrema on a domain: Include both interior and boundary analysis. For circular/elliptic boundaries, parametrize with x = a cos t, y = b sin t. For line segments, reduce to single-variable and check endpoints.
  • Diagrams: A clean contour sketch indicating local min/max vs saddle, or the domain with boundary path and indicated extremal points. Label axes, level values, and key points.
  • Connections: You may be asked to mention that constrained extrema in general are treated by Lagrange’s method of multipliers (separate topic) and that Taylor’s theorem justifies the second derivative test (separate topic).

Quick check

  1. For f(x, y) with fₓ = fᵧ = 0 at (a, b) and D(a, b) < 0, what is (a, b)?
  2. State the condition(s) under which a continuous function on a region is guaranteed to attain absolute maxima and minima.
  3. For f(x, y) = x² − y², classify the point (0, 0) using the second derivative test.

Answers: 1) A saddle point. 2) When the domain is nonempty, closed, and bounded (and f is continuous), by the Extreme Value Theorem. 3) fₓₓ = 2, fᵧᵧ = −2, fₓᵧ = 0 ⇒ D = (2)(−2) − 0 = −4 < 0 ⇒ saddle point.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?