Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Optimization Visualizer - Critical Points

How to use
  1. The Function picker on the left lists six families in two groups, Polynomial and Transcendental, each tagged with what it produces; tapping one loads it with its default search window. Learn more about the function families
  2. The Display checkboxes switch the f(x)f(x) curve, the dashed f′(x)f'(x), the dotted f′′(x)f''(x) and the critical-point markers on and off. Learn more about the display toggles
  3. The left endpoint a and right endpoint b sliders set the search window [a,b][a, b]; the band, the markers and the table follow, and Reset next to Parameters restores the family default. Learn more about the a and b sliders
  4. The Accent color picker under Appearance recolors the table edge and the slider thumbs; its Reset restores the default blue. Learn more about the accent color
  5. The S, M, L and XL buttons set the plot size, and the legend under the plot names the layers that are switched on. Learn more about the plot and legend
  6. The table under the plot has one row per critical point in [a,b][a, b]: its number, xx, f(x)f(x), f′′(x)f''(x), the second-derivative test and the verdict. Learn more about the critical-point table
  7. The verdict tag reads local max, local min or inflection; when f′′(c)f''(c) is about zero, the tool falls back to the sign of f′f' on each side. Learn more about the classification
  8. The info panel has two tabs: Explanation lists the critical points found right now with a note on the family, and Concepts covers the first- and second-derivative tests. Learn more about the info panel


x³ − 3xf(x) = x³ − 3x
×
880 × 460
f(x)f′(x)critical points (numbered)
Critical points on [a, b][a, b] = [-3, 3]
#
x
f(x)
f''(x)
Second-derivative test
Verdict
1
-1
2
-6
f′′(c) < 0 → concave down
local max
2
1
-2
6
f′′(c) > 0 → concave up
local min
f'(c) = 0 finds the candidates; sign of f''(c) classifies them. Positive: local min. Negative: local max. Zero or sign change: inflection.2nd-deriv test
Applieda=-3b=3f'=0 candidates · f'' classifies





Key Terms



Key Terms

Critical point — a value cc in the domain of ff where f′(c)=0f'(c) = 0 or f′(c)f'(c) is undefined. Every local maximum or minimum of a smooth function is a critical point.

Local maximum — a point cc where f(c)≥f(x)f(c) \ge f(x) for all xx near cc. The function value is at least as large as everything nearby.

Local minimum — a point cc where f(c)≤f(x)f(c) \le f(x) for all xx near cc. The function value is at least as small as everything nearby.

Inflection point — a point where f′′f'' changes sign. The curve switches from concave up to concave down or vice versa. An inflection point may or may not be a critical point.

Concave up — f′′(x)>0f''(x) > 0. The graph cups upward like a bowl.

Concave down — f′′(x)<0f''(x) < 0. The graph cups downward like a dome.

Second-derivative test — at a critical point cc: f′′(c)>0f''(c) > 0 gives a local min, f′′(c)<0f''(c) < 0 gives a local max, f′′(c)=0f''(c) = 0 is inconclusive.

Getting Started

The page opens with the x³ − 3x family loaded on the interval [−3,3][-3, 3]. You see:

• The solid blue curve of f(x)=x3−3xf(x) = x^3 - 3x.

• The dashed deep-blue curve of f′(x)=3x2−3f'(x) = 3x^2 - 3.

• A faint blue band over [a,b][a, b] marking the search window.

• Two colored markers on ff at the critical points: one deep-blue for the local max at x=−1x = -1 and one bright-blue for the local min at x=1x = 1.

Below the graph, the critical-point table lists each critical point with its coordinates, the value of f′′f'' at the point, the second-derivative test verdict, and a final classification tag.

To explore, drag the left endpoint a and right endpoint b sliders to change the search window, or switch families in the left panel to see different patterns of extrema and inflection points.

The Function Families

DemoSix families
Step 0 of 5
Six families are organized into two groups in the left panel, each tagged with its characteristic extrema count.

