Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Optimization Visualizer - Critical Points

How to use
  1. Pick a function in the Function menu at the top; ff is blue and f′f' dashed navy. Learn more about the six functions
  2. Move the left end aa and right end bb to set the shaded search interval. Learn more about the sliders
  3. Critical points inside it are marked: navy maximum, amber minimum, gray neither; the explanation counts them. Learn more about the count
  4. The tabs First-derivative test and Second-derivative test explain the two ways to classify a point. Learn more about classification
  5. The switches show or hide f′f', f′′f'' and the marks; the Concepts tab explains optimization in general. Learn more about the Concepts tab


Optimization
f(x)f(x)
f′(x)f'(x)
a=−3a = -3b=3b = 3
First-derivative test · x³ − 3x
f′(c)=0\displaystyle f'(c) = 0
General

At a local maximum or minimum of a smooth function the tangent is level, so f′(c)=0f'(c) = 0. Then the sign of f′f' on either side decides:

  • f′f' goes from ++ to −-: local maximum.
  • f′f' goes from −- to ++: local minimum.
  • f′f' keeps its sign: neither — a level point, like x3x^3 at 00.
For this function

Function · f(x)=x3−3xf(x) = x^3 - 3x

f′(x)=3x2−3f'(x) = 3x^2 - 3, f′′(x)=6xf''(x) = 6x

A maximum at −1-1 (f′′=−6f'' = -6) and a minimum at 11 (f′′=6f'' = 6).

In [−3,3][-3, 3] · local maxima: 1 (navy) · local minima: 1 (amber) · level points that are neither: 0 (gray).

a=−3a = -3
b=3b = 3
Speed




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 tool has three parts. Across the top runs a bar with the Function menu and the buttons for zooming, the starting view, saving a picture and full screen. On the left is the graph. On the right is the explanation, with the controls under it.

The graph shows ff in blue and its derivative f′f' dashed navy, over a lightly shaded search interval [a,b][a, b]. Every critical point inside the interval is marked: navy for a local maximum, amber for a local minimum, gray for a level point that is neither, each max and min with a dashed level line through it.

The tool opens with f(x)=x3−3xf(x) = x^3 - 3x on [−3,3][-3, 3]: one maximum at −1-1 and one minimum at 11.

The Function Families

DemoSix functions
Step 0 of 3
The Function menu lists six functions, each with its exact first and second derivative:

• Quadratic x2x^2 — one minimum at 00.
• x³ − 3x — a maximum at −1-1 and a minimum at 11.
• x³ — a level tangent at 00 that is neither a maximum nor a minimum.
• x⁴ − 4x² — a W: two minima at ±2\pm\sqrt{2} and a maximum at 00.
• sin(x) — maxima and minima repeating every 2π2\pi.
• e^(−x²) — one maximum at 00, with inflection points at ±12\pm\frac{1}{\sqrt{2}}.

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 2
The sliders left end aa and right end bb set the search interval, each from −5-5 to 55. Only critical points inside [a,b][a, b] are found and counted, so narrowing the interval drops them one by one — try [0,3][0, 3] on x3−3xx^3 - 3x and only the minimum remains.

When the interval holds no critical point, the explanation says that ff only rises or only falls there, so its largest and smallest values sit at the ends. Press ▶ beside a slider to let it run by itself.

Reading the Count

Under For this function, the explanation counts what the interval holds: how many local maxima (navy), local minima (amber) and level points that are neither (gray). The dots on the graph are the same points, so you can match each number to its place.

The points are found from the exact f′f': the interval is cut into 400 pieces, and a piece where f′f' changes sign — or touches zero — holds a critical point.

Classification - Max, Min, Neither

Every smooth critical point has f′(c)=0f'(c) = 0. The two tabs classify it two ways:

• First-derivative test — the sign of f′f' on either side: ++ to −- is a maximum, −- to ++ a minimum, no change of sign neither. This always gives an answer.
• Second-derivative test — the sign of f′′(c)f''(c): positive (bending up) is a minimum, negative (bending down) a maximum, zero no verdict. Switch on f′′f'' under the controls to check its sign under each dot.

x3x^3 at 00 shows the difference: f′′(0)=0f''(0) = 0 leaves the second test silent, while the first shows f′f' never changes sign, so the point is neither.

The Switches and Zoom

DemoThe second-derivative test
Step 0 of 2
Three switches under the sliders change what is drawn: f′ and f″ show or hide the two derivative curves (f′′f'' starts hidden), and Interval and critical points hides or shows the shading, the dots and the level lines.

The buttons at the top right zoom in and out, return to the starting view, save the graph as a picture and open the tool full screen.

The Concepts Tab

DemoThe Concepts tab
Step 0 of 1
Above the explanation, the Concepts tab holds a page that does not change with the controls:

• why maxima and minima of a smooth function have a level tangent;
• how to find the largest and smallest values on a closed interval — the critical points and the two ends;
• inflection points, and why optimization matters.

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.