Calculus, Linear Algebra & Discrete Math Derivatives & Differentiation Fermat's theorem and the Extreme Value Theorem

Critical Points, Local Max & Min Calculator

Enter the coefficients of a polynomial up to degree five and this calculator finds every critical number — each x where f'(x) = 0 — classifies it with the first derivative test as a local maximum, a local minimum or neither, and then compares those points against the two endpoints to give you the absolute maximum and minimum on your closed interval. It also reports the intervals where f is increasing and decreasing. Polynomials are used because their derivatives are exact, so the classification is not at the mercy of a numerical approximation.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
Coefficient of x⁵Leave at 0 for a quartic or lower.0
Coefficient of x⁴Leave at 0 for a cubic or lower.0
Coefficient of x³The cubic term. The default builds f(x) = x³ − 3x.1
Coefficient of x²The quadratic term.0
Coefficient of xThe linear term.-3
Constant termShifts the graph vertically; it never moves a critical number.0
Interval start aLeft endpoint of the closed interval used for the absolute extrema.-3
Interval end bRight endpoint. If you enter it below a, the two are swapped.3

It returns

  • Absolute maximum of f on [a, b] — The largest value f attains anywhere on the closed interval.
  • x where the maximum occurs
  • Absolute minimum of f on [a, b]
  • x where the minimum occurs
  • Critical numbers found
  • Local maxima
  • Local minima

The formula

f(c)=0
f(cδ)·f(c+δ)<0
f(c)>0local minimum

In plain text: c is a critical number when f'(c) = 0 (or f'(c) is undefined); on [a, b] the absolute extrema are max/min of f over {a, b} ∪ {critical numbers in (a, b)}

  • fThe function being analysed — here a polynomial of degree 5 or less
  • f'The first derivative; its sign is the rate of change of f
  • cA critical number — an interior point of the domain where f' vanishes
  • [a, b]The closed interval on which the absolute extrema are sought

A polynomial is differentiable everywhere, so the 'f' undefined' branch of the definition never fires here. It matters for functions such as |x| or x^(2/3).

Updated Category Derivatives & Differentiation Verified against published test cases Reading time 12 min

What a critical number is, and why it is the whole optimisation problem

A critical number of f is an interior point c of the domain where f'(c) = 0 or where f' fails to exist. Fermat's theorem says that every local maximum and every local minimum in the interior of the domain occurs at a critical number. That single fact is why optimisation reduces to solving one equation: you do not have to search the whole real line for a peak, you only have to look at the finite set of points where the tangent line is horizontal or missing.

The converse is not true, and that is the part students lose marks on. A critical number is a candidate, not a winner. The function f(x) = x³ has f'(0) = 0, so 0 is a critical number, yet f is strictly increasing through it and 0 is neither a maximum nor a minimum. Every critical number has to be tested, and the calculator above does that with the first derivative test rather than the second, because the first derivative test never returns "inconclusive".

On a closed, bounded interval the picture is even tidier. The Extreme Value Theorem guarantees that a continuous function on [a, b] actually attains an absolute maximum and an absolute minimum somewhere on that interval. Those extremes can only sit at an interior critical number or at one of the two endpoints, so the whole search collapses to a short list you can evaluate by hand. Polynomials are continuous and differentiable everywhere, so both theorems apply without any caveat.

How the calculator finds and classifies the critical numbers

You supply the coefficients, so the derivative is exact rather than approximate. If f(x) = a₅x⁵ + a₄x⁴ + a₃x³ + a₂x² + a₁x + a₀, then the power rule gives f'(x) = 5a₅x⁴ + 4a₄x³ + 3a₃x² + 2a₂x + a₁ term by term, and differentiating once more gives f''. Every value quoted on the page is computed from those exact coefficient lists using Horner's scheme, which is both faster and numerically better behaved than raising powers separately.

Finding the zeros of f' is the only genuinely numerical step. A quartic has a closed-form solution, but it is notoriously ill-conditioned, so the calculator instead brackets roots. It sweeps a window wide enough to contain every real root — the Cauchy bound 1 + max|aₖ/aₙ| guarantees that all real zeros of a polynomial lie inside it — and bisects each sign change to full double precision. A sign change is a foolproof detector for a root of odd multiplicity, but it is blind to roots of even multiplicity, where the derivative touches zero without crossing. Those are picked up separately, by looking for local minima of |f'| and refining them; that is how gets its critical number at 0 reported rather than silently dropped.

Classification then uses the first derivative test. The calculator evaluates f' a small distance either side of the critical number, with that distance capped at 30% of the gap to the nearest neighbouring root so the probe never strays past another critical point. A change from negative to positive means the function stops falling and starts rising, which is a local minimum; positive to negative is a local maximum; the same sign on both sides means f is monotonic through the point and it is neither. The second derivative is still shown in the table because it is what most courses ask for, but it is reported as evidence rather than used as the decision rule — it is silent exactly at the interesting points such as x⁴ at the origin.

