Concavity — How a curve bends. A curve is concave up if it cups upward like a smile; concave down if it caps downward like a frown.
Second derivative $f''(x)$ — The derivative of f′. Its sign measures concavity: positive means concave up, negative means concave down.
Inflection point — A point where concavity changes — the sign of f′′ flips as x passes through the point.
Tangent line — The line through P=(c,f(c)) with slope f′(c). For concave-up curves the tangent lies below the curve nearby; for concave-down, above.
Concavity gap — The region between the curve and the tangent line at P. Its width and direction visualize how strongly the curve bends.
This widget uses the cubic f(x)=31x3−x, whose second derivative is f′′(x)=2x. The single inflection point sits exactly at x=0.
Getting Started
The visualizer shows the cubic f(x)=31x3−x with a draggable point c on the x-axis. P=(c,f(c)) lifts vertically from c to the curve, and the tangent line at P is drawn alongside it.
Drag c left or right to move the point along the x-axis. The dashed drop line and the highlighted P update in real time, along with the live readouts below the canvas: c, f(c), f′(c), and the key value f′′(c)=2c.
For a guided walkthrough, click one of the three scenario buttons at the bottom: Concave up, Concave down, or Inflection. Each runs a seven-step animation explaining what the chosen value of c reveals about the curve.
The Reset button clears the active scenario and returns the visualizer to a neutral state with c restored to its default position.
Drag Mode vs Scenario Mode
Two interaction styles share the same canvas.
Free drag — Grab the c marker on the x-axis and slide it anywhere in the visible range. The tangent line, point P, and the f′′(c) value all track your cursor. This is the fastest way to feel how concavity shifts: drag from negative x into positive x and watch the second derivative cross zero exactly at the inflection point.
Scenario animation — Click any of the three scenario buttons to lock c to a specific value and play the seven-step explanation. The full color theme of the visualizer changes to match: blue for concave up, red for concave down, amber for inflection.
Starting a scenario interrupts dragging. Once an animation completes, you can still drag c again — doing so clears the scenario tint and returns the visualizer to neutral.
Running the Three Scenarios
Concave up sets c=1.3, where f′′(1.3)=2.6>0. The curve cups upward around P, and the tangent line at P sits beneath the curve in the surrounding window. The blue gap shading shows the curve curling away above the tangent.
Concave down sets c=−1.3, where f′′(−1.3)=−2.6<0. The curve caps downward around P, and the tangent line lies above the curve. The red gap shading shows the curve falling below the tangent on both sides.
Inflection sets c=0, where f′′(0)=0 and the sign of f′′ flips from negative to positive as x crosses zero. The tangent line at P crosses the curve rather than staying on one side. The gap shading splits at c — red on the concave-down left side, blue on the concave-up right side.
Each scenario takes a few seconds to play out across the seven animation phases.
Following the 7-Step Animation
Each scenario plays the same seven phases, labeled in a banner at the top of the canvas:
Step 1 — Identify the region of interest. A shaded band highlights the interval around c that the analysis covers.
Step 2 — Mark the point c on the x-axis. The marker animates into position from wherever it was previously.
Step 3 — Lift to P=(c,f(c)). A dashed drop line connects c on the axis to P on the curve.
Step 4 — Draw the tangent at P. The tangent line expands outward from P with slope f′(c).
Step 5 — Evaluate f′′(c)=2c. A floating badge appears near P showing the computed value.
Step 6 — Concavity gap: curve vs tangent. Color-coded shading fills the region between the curve and the tangent.
Step 7 — Read off concave up, concave down, or inflection. The verdict pill summarizes the result.
When the animation finishes, the right-side panel switches automatically to the Meaning tab.
Reading the Concavity Gap
The colored shading between the curve and the tangent line is the concavity gap. Its meaning depends on the scenario.
For concave up, the gap fills the wedge with the curve forming the upper boundary and the tangent forming the lower boundary. The blue shading visualizes the inequality "curve above tangent" that defines concave up.
For concave down, the same geometry flips: the curve forms the lower boundary, the tangent the upper, and red shading fills the wedge. The curve sits below the tangent on both sides of c.
For an inflection point, the gap splits at c into two colors. To the left of c, the gap is red (concave down: curve below tangent). To the right, the gap is blue (curve above tangent). The visible color flip at c is the geometric signature of the concavity change.
The size of the gap also indicates the strength of bending — wider gap, sharper curvature.
Using the Three Info Panel Tabs
The right-side panel offers three views of the same scene.
Computation walks through the algebra step by step. It shows the current values of c, f(c), and f′(c), then computes f′′(c)=2c with the numerical substitution, and finally reads off the verdict from the sign of f′′(c). The active step is highlighted with the scenario color.
Meaning explains what the verdict means geometrically. A colored verdict card summarizes the result with a badge, headline, and explanation. A "why" note clarifies the connection between f′′ and concavity in plain language. The Meaning tab opens automatically when a scenario animation finishes.
Theory provides the formal background: the definition of concavity in terms of tangent lines, the second derivative test for concavity, the necessary-but-not-sufficient condition for inflection points, the second derivative test for extrema, and a worked breakdown of the specific function f(x)=31x3−x.
Switch tabs at any time without interrupting the canvas.
What is Concavity?
A function f is concave up on an interval when its graph lies above every one of its tangent lines drawn from points in that interval. Visually, the curve cups upward like a smile, and the slope f′ is increasing as x increases.
A function is concave down when the graph lies below all its tangent lines on the interval. The curve caps downward like a frown, and the slope f′ is decreasing as x increases.
The connection to the second derivative is direct: if f is twice differentiable, then f′′(x)>0 on an interval is equivalent to f being concave up there, and f′′(x)<0 is equivalent to concave down. The sign of f′′ determines concavity.
For a deeper treatment with proofs and worked examples, see the concavity theory page.
The Second Derivative Test
The second derivative is the rate of change of the slope. Its sign tells us how the slope is itself changing, which is concavity.
For concavity: On any interval where f′′ is strictly positive, f is concave up; where f′′ is strictly negative, f is concave down. The boundary case f′′(x)=0 is where concavity can potentially change.
For local extrema: At a critical point c where f′(c)=0, the sign of f′′(c) classifies the critical point. Positive f′′(c) gives a local minimum (the curve cups up around c). Negative f′′(c) gives a local maximum (the curve caps down). When f′′(c)=0, the second derivative test is inconclusive and another method such as the first derivative test is needed.
On this widget's example f(x)=31x3−x, the critical points are at x=±1: f′′(−1)=−2 marks a local maximum, f′′(1)=2 marks a local minimum.
See the first derivative test page for an alternative classification method.
Inflection Points: Necessary vs Sufficient
An inflection point is a point on the graph where concavity changes. The standard procedure to find them has two steps, and the second step is what most students skip.
Necessary condition — At an inflection point c, either f′′(c)=0 or f′′(c) does not exist. So the candidates are exactly the zeros of f′′ and the points where f′′ is undefined.
Sufficient condition — The sign of f′′ must actually change across c. If f′′ is negative on the left and positive on the right (or vice versa), c is an inflection point. If the sign stays the same on both sides, it is not.
The classic counterexample is f(x)=x4. Here f′′(x)=12x2, so f′′(0)=0 — the necessary condition holds. But f′′(x)≥0 for every x, so the sign never changes. There is no inflection point at x=0; the curve is concave up everywhere.
This is exactly why the visualizer's Inflection scenario emphasizes the sign flip in its gap shading.
Related Concepts
Concavity — General theory of how curves bend, with worked examples across multiple function families.
Second derivative — Definition, computation rules, and geometric interpretation as the rate of change of slope.
Critical points — Points where f′(x)=0 or is undefined; the starting set for finding maxima, minima, and inflection candidates.
First derivative test — Sign analysis of f′ for classifying critical points as maxima, minima, or neither.
Local extrema — Local maxima and minima, the second derivative test, and the relationship to concavity.
Curve sketching — Combining intervals of increase/decrease, concavity, asymptotes, and intercepts to draw an accurate graph of any function.
Optimization problems — Real-world applications where finding extrema and inflection points reveals optimal solutions.