Polynomial:

• Quadratic f(x)=x2f(x) = x^2 — exactly one local minimum at the origin. The simplest non-trivial optimization.

• x³ − 3x — a cubic with a local max and a local min. The canonical both kinds at once example.

• x³ — a critical point at the origin where f′f' touches zero but doesn't change sign. The second-derivative test fails; first-derivative test reveals an inflection.

• x⁴ − 4x² — a W shape with two local minima and a local maximum. Multiple extrema of mixed kinds.

Transcendental:

• sin(x) — periodic, with infinitely many extrema. On [−2π,2π][-2\pi, 2\pi] you get four.

• e^(-x²) — the Gaussian bell curve. A single global maximum at the origin, flanked by two inflection points.

Quadratic: One Critical Point, No Ambiguity

f(x)=x2f(x) = x^2 on [−3,3][-3, 3]. Setting f′(x)=2x=0f'(x) = 2x = 0 gives a single critical point at x=0x = 0, and f′′(0)=2>0f''(0) = 2 > 0 classifies it as a local minimum immediately.

The three curves make the reasoning visible at once: ff is the parabola, f′f' is the line 2x2x crossing zero at the origin, and f′′f'' is the constant 22 sitting flat above the axis.
-5 5 -15 -10 -5 5 10 15 20 25 x y f(x) = x² f'(x) f''(x)
Quadratic on [-3, 3], frozen

One marker, at the origin. f′ is the line 2x crossing zero there, and f″ is the constant 2 lying flat above the axis - concave up everywhere, so the minimum is global.

Because f′′f'' is positive everywhere, the parabola is concave up everywhere, and that upgrades the verdict: the local minimum is also the global minimum on any interval you choose. Concavity that never changes sign is a strong condition, and it is exactly what makes quadratic optimization problems easy.

This is also the cleanest case of the second-derivative test — one evaluation, one sign, done, with no fallback needed.

x³ − 3x: a Maximum and a Minimum

    f(x)=x3−3xf(x) = x^3 - 3x has f′(x)=3x2−3f'(x) = 3x^2 - 3, so f′(x)=0f'(x) = 0 at x=±1x = \pm 1 — two critical points, and the second derivative f′′(x)=6xf''(x) = 6x separates them:

  • x=−1x = -1: f′′=−6<0f'' = -6 < 0, concave down, local max, with f(−1)=2f(-1) = 2
  • x=1x = 1: f′′=+6>0f'' = +6 > 0, concave up, local min, with f(1)=−2f(1) = -2

  • The markers are coloured accordingly — deep blue for the max, main blue for the min.
-5 5 -25 -20 -15 -10 -5 5 10 15 20 25 x y f(x) = x³ − 3x f'(x) f''(x)
x³ - 3x on [-3, 3], frozen

Two markers in different colours: a local max at x = -1 where f″ = -6, and a local min at x = +1 where f″ = +6. The dotted f″ line crosses zero between them, at the inflection.

Neither of these is a global extremum. A cubic runs off to +∞+\infty on one side and −∞-\infty on the other, so on a wide enough interval the endpoints beat both critical points. That distinction — local versus global — is the reason a real optimization problem always has to check the endpoints too.

Watch f′′f'' as you read across: it is negative left of the origin and positive right of it, crossing zero exactly at x=0x = 0. That crossing is an inflection point of ff, but it is not a critical point, because f′(0)=−3≠0f'(0) = -3 \neq 0. The tool marks only the critical points, which is why nothing appears there.

x³: Where the Second-Derivative Test Fails

f(x)=x3f(x) = x^3 has f′(x)=3x2f'(x) = 3x^2, which touches zero at x=0x = 0 without changing sign. So x=0x = 0 is a critical point — but f′′(0)=0f''(0) = 0, and the second-derivative test returns nothing at all.