Worked example: f(x) = x³ − 3x on [−3, 3]

This is the default. Work it entirely by hand and compare with the output above.

  1. Differentiate. f'(x) = 3x² − 3.
  2. Solve f'(x) = 0. 3x² = 3, so x² = 1 and x = −1 or x = 1. Two critical numbers, both inside [−3, 3].
  3. Apply the first derivative test at x = −1. f'(−2) = 3(4) − 3 = 9 > 0 and f'(0) = −3 < 0. The sign goes plus to minus, so x = −1 is a local maximum. Its value is f(−1) = −1 + 3 = 2.
  4. And at x = 1. f'(0) = −3 < 0 and f'(2) = 12 − 3 = 9 > 0. Minus to plus, so x = 1 is a local minimum, with f(1) = 1 − 3 = −2.
  5. Evaluate at the endpoints. f(−3) = −27 + 9 = −18 and f(3) = 27 − 9 = 18.
  6. Compare the four candidates. The list is f(−3) = −18, f(−1) = 2, f(1) = −2, f(3) = 18. The absolute maximum is 18 at x = 3 and the absolute minimum is −18 at x = −3.

Notice what happened: neither absolute extreme is at a local extreme. The local maximum value of 2 is beaten by the endpoint value 18, and the local minimum value of −2 is beaten by −18. Skipping the endpoints would have produced two wrong answers, which is the single most common error on this type of question. Cross-check the second derivative if you like: f''(x) = 6x, so f''(−1) = −6 < 0 (maximum) and f''(1) = 6 > 0 (minimum), agreeing with the sign test.

How to read the results

Start with the count of critical numbers. A polynomial of degree n has a derivative of degree n − 1, so it can have at most n − 1 critical numbers, and it may have fewer. A cubic has either two or none — never exactly one unless the two coincide into a repeated root, which is precisely the case. If you expected three turning points on a cubic, the model behind the question is wrong, not the calculator.

Then read the classification column. A local maximum and a local minimum must alternate as you move left to right along the axis, because f' has to change sign each time. Two consecutive maxima with nothing between them is impossible; if you think you see that, one of the roots between them is a repeated root classified as "neither".

The position column tells you whether each critical number lies in the closed interval you entered. Only interior ones compete for the absolute extrema. A critical number outside [a, b] is still a genuine feature of the function, and it is still reported, but it is irrelevant to the closed-interval answer — which is why the calculator labels it rather than hiding it.

Finally, compare the absolute maximum with the largest local maximum. When the absolute extreme sits at an endpoint, the function is still climbing or still falling when the interval runs out, so widening the interval would change the answer. When it sits at an interior critical number, widening the interval in that direction will not change that extreme. That distinction is what makes the endpoint check worth doing on every problem, and it is the same distinction that separates an interior optimum from a boundary optimum in any constrained optimisation problem you meet later.

Reference: critical numbers of common polynomials

Each row is solved exactly by hand; enter the coefficients above to reproduce it.
f(x)f'(x)Critical numbersClassification
2x0Local minimum
3x²0Neither (repeated root)
x³ − 3x3x² − 3−1, 1Max at −1, min at 1
x³ − 3x²3x² − 6x0, 2Max at 0, min at 2
x⁴ − 4x²4x³ − 8x−√2, 0, √2Min, max, min
x⁴4x³0Local minimum
x⁵ − 5x5x⁴ − 5−1, 1Max at −1, min at 1
2x + 12noneStrictly increasing

For x⁴ − 4x² the two minima both give f = −4, so the absolute minimum is attained at two distinct points. The calculator reports one of them; both are correct.

Mistakes that cost marks on critical point questions

  • Forgetting the endpoints. On a closed interval the absolute extremes are frequently at a or b, as the default example shows. Fermat's theorem only covers interior points.
  • Treating every critical number as a turning point. A repeated root of f' gives a horizontal tangent with no change of direction. Always run the sign test.
  • Using the second derivative test and stopping when it returns zero. f''(c) = 0 tells you nothing at all; fall back to the first derivative test, which always decides.
  • Reporting the critical number instead of the value. "The maximum is at x = −1" and "the maximum is 2" are different statements. Read the question for which one it wants.
  • Ignoring points where f' does not exist. Polynomials have none, but |x|, x^(2/3) and any piecewise function do, and those are critical numbers too.
  • Assuming a local maximum outranks every endpoint value. It only outranks nearby values, which is exactly what "local" means.

Why this tool restricts itself to polynomials

Classification is a question about signs, and signs are exactly what numerical differentiation gets wrong near a zero. By taking coefficients rather than a typed expression, the derivative here is obtained symbolically by the power rule, so f' and f'' are exact and only root-finding is approximate. If you need the derivative of a non-polynomial at a point, use the numerical derivative calculator, which is built for that and reports its own error estimate; to locate a zero of any function inside a bracket, use the bisection method calculator.

Where this sits among the other tools

