The idea: four numbers, four jobs

A cubic function has the form

y = f(x) = a·x³ + b·x² + c·x + d      (a ≠ 0)

Each coefficient has one clear job that you can read straight off the graph. Change one number and only its feature moves; the others stay where they were.

Four small plots. a: x³ in grey and 2x³ in blue, steeper. b: x³ − 3x in grey and x³ + 3x² − 3x in blue, the inflection point moves from x = 0 to x = −1. c: x³ − 3x in grey and x³ + 3x in blue, the tangent at the y-intercept turns from slope −3 to 3. d: x³ − 3x in grey and x³ − 3x + 3 in blue, moved up 3
a sets the ends and the steepness, b moves the bend, c tilts the curve where it crosses the y-axis, d slides it up and down.
coefficientwhat it controlsformula
awhich way the ends go, how steepa > 0: y → +∞ on the right
bwhere the bend (inflection point) isx = −b/(3a)
cthe slope where it crosses the y-axisf′(0) = c
dthe height where it crosses the y-axisf(0) = d

a: the ends and the steepness

For large |x| the x³ term is much bigger than the others, so the graph looks like a·x³ far from the middle. If a > 0 the right end goes up and the left end goes down; if a < 0 it is the other way round. A bigger |a| makes the curve steeper; a smaller one flattens it. a does not change the point (0, d) or the slope c there. (Demo 1: a from 2 to −2 in steps of 0.1: the curve flattens, becomes the line y = 0 at a = 0, then flips.)

If a = 0 the x³ term is gone and the graph is the parabola bx² + cx + d (or a line): both ends go the same way, and there is no inflection point, just a vertex. (Demo 7: a = 0, not a cubic any more) See Quadratic Equations.

d: up and down, and the number of roots

f(0) = d, so the graph crosses the y-axis at (0, d). Adding to d adds the same amount to every y: the whole curve slides up or down without changing shape. Sliding it changes how often it crosses the x-axis. y = x³ − 3x has a max at (−1, 2) and a min at (1, −2). With d = 2 the min sits on the axis (a double root at x = 1); with d = 3 the curve crosses only once, near x ≈ −2.10. (Demo 2: d, slide up and lose roots) Sliding a graph is the k of Function Transformations.

c: the slope at the y-intercept

The derivative is f′(x) = 3ax² + 2bx + c, so f′(0) = c: c is the slope of the curve where it crosses the y-axis, and the tangent there is y = cx + d. On y = x³ + cx: c = −3 makes the curve go down through the origin between two humps; c = 0 makes it flat there; c = 3 makes it climb steeply, with no humps at all. (Demo 3: c, the slope at the y-axis) More on reading slopes in f, f′, f″: Reading Derivative Graphs.

b: where the bend is

The second derivative f″(x) = 6ax + 2b is zero at x = −b/(3a). That is the inflection point, where the curve changes from bending one way to bending the other. On x³ + bx², b = 3 moves it to x = −1 and b = −3 to x = 1. b leaves the y-intercept d and the slope c there unchanged. (Demo 4: b, move the inflection point)

Every cubic is point-symmetric about its inflection point: turn the graph 180° around it and it lands on itself, f(x₀ + t) + f(x₀ − t) = 2·f(x₀). For x³ − 3x² + 4 the inflection point is (1, 2); the max (0, 4) and the min (2, 0) swap places. (Demo 6: point symmetry about the inflection) The reason: put x = t − b/(3a) and the x² term disappears, leaving the depressed cubic a·t³ + p·t + q, an odd function shifted up by q.

Humps or no humps: b² − 3ac

Turning points are where f′(x) = 3ax² + 2bx + c = 0. That quadratic has discriminant (2b)² − 4·3a·c = 4(b² − 3ac), so the sign of b² − 3ac decides:

Three plots side by side, each with f on top and f′ below. x³ − 3x: b² − 3ac = 9 > 0, f′ crosses zero twice, a max and a min. x³: b² − 3ac = 0, f′ touches zero once, a flat inflection. x³ + 3x: b² − 3ac = −9 < 0, f′ is always positive, no turning point
Two turning points when b² − 3ac > 0, a flat inflection when it is 0, none when it is negative.
b² − 3acf′ = 0the graphexample
> 0twicea local max and a local minx³ − 3x: max (−1, 2), min (1, −2)
= 0once (double)a flat inflection, no turnx³ at the origin
< 0neveralways rising (a > 0) or always fallingx³ + 3x

The turning points are at x = (−b ± √(b² − 3ac)) / (3a). Their middle, −b/(3a), is the inflection point.

Roots and the discriminant Δ

A cubic always has at least one real root, because its two ends go to opposite infinities. How many it has is decided by the discriminant

Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d²
Δreal rootsexample
> 03 differentx³ − 3x: Δ = 108, roots −√3, 0, √3
= 0a repeated rootx³ − 3x + 2: Δ = 0, roots −2, 1 (double)
< 01 (and 2 complex)x³ − 3x + 3: Δ = −135, root ≈ −2.10

Graphically: 3 roots when the max is above the axis and the min below; a double root when one of them sits on it, where the curve just touches the axis.

Coefficients from roots (Vieta)

If the roots are r₁, r₂, r₃, then f(x) = a(x − r₁)(x − r₂)(x − r₃). Multiplying out and matching terms gives

r₁ + r₂ + r₃       = −b/a
r₁r₂ + r₁r₃ + r₂r₃ =  c/a
r₁·r₂·r₃           = −d/a

(x + 1)(x − 1)(x − 2) = x³ − 2x² − x + 2: the roots −1, 1, 2 add up to 2 = −b/a, the pair products to −1 = c/a, and multiply to −2 = −d/a. (Demo 5: build (x + 1)(x − 1)(x − 2), Vieta) It also explains b: the inflection point −b/(3a) is the average of the three roots. Dividing out a known root is Polynomial Division.

What the page leaves out

Cardano's formula for the roots in full, complex roots on the complex plane, cubics whose window is bigger than x ∈ [−5, 5] and y ∈ [−10, 10], and polynomials of degree 4 and higher. Finding a root numerically is shown in Newton's Method. The same four-coefficient idea for waves is on Sine Waves: What a, b, c, d Do and Cosine Waves: What a, b, c, d Do, and for a quadratic over a linear term on Rational Functions: What a, b, c, e, f Do.