The tool falls back to the first-derivative test: it samples f′f' just left and just right of the point, finds both positive, and reports inflection (touch) rather than a maximum or a minimum.
-5 5 -25 -20 -15 -10 -5 5 10 15 20 25 x y f(x) = x³ f'(x) f''(x)
x³ on [-3, 3], frozen

A single grey-blue marker at the origin, labelled inflection (touch). f′ = 3x² sits on the axis there without crossing it, which is exactly the case the second-derivative test cannot decide.

This family exists to make the limits of the tests explicit. f′′(c)=0f''(c) = 0 is not evidence of anything — the test is simply silent, and something else has to decide. Here the sign of f′f' on both sides does the work, and it says the function never stops increasing.

The finder itself has to work harder for this case too. A critical point where f′f' crosses zero is easy to bracket by a sign change; one where f′f' merely touches zero has no sign change to detect, so the tool scans separately for local minima of ∣f′∣|f'| that sit near zero. That is why this point is found at all.

x⁴ − 4x²: Three Critical Points in a W

    f(x)=x4−4x2f(x) = x^4 - 4x^2 gives f′(x)=4x3−8x=4x(x2−2)f'(x) = 4x^3 - 8x = 4x(x^2 - 2), so the critical points are x=0x = 0 and x=±2≈±1.4142x = \pm\sqrt{2} \approx \pm 1.4142. With f′′(x)=12x2−8f''(x) = 12x^2 - 8:

  • x=−1.4142x = -1.4142: f′′=16>0f'' = 16 > 0, local min, f=−4f = -4
  • x=0x = 0: f′′=−8<0f'' = -8 < 0, local max, f=0f = 0
  • x=1.4142x = 1.4142: f′′=16>0f'' = 16 > 0, local min, f=−4f = -4

  • Three markers, two of them at the same height.
-5 5 -25 -20 -15 -10 -5 5 10 15 20 25 x y f(x) = x⁴ − 4x² f'(x) f''(x)
x⁴ - 4x² on [-3, 3], frozen

Three markers: minima at ±1.4142 tied at f = -4, and a local max at the origin sitting at f = 0 - above both minima, and still only a local maximum.

The two minima tie exactly, at f=−4f = -4, because the function is even. That is worth noticing: a global minimum need not be unique, and any procedure that assumes it is will pick one arbitrarily.

The local maximum at the origin is the more interesting one. It is a maximum locally — the curve does fall away on both sides of it — while sitting at height 00, well above the two minima and well below where the quartic goes further out. "Local" is doing real work in that sentence, and the W shape is the clearest picture of why the word is there.

sin(x): Four Critical Points Over Two Periods

    On its default interval [−2π,2π][-2\pi, 2\pi], f(x)=sin⁡(x)f(x) = \sin(x) has f′(x)=cos⁡(x)f'(x) = \cos(x) vanishing four times: at x=±π2x = \pm\frac{\pi}{2} and x=±3π2x = \pm\frac{3\pi}{2}.

    The classification alternates, since f′′=−sin⁡(x)f'' = -\sin(x) flips sign at each one:

  • x=−4.7124x = -4.7124: local max, f=1f = 1
  • x=−1.5708x = -1.5708: local min, f=−1f = -1
  • x=1.5708x = 1.5708: local max, f=1f = 1
  • x=4.7124x = 4.7124: local min, f=−1f = -1
-5 -4 -3 -2 -1 1 2 3 4 5 -1 1 x y f(x) = sin(x) f'(x) f''(x)
sin(x) on [-2π, 2π], frozen

Four markers alternating max, min, max, min at ±π/2 and ±3π/2. Widen the window and the tool just finds more of the same two heights.

Every maximum ties at 11 and every minimum at −1-1, which is what periodicity guarantees. Widen the interval and the tool simply finds more of them — there is no largest critical point to find, only more copies of the same two heights.