Critical points are the one-variable case of a much larger idea. In several variables the condition f' = 0 becomes ∇f = 0, and you find those points with the gradient vector calculator before classifying them with a second-derivative (Hessian) test. The rate of change in a chosen direction, which is zero in every direction at an interior optimum, is what the directional derivative calculator computes.

Solving f'(x) = 0 is itself a root-finding problem, and for functions with no closed-form derivative zeros that is how it is done in practice. The bisection method is the slow, unconditionally safe way to do it: it needs only a sign change and it cannot diverge. Faster methods trade that guarantee for speed.

Once you know where a function turns, integration questions become easier too: the area between a curve and the axis splits naturally at the zeros and turning points, which is what a Riemann sum approximates and what an arc length integral traverses. Optimisation, root-finding and quadrature are the three numerical pillars of a first calculus sequence, and critical points are where the first of them starts.

One assumption worth stating plainly: everything on this page concerns real critical numbers. A quartic derivative can have complex roots, and those never appear as turning points on a real graph. If the calculator reports fewer critical numbers than the degree allows, the missing ones are complex, not lost.

Key terms

Critical number
An interior point c of the domain of f at which f'(c) = 0 or f'(c) does not exist. The point (c, f(c)) is the critical point.
Local (relative) extremum
A value that is largest or smallest among all values in some open interval around the point. It says nothing about the rest of the domain.
Absolute (global) extremum
The largest or smallest value over the whole set being considered — here the closed interval [a, b].
Extreme Value Theorem
A function continuous on a closed bounded interval attains both an absolute maximum and an absolute minimum on that interval.
Fermat's theorem
If f has a local extremum at an interior point c and f'(c) exists, then f'(c) = 0.

Frequently asked questions

What is the difference between a critical point and a turning point?

Every turning point is a critical point, but not every critical point is a turning point. A critical point is any place where the derivative is zero or undefined; a turning point is one where the function actually changes direction. f(x) = x³ has a critical point at the origin with a perfectly horizontal tangent, yet the function keeps increasing through it, so there is no turn. The calculator labels that case "neither".

Why does the calculator use the first derivative test instead of the second?

Because the first derivative test always gives an answer. The second derivative test fails whenever f''(c) = 0, and that happens at some of the most commonly set examples — x⁴ at the origin has f'' = 0 and is still a genuine minimum. The table shows f''(c) so you can quote it in a solution, but the classification column comes from the sign of f' either side.

How many critical numbers can a polynomial have?

At most one fewer than its degree. A cubic has a quadratic derivative, so at most two; a quartic at most three; a quintic at most four. It can have fewer if the derivative has complex or repeated roots. A cubic with a positive leading coefficient and a derivative discriminant below zero has none at all and is strictly increasing everywhere.

Can the absolute maximum occur at more than one point?

Yes. An even function such as x⁴ − 4x² on a symmetric interval attains its minimum of −4 at both x = −√2 and x = +√2. The Extreme Value Theorem promises the value is attained, not that the location is unique. The calculator reports one location; if your interval is symmetric and the polynomial is even or odd, check for a mirrored twin.

What happens if I enter the interval endpoints backwards?

They are swapped automatically and a note tells you so. An interval [a, b] is only meaningful with a ≤ b, and a reversed pair is almost always a typing slip rather than a request for a signed interval. If you genuinely enter a = b, the interval is a single point and both extremes equal f(a).

Does adding a constant to f move the critical numbers?

No. The derivative of a constant is zero, so f(x) + k and f(x) have identical derivatives and identical critical numbers. What changes is every reported value: the local and absolute extreme values all shift by k. This is a quick way to sanity-check the tool — change the constant term and confirm the x values stay put.

How does the calculator find roots of the derivative that never cross zero?

It looks for local minima of |f'| and refines them by ternary search, then accepts the point if the derivative there is zero to within a tolerance scaled to the size of the derivative. Bisection alone finds only sign changes, which would miss the repeated root of f'(x) = 3x² at the origin. Very shallow near-zeros of high-degree polynomials with large coefficients remain the hardest case for any numerical method.

Is a horizontal inflection point the same as a saddle point?

In one variable, effectively yes — both names describe a point with a horizontal tangent where the function does not turn, as at the origin of . The word "saddle" is more usual in two or more variables, where the surface rises in one direction and falls in another. The calculator groups them under one label because in one dimension the distinction carries no extra information.

Why do I need a closed interval to talk about absolute extrema?

Because on an open or unbounded interval the extremes may not exist. On (0, 1) the function f(x) = x gets arbitrarily close to 1 but never reaches it, so there is no absolute maximum. Closing the interval supplies the endpoint that the supremum needs, which is exactly the hypothesis the Extreme Value Theorem requires.

References

  • Calculus, 8th edition (Fermat's theorem, the closed interval method, first and second derivative tests) — James Stewart, Cengage Learning
  • Calculus, Volume 1OpenStax, Rice University
  • Numerical Recipes: The Art of Scientific Computing, 3rd edition (root bracketing and bisection) — Cambridge University Press