Calculus Optimization Calculator for Maximum and Minimum Values
Find local and absolute maxima and minima of a single-variable function on a finite closed interval. The calculator differentiates the function, locates critical points, checks both endpoints, classifies candidates, and graphs the result locally in your browser.
Enter the optimization problem
Use ^ for powers. Supported functions include sin, cos, tan, exp, ln, log, sqrt, and abs.
Keyboard shortcut: Ctrl/⌘ + Enter. Trigonometric inputs use radians.
Advertisement
Optimization result
Absolute maximum
Critical points and endpoint comparison
| Candidate | x | f(x) | f′(x) |
|---|---|---|---|
| Calculate a function to list its candidates. | |||
Calculation method
- Enter a function and closed interval to see the optimization steps.
Function graph and extrema
Calculate a function to draw it. Gaps represent undefined or non-real values.
Calculator methodology and limits
- Developed and reviewed by
- Starlight Robotics calculator team
- Last reviewed
- Method
- Symbolic differentiation → numerical critical-point search → first-derivative classification → closed-interval candidate comparison.
- Input limits
- One variable, 300 characters, finite bounds from −1 trillion to 1 trillion, and up to 200 displayed critical points.
- Privacy
- Your function, interval, and results stay in your browser; no solving API receives them.
- Numerical limit
- Highly oscillatory functions, extremely narrow features, discontinuities, or roots very close together may require a shorter interval.
How closed-interval optimization works
For a function that is continuous on [a,b] and differentiable inside the interval except at identifiable corner points, the closed-interval method compares every interior critical point with the two endpoints.
Candidates: endpoints a and b, plus interior values where f′(x)=0 or f′(x) does not exist while f(x) does.
- Differentiate
f(x)to obtainf′(x). - Find critical numbers in
(a,b). - Evaluate
fat every critical number and at both endpoints. - The largest candidate value is the absolute maximum; the smallest is the absolute minimum.
Local versus absolute extrema
Local maximum
The function changes from increasing to decreasing near the point. It need not be the largest value on the full interval.
Local minimum
The function changes from decreasing to increasing near the point. It need not be the smallest value on the full interval.
Absolute extrema
These are the greatest and least function values among all candidates over the selected closed interval.
Worked optimization examples
Quadratic on [−3, 4]
For f(x)=x², f′(x)=2x, so the interior critical point is x=0. Candidate values are 9, 0, and 16. The minimum is 0 and maximum is 16.
Cubic on [−3, 3]
For f(x)=x³−3x, f′(x)=3x²−3, giving critical points x=−1 and x=1. Endpoints still determine the absolute extrema.
Sine on [0, 2π]
For f(x)=sin(x), f′(x)=cos(x). The absolute maximum is 1 at π/2, and the absolute minimum is −1 at 3π/2.
Optimization calculator FAQs
How does the calculator find absolute maxima and minima?
It differentiates the function, searches numerically for interior critical points, evaluates the original function at those points and both endpoints, and compares all candidate values.
What is the difference between a local and an absolute extremum?
A local extremum is highest or lowest within a nearby neighborhood. An absolute extremum is the highest or lowest value on the entire selected interval.
Why are endpoints included?
An absolute maximum or minimum can occur at an endpoint even though the derivative there is not zero. The closed-interval method must test both endpoints.
What does “stationary point” mean in the results?
It means f′(x)=0, but the first derivative does not change sign there. Such a point may be a stationary inflection rather than a maximum or minimum.
Can I use an open or infinite interval?
Not directly. This calculator uses finite closed intervals. For open or infinite intervals, analyze limits near excluded endpoints or infinity with the Limit Calculator.
Why does a discontinuity produce a warning?
The extreme value theorem applies to continuous functions on closed intervals. If sampled values are undefined or non-real, the calculator withholds absolute-extrema claims and recommends restricting the interval to a continuous domain.
Can numerical critical-point searches miss a point?
They can for very rapid oscillation, extremely narrow features, or many roots packed into a large interval. Shorten the interval and compare with symbolic derivative analysis when precision is critical.
Does my expression leave the browser?
No. Expression parsing, differentiation, numerical search, evaluation, report generation, and graphing all run on your device.
