Finding the maximum value of a function is a fundamental skill in calculus and mathematical analysis, essential for solving optimization problems in physics, economics, engineering, and data science. Whether you are trying to maximize profit, minimize cost, or determine the peak height of a projectile, the process relies on understanding how a function behaves—specifically, where it stops increasing and starts decreasing. This guide walks through the systematic approach to locating these peaks, covering both single-variable and multivariable scenarios, along with the critical tests used to verify your results.
Understanding the Concept of a Maximum
Before diving into calculations, it is vital to distinguish between two types of maximum values. There can only be one global maximum value, though it may occur at multiple points. A global maximum (or absolute maximum) is the highest value the function attains across its entire domain. A local maximum (or relative maximum) is a peak within a specific neighborhood; the function value is higher than all nearby points, but not necessarily the highest overall.
Quick note before moving on.
Visually, on a graph $y = f(x)$, a maximum looks like the top of a hill. But the slope of the tangent line at that exact peak is zero (horizontal), provided the function is smooth and differentiable there. This geometric intuition forms the basis of the analytical methods used to find these points algebraically.
The Standard Procedure for Single-Variable Functions
For a continuous function $f(x)$ defined on a closed interval $[a, b]$, the Extreme Value Theorem guarantees that both a maximum and a minimum exist. The standard workflow to find them involves three main stages: finding candidates, classifying them, and comparing values.
Step 1: Find the First Derivative
The first derivative, $f'(x)$, represents the instantaneous rate of change (slope) of the function. To locate potential peaks, calculate $f'(x)$ using standard differentiation rules (power rule, product rule, quotient rule, chain rule) Which is the point..
Step 2: Identify Critical Points
Critical points are the $x$-values where the derivative is zero or undefined. These are the only places inside an open interval $(a, b)$ where a local maximum or minimum can occur That's the whole idea..
- Set $f'(x) = 0$ and solve for $x$.
- Identify any $x$-values where $f'(x)$ does not exist (e.g., sharp corners, cusps, vertical tangents, or discontinuities).
- Compile a list of all critical numbers that fall within the domain of the original function $f(x)$.
Step 3: Apply the First or Second Derivative Test
Finding critical points only gives you candidates. You must test each candidate to determine if it is a maximum, a minimum, or neither (like an inflection point).
The First Derivative Test analyzes the sign of $f'(x)$ on intervals around the critical point $x = c$:
- If $f'(x)$ changes from positive to negative at $c$, $f(c)$ is a local maximum. The function climbs up, flattens, then descends.
- If $f'(x)$ changes from negative to positive, it is a local minimum.
- If the sign does not change, it is neither (often a saddle point).
The Second Derivative Test is often faster if the second derivative $f''(x)$ is easy to compute. Evaluate $f''(c)$:
- If $f''(c) < 0$, the graph is concave down at $c$, confirming a local maximum.
- If $f''(c) > 0$, the graph is concave up, indicating a local minimum.
- If $f''(c) = 0$, the test is inconclusive; you must revert to the First Derivative Test.
Step 4: Evaluate Endpoints (Closed Intervals)
If the domain is a closed interval $[a, b]$, the endpoints $x = a$ and $x = b$ are automatically candidates for the global maximum. The Extreme Value Theorem dictates that the global extrema must occur either at critical points or at endpoints. You must calculate $f(a)$ and $f(b)$ and compare these values against the function values at your critical points.
Step 5: Compare Values to Find the Global Maximum
Create a table of candidates and their corresponding function values:
| Candidate $x$ | Type | $f(x)$ Value |
|---|---|---|
| Critical Point 1 | Local Max/Min | $y_1$ |
| Critical Point 2 | Local Max/Min | $y_2$ |
| Endpoint $a$ | Boundary | $f(a)$ |
| Endpoint $b$ | Boundary | $f(b)$ |
The largest $y$-value in this table is the global maximum on that interval. If the domain is open $(a, b)$ or infinite $(-\infty, \infty)$, you must analyze the limits as $x$ approaches the boundaries or infinity. If $\lim_{x \to \infty} f(x) = \infty$, no global maximum exists.
Worked Example: Polynomial Optimization
Let’s apply this to a concrete example: Find the maximum value of $f(x) = -2x^3 + 3x^2 + 12x - 5$ on the interval $[-2, 3]$.
1. Derivative: $f'(x) = -6x^2 + 6x + 12$
2. Critical Points: Set $f'(x) = 0$: $-6x^2 + 6x + 12 = 0$ Divide by -6: $x^2 - x - 2 = 0$ Factor: $(x - 2)(x + 1) = 0$ Critical points: $x = 2$ and $x = -1$. Both are in $[-2, 3]$.
3. Second Derivative Test: $f''(x) = -12x + 6$
- At $x = -1$: $f''(-1) = 12 + 6 = 18 > 0$ $\rightarrow$ Local Minimum.
- At $x = 2$: $f''(2) = -24 + 6 = -18 < 0$ $\rightarrow$ Local Maximum.
4. Evaluate Candidates:
- $f(-2) = -2(-8) + 3(4) + 12(-2) - 5 = 16 + 12 - 24 - 5 = \mathbf{-1}$
- $f(-1) = -2(-1) + 3(1) + 12(-1) - 5 = 2 + 3 - 12 - 5 = \mathbf{-12}$ (Local Min)
- $f(2) = -2(8) + 3(4) + 12(2) - 5 = -16 + 12 + 24 - 5 = \mathbf{15}$ (Local Max)
- $f(3) = -2(27) + 3(9) + 12(3) - 5 = -54 + 27 + 36 - 5 = \mathbf{4}$
5. Conclusion: Comparing ${-1, -12, 15, 4}$, the global maximum value is 15, occurring at $x = 2$ Not complicated — just consistent..
Finding Maxima for Multivariable Functions
In higher dimensions, the concept translates to finding the peak of a surface $z =
In several variables the “first‑derivative” condition is replaced by the vanishing of the gradient.
For a function (g:\mathbb{R}^{n}\to\mathbb{R}) that is differentiable on an open set containing the region of interest, a critical point occurs where
[ \nabla g(x_1,\dots ,x_n)=\bigl(\partial_{x_1}g,\dots ,\partial_{x_n}g\bigr)=\mathbf{0}. ]
Solving (\nabla g=\mathbf{0}) yields all interior candidates It's one of those things that adds up..
Classifying critical points
The second‑order information is encoded in the Hessian matrix
[ H_g(x)=\bigl[\partial_{x_i}\partial_{x_j}g(x)\bigr]_{i,j}. ]
If (H_g) is positive definite at a critical point, the function curves upward in every direction and the point is a local minimum.
If (H_g) is negative definite, the function curves downward in every direction and the point is a local maximum.
When the Hessian is indefinite (has both positive and negative eigenvalues) the critical point is a saddle point, not an extremum.
When the domain is a closed, bounded region (D\subset\mathbb{R}^{n}), the Extreme Value Theorem guarantees that a global maximum must be attained either at an interior critical point or on the boundary of (D).
Boundary analysis
The boundary consists of lower‑dimensional pieces (edges, faces, curves). One can treat each piece by restricting the function to that piece and repeating the one‑variable procedure, or by employing Lagrange multipliers when the boundary is described by one or more equations (h(x)=0).
Worked example: maximizing a quadratic surface on a rectangle
Consider
[ g(x,y)= -x^{2}-y^{2}+4x+6y, ]
and let the domain be the rectangle
[ D={(x,y)\mid 0\le x\le 5,;0\le y\le 4}. ]
- Gradient and interior critical points
[ \frac{\partial g}{\partial x}= -2x+4,\qquad \frac{\partial g}{\partial y}= -2y+6. ]
Setting both partial derivatives to zero gives
[ -2x+4=0;\Longrightarrow;x=2,\qquad -2y+6=0;\Longrightarrow;y=3. ]
The point ((2,3)) lies inside (D), so it is an
interior candidate for an extremum It's one of those things that adds up..
- Classification using the Hessian
To determine the nature of $(2,3)$, we compute the second partial derivatives: [ \frac{\partial^2 g}{\partial x^2} = -2, \quad \frac{\partial^2 g}{\partial y^2} = -2, \quad \frac{\partial^2 g}{\partial x \partial y} = 0. ]
The Hessian matrix is: [ H_g(2,3) = \begin{pmatrix} -2 & 0 \ 0 & -2 \end{pmatrix}. ] Since both eigenvalues are negative (or since the matrix is negative definite), the point $(2,3)$ is a local maximum Simple, but easy to overlook..
The value at this point is: [ g(2,3) = -(2)^2 - (3)^2 + 4(2) + 6(3) = -4 - 9 + 8 + 18 = \mathbf{13}. ]
- Boundary Analysis
We must now check the four edges of the rectangle $D$:
- Edge 1 ($x=0, 0 \le y \le 4$): $g(0,y) = -y^2 + 6y$. The maximum of this parabola occurs at $y=3$, giving $g(0,3) = 9$. The endpoints are $g(0,0)=0$ and $g(0,4)=8$.
- Edge 2 ($x=5, 0 \le y \le 4$): $g(5,y) = -25 - y^2 + 20 + 6y = -y^2 + 6y - 5$. The maximum occurs at $y=3$, giving $g(5,3) = 4$. The endpoints are $g(5,0)=-5$ and $g(5,4)=-1$.
- Edge 3 ($y=0, 0 \le x \le 5$): $g(x,0) = -x^2 + 4x$. The maximum occurs at $x=2$, giving $g(2,0) = 4$. The endpoints are $g(0,0)=0$ and $g(5,0)=-5$.
- Edge 4 ($y=4, 0 \le x \le 5$): $g(x,4) = -x^2 - 16 + 4x + 24 = -x^2 + 4x + 8$. The maximum occurs at $x=2$, giving $g(2,4) = 12$. The endpoints are $g(0,4)=8$ and $g(5,4)=-1$.
4. Conclusion
We compare all candidate values found:
- Interior critical point: $g(2,3) = 13$
- Boundary maxima: ${9, 4, 4, 12}$
- Boundary corners: ${0, -5, 8, -1}$
The global maximum value is 13, occurring at the interior point $(2,3)$. The global minimum value is -5, occurring at the corner $(5,0)$ Less friction, more output..
Summary of Optimization Workflow
Whether working in one dimension or multiple dimensions, the process of finding absolute extrema follows a consistent logical structure:
-
- Day to day, Check Boundaries: If the domain is restricted, evaluate the function along the edges or using Lagrange multipliers. Compare Values: Evaluate the function at every candidate point and boundary extreme. Identify Candidates: Find all critical points where the derivative (or gradient) is zero or undefined.
- The largest value is your global maximum, and the smallest is your global minimum.