That makes the search window matter in a way it does not for the polynomial families. On a periodic function "the maximum" is meaningless without an interval attached; what the tool reports is always the answer to "on this window", and the faint band across the graph is a reminder of which window that is.

The Gaussian: One Maximum and Two Inflections That Are Not Critical

f(x)=e−x2f(x) = e^{-x^2} has f′(x)=−2xe−x2f'(x) = -2x e^{-x^2}, which is zero only at x=0x = 0 — the exponential factor never vanishes. So there is exactly one critical point, and f′′(0)=−2<0f''(0) = -2 < 0 makes it a local maximum at f(0)=1f(0) = 1.

It is a global maximum too: the function is positive everywhere and decays to zero in both directions, so nothing can exceed the peak.
-5 -4 -3 -2 -1 1 2 3 4 5 -2 -1 1 x y f(x) = e⁻ˣ² f'(x) f''(x)
e^(-x²) on [-3, 3], frozen

One marker at the peak. The dotted f″ curve crosses zero at ±0.707 - the two inflection points on the shoulders - but neither is marked, because f′ is not zero there.

The dotted f′′f'' curve is where this family gets interesting. It equals (4x2−2)e−x2(4x^2 - 2)e^{-x^2} and crosses zero at x=±12≈±0.707x = \pm\frac{1}{\sqrt{2}} \approx \pm 0.707 — the two inflection points, one on each shoulder of the bell. In statistics those are the points one standard deviation out.

But neither is a critical point, and the tool marks neither, because f′f' is nowhere near zero there. Critical points come from f′f'; inflection points come from f′′f''. They are different questions asked of different derivatives, and this curve is the one where confusing them is easiest — which makes it the best place to keep them apart.

The a and b Sliders

DemoSearch window a and b
Step 0 of 5
The left endpoint a and right endpoint b sliders set the search window. As you drag:

• The faint blue band over [a,b][a, b] resizes.

• The critical-point finder re-runs and rebuilds the table.

• Critical points that fall outside the new window disappear; ones that fall inside appear.

• Markers, drop lines, and table rows update together.

If you set a>ba > b, the tool silently swaps them — only the interval matters. If the interval shrinks below a tiny threshold, the table reports interval too narrow until you give it a real interval.

This is useful for two reasons: you can zoom in on a single critical point to study it in isolation, or you can widen the window to see how many extrema a family produces over a long range.

The Reset button next to Parameters returns the interval to the family's default.

Reading the Critical-Point Table

The boxed table below the graph has one row per critical point. Each row reports:

• # — a numbered marker matching the colored dot on the graph.

• x — the location of the critical point.

• f(x) — the function value at that point.

• f''(x) — the value of the second derivative, the key input to the classification test.

• Second-derivative test — a short phrase explaining the verdict, including the rare cases where the test fails and the tool falls back to the first-derivative test.

• Verdict — a colored tag: local max (deep blue), local min (bright blue), or inflection (light blue).

When the table is empty, the cause appears in italics — either no critical points exist in the interval, or the interval is too narrow.

Classification - Max, Min, Inflection

Every smooth critical point has f′(c)=0f'(c) = 0. The sign of f′′(c)f''(c) tells you which kind:

• f''(c) > 0 — concave up at cc, so the curve cups upward and cc is a local minimum.

• f''(c) < 0 — concave down at cc, so the curve cups downward and cc is a local maximum.

• f''(c) ≈ 0 — the test is inconclusive. The tool falls back to the first-derivative test: look at the sign of f′f' on each side of cc:

– Negative-then-positive: local minimum.

– Positive-then-negative: local maximum.

– No sign change: inflection with horizontal tangent, as in f(x)=x3f(x) = x^3 at x=0x = 0.

The fallback test handles the cases where the second derivative is too gentle to give a clean verdict, but the first derivative still reveals what's happening at the critical point.

Display Toggles

DemoDisplay toggles and accent color
Step 0 of 5
The Display section in the left panel hides individual layers when one is in the way:

• f(x) — toggles the function curve.

