A Peak Isn't Always the Winner: Extrema Calculator Guide
About the Author

This Extrema Calculator catches a common mistake: calling the local peak at (−1, 3) the largest value of x³ − 3x + 1 on [−2, 3]. The right endpoint reaches 19. Finding where a curve turns is only part of the job; you also need to compare its heights across the entire allowed interval. The examples below show how that comparison works, why corners count, and how changing one endpoint can change the answer.
An Extrema Calculator Example Where the Endpoint Wins
Start with f(x) = x³ − 3x + 1. Its derivative is f′(x) = 3x² − 3 = 3(x − 1)(x + 1). Setting the derivative equal to zero gives x = −1 and x = 1, both inside [−2, 3]. These are candidates, not final answers.
The derivative is positive to the left of −1, negative between −1 and 1, and positive after 1. That makes x = −1 a local maximum and x = 1 a local minimum. But “local” means compared with nearby inputs. It says nothing about a distant endpoint.
Left endpoint: f(−2) = −8 + 6 + 1 = −1
Interior peak: f(−1) = −1 + 3 + 1 = 3
Interior valley: f(1) = 1 − 3 + 1 = −1
Right endpoint: f(3) = 27 − 9 + 1 = 19
So the absolute maximum is 19 at x = 3. The absolute minimum is −1, attained at both x = −2 and x = 1. Keep both locations. A maximum or minimum value can be unique even when several inputs produce it. The range on this interval is [−1, 19], because continuity fills every height between those two extremes.
Build the Candidate List Before Comparing Heights
For a continuous function on a closed, bounded interval [a, b], the extreme value theorem guarantees an absolute maximum and an absolute minimum. That guarantee is the reason the closed interval method works. OpenStax explains the theorem and its assumptions in its maxima and minima chapter.
First establish continuity. Then find interior inputs where f′(x) = 0 or where f′ does not exist while f itself remains defined. Add a and b. Evaluate the original function at every candidate, and compare those output values. Solving f′(x) = 0 alone leaves the endpoint work unfinished.
The derivative calculator helps with differentiation, while the critical points calculator focuses on locating the interior candidates. The additional task here is deciding which candidates actually give the largest and smallest values on the chosen interval.
Don't substitute candidates into f′ and compare the results. For smooth stationary points those values are all zero. Substitute into f. The derivative identifies where to look; the original function tells you the height.
Move the Right Boundary and Watch the Winner Change
Keep the same cubic and the same left endpoint −2, but move the right endpoint to b > 1. The interior peak stays at height 3. The endpoint catches it when f(b) = 3, or b³ − 3b − 2 = 0. Factoring gives (b − 2)(b + 1)² = 0, so the relevant boundary is b = 2.
At b = 1.5, the endpoint value is 3.375 − 4.5 + 1 = −0.125. The local peak at x = −1 is still the absolute maximum. At b = 2, the peak and endpoint tie at 3. At b = 2.5, the endpoint reaches 15.625 − 7.5 + 1 = 9.125 and wins outright.
Try an interval prediction
For x³ − 3x + 1 on [−2, 2], name every input that attains an absolute extremum before calculating again.
Reveal the four locations
The minimum −1 occurs at x = −2 and x = 1. The maximum 3 occurs at x = −1 and x = 2. Both extrema have an endpoint location and an interior location.
This gives a useful check for any maximum minimum calculator: widening an interval cannot lower its absolute maximum or raise its absolute minimum. The old candidates are still available. If your answer violates that rule, inspect the interval, the function, and any rounding before trusting it.
A Flat Tangent Can Be a Valley or Neither Extremum
For f(x) = x⁴ on [−2, 2], f′(x) = 4x³ is zero at x = 0. The second derivative is 12x², also zero there. The second derivative test is inconclusive, yet the minimum is easy to prove: x⁴ ≥ 0 everywhere, with equality only at zero. The maximum is 16 at both endpoints.
Compare f(x) = x³ on the same interval. Again f′(0) = 0 and f″(0) = 0. This time 3x² is positive on both sides of zero, so the function keeps increasing. The origin is stationary but is neither a local maximum nor a local minimum. The absolute extrema are −8 at −2 and 8 at 2.
A derivative sign change settles both cases. Negative to positive means a local minimum; positive to negative means a local maximum; unchanged sign means neither for these isolated stationary points. The concavity calculator investigates how the slope changes, and the inflection point calculator addresses changes in concavity. Those questions differ from finding the greatest output.
Corners and Repeated Peaks Still Belong on the List
Consider f(x) = |x − 2| on [0, 5]. There's no horizontal tangent at x = 2: the derivative jumps from −1 to 1 and is undefined at the corner. Nevertheless, f(2) = 0 is the absolute minimum. The endpoints give f(0) = 2 and f(5) = 3, making 3 the absolute maximum.
This is why “critical” includes more than “derivative equals zero.” A corner where the function exists is a valid candidate. A hole where the function itself is undefined is not a candidate value. Those two situations require different treatment.
For f(x) = 2 sin(x) + 1 on [0, 2π], f′(x) = 2 cos(x). Its interior zeros are π/2 and 3π/2. Their heights are 3 and −1; both endpoint heights are 1. Thus the maximum is 3 and the minimum is −1. Extending to [0, 4π] adds another occurrence of each extreme without changing either value. Trigonometric derivative formulas here assume radians.
A Bound Is Not Necessarily an Attained Maximum
Closed endpoints matter. The function f(x) = x on (0, 1) has no maximum and no minimum. You can approach 1 as closely as you like, but 1 is excluded; every allowed input has a larger allowed input. The supremum is 1 and the infimum is 0, neither attained. On [0, 1], both are attained extrema.
Continuity matters too. The expression 1/x is undefined at zero, so you cannot apply the closed interval method across [−1, 1] as though it were continuous. Values become unbounded near the missing point. The limit calculator is relevant when the question involves approaching a boundary or singularity.
This tool handles finite closed intervals for its stated continuous function families. Polynomial critical points are found numerically from derivative roots; sine, cosine, and absolute-value candidates follow their known formulas. The graph visualizes the result rather than supplying the candidate list. Very close roots and nearly equal heights can be sensitive to floating-point rounding, so retain exact fractions or symbolic multiples of π when writing a final mathematical proof.
For a constant such as f(x) = 7, every allowed input gives both the maximum and minimum, and the range is the single value 7. There are infinitely many non-strict local extrema on the interior, but no strict turning points. Reporting just the two endpoints as the only winning locations would miss the rest of the interval.