• f'(x) — toggles the dashed derivative curve. Useful for verifying that f′f' crosses zero at every marked critical point.

• f''(x) — toggles the dotted second-derivative curve. Off by default to avoid clutter; turn on when working through the second-derivative test in detail.

• critical points — toggles the markers and drop lines for every critical point in the interval.

Any combination is valid. The legend below the graph updates to show only the visible layers.

The Accent color picker at the bottom recolors the live highlight throughout the tool.

The Plot, Legend and Info Panel

DemoPlot size and info panel
Step 0 of 4
The center panel is headed by the family name, with its formula in a chip beside it, for example f(x)=x3−3xf(x) = x^3 - 3x. The S, M, L and XL buttons above the plot set its size, and the readout next to them shows it in pixels: 500 × 400, 700 × 550, 900 × 850 or 1100 × 850. The page opens at 880 × 460. The horizontal window stays at [−5,5][-5, 5] whatever the size; the faint blue band inside it is the search window [a,b][a, b] from The a and b Sliders.

The legend under the plot names only the layers that are switched on: the solid f(x)f(x), the dashed f′(x)f'(x), the dotted f′′(x)f''(x) and the numbered critical points. Which layers show is set in Display Toggles.

The Applied strip at the bottom of the center panel repeats the current aa and bb.

The info panel on the right has two tabs:

• Explanation — the family's derivatives, a Right now line listing every critical point found in [a,b][a, b] with its verdict, a note on reading the picture, and a short note on where the family leads, with a link to its section on this page.

• Concepts — the first-derivative test, the second-derivative test, inflection points and why optimization matters. The full treatment is in The Second-Derivative Test.

What Is Optimization

Optimization in single-variable calculus means finding the maximum or minimum value a function takes — either over its entire domain (a global extremum) or over a restricted interval (a local extremum).

The basic idea: at a smooth extremum, the tangent line is horizontal, so the derivative is zero. Solving f′(c)=0f'(c) = 0 finds the candidates; the second-derivative test (or the first-derivative test as backup) classifies each one.

For an interval [a,b][a, b], the absolute maximum and minimum live either at a critical point inside the interval or at one of the endpoints. The standard recipe: find every critical point in (a,b)(a, b), evaluate ff at each one and at the two endpoints, and pick the largest and smallest values.

For deeper coverage of optimization problems and applications, see the optimization page.

The First-Derivative Test

Once you have a critical point cc, the first-derivative test classifies it by looking at the sign of f′f' on each side:

• f′f' changes from positive to negative at cc → local maximum. The function was increasing, then started decreasing.

• f′f' changes from negative to positive at cc → local minimum. The function was decreasing, then started increasing.

• f′f' does not change sign at cc → not an extremum. Typically an inflection point with a horizontal tangent, like f(x)=x3f(x) = x^3 at x=0x = 0.

The first-derivative test always works (as long as you can determine the sign of f′f' in small neighborhoods on each side), but it requires more bookkeeping than the second-derivative test. The tool uses it as a fallback when f′′(c)=0f''(c) = 0 or is too close to zero to give a reliable verdict.

The Second-Derivative Test

The second-derivative test is the fast path: at a critical point cc, look at f′′(c)f''(c):

• f′′(c)>0f''(c) > 0 → concave up → local minimum.

• f′′(c)<0f''(c) < 0 → concave down → local maximum.

• f′′(c)=0f''(c) = 0 → inconclusive.

The intuition: concave-up means the curve cups like a bowl, so a horizontal tangent at the bottom of the bowl is a local minimum. Concave-down means it cups like a dome, so a horizontal tangent at the top is a local max.

When f′′(c)=0f''(c) = 0 the test fails because the curve's concavity isn't pinned down at cc — it could be a max, a min, or an inflection. Higher derivatives can sometimes resolve it (the third or fourth derivative test), but the cleaner fallback is the first-derivative test described above.