dash–calculator

03 Algebra and Polynomials

Cubic Function Calculator: Roots & Graph

Readout 03-0235 · Updated · Standard formula, shown below

The calculator on this page is switched off while it is checked. The formula is below, and the worked example shows how to do the sum by hand.

A cubic function calculator solves equations of the form ax³ + bx² + cx + d = 0, giving you the real and complex roots plus the critical points of the curve. You enter the four coefficients a, b, c, and d, and the calculator returns the roots, the x-values where the slope is zero, and the inflection point. This page explains the math behind those results and shows you exactly how to interpret them.

Formula

The standard cubic equation is written as:

ax³ + bx² + cx + d = 0

where a, b, c, and d are real numbers and a ≠ 0. The roots are found using the cubic formula (Cardano’s method), which is the analogue of the quadratic formula but considerably more complex. The key intermediate value is the discriminant:

Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d²

The sign of Δ tells you what kind of roots you have:

  • Δ > 0: three distinct real roots
  • Δ = 0: multiple roots (a double root and a single root, or one triple root)
  • Δ < 0: one real root and two complex conjugate roots

The critical points (where the slope is zero) come from the derivative f′(x) = 3ax² + 2bx + c = 0, solved with the quadratic formula:

x = (−2b ± √(4b² − 12ac)) / (6a) which simplifies to (−b ± √(b² − 3ac)) / (3a)

The inflection point (where the curve changes concavity) is found from the second derivative f″(x) = 6ax + 2b = 0, giving:

x = −b / (3a)

Worked Example

Take the default equation: x³ − 6x² + 11x − 6 = 0, so a=1, b=−6, c=11, d=−6.

First, check the discriminant: Δ = 18(1)(−6)(11)(−6) − 4(−6)³(11) + (−6)²(11)² − 4(1)(11)³ − 27(1)²(−6)² = 7128 + 9504 + 4356 − 5324 − 972 = 5692. Since Δ > 0, there are three real roots.

Using the cubic formula (or factoring by inspection), the roots are x = 1, x = 2, and x = 3. Check: (1)³ − 6(1)² + 11(1) − 6 = 1 − 6 + 11 − 6 = 0. Similarly for 2 and 3.

Critical points: x = (−(−6) ± √((−6)² − 3·1·11)) / (3·1) = (6 ± √(36 − 33)) / 3 = (6 ± √3) / 3. So x ≈ (6 + 1.732)/3 = 2.577 and x ≈ (6 − 1.732)/3 = 1.423.

Inflection point: x = −(−6) / (3·1) = 2. The curve is concave down before x=2 and concave up after.

How to Read the Results

The three roots are the x-values where the curve crosses the x-axis. If you get a root like “1 + 0i”, the imaginary part is zero, so it’s a real root. When the discriminant is negative, you’ll see one real root and two complex roots of the form p ± qi; these indicate the curve crosses the axis only once.

The critical x-values are where the curve flattens out (local maximum or minimum). Plug a critical x back into the original equation to get the y-value of that peak or valley. The inflection point marks where the curve switches from curving one way to the other.

Common Mistakes and Misconceptions

  • Forgetting a ≠ 0: If a = 0, the equation is quadratic, not cubic. The calculator will reject a=0 because the formulas divide by a.
  • Sign errors: A common error is entering b=−6 as 6. The signs matter enormously; a single sign flip changes all three roots.
  • Confusing roots with critical points: Roots are where f(x)=0; critical points are where f′(x)=0. They are different x-values.
  • Assuming all roots are real: Many cubic equations have only one real root. The complex roots are still valid solutions.
  • Rounding too early: If you round intermediate values to 2 decimals, your final roots can be off in the second decimal. Keep full precision until the end.

Why the Cubic Formula Is So Complicated

Unlike the quadratic formula, which fits on one line, the cubic formula involves cube roots of expressions that themselves contain square roots. This nested structure is unavoidable—it was proven in the 19th century that there is no simpler formula using only basic arithmetic and roots. The complexity is why most people use a calculator rather than solving cubics by hand.

Historically, the solution was published by Gerolamo Cardano in 1545 in his book Ars Magna, though the method was originally discovered by Scipione del Ferro and Niccolò Tartaglia. The formula works for all cubics, but when the discriminant is positive, the intermediate steps involve cube roots of complex numbers even though the final roots are real—a phenomenon that puzzled early mathematicians.

Real-World Applications

Cubic equations appear in many fields:

  • Physics: Equations of state for gases (van der Waals equation is cubic in volume).
  • Engineering: Beam deflection under certain loading conditions, and the design of cam profiles.
  • Economics: Cubic cost and revenue functions used in marginal analysis.
  • Biology: Population growth models with carrying capacity (logistic growth is not cubic, but cubic splines are used to fit data).
  • Computer graphics: Cubic Bézier curves define fonts and vector graphics; finding their intersection points requires solving cubics.

Limits of the Calculator

This calculator finds the exact algebraic roots, but it has practical limits. For very large or very small coefficients (beyond ±1,000,000), numerical precision degrades. Also, the displayed roots are rounded to 4 decimal places; if you need more precision for engineering work, use a tool that outputs more digits. The calculator assumes real coefficients; if you have complex coefficients, you need a more advanced tool.

For the special case where a cubic has a rational root, factoring by the rational root theorem is often faster than the cubic formula. Try integer divisors of d divided by divisors of a; if one works, you can reduce the cubic to a quadratic and solve that.

Frequently Asked Questions

What does it mean when the calculator shows “Cannot compute”?

This happens when the discriminant expression inside a square root becomes negative in an intermediate step that requires a real square root, or when a is zero. For the cubic formula, a negative discriminant is normal and handled through complex numbers, but the simplified expression used here may fail for some edge cases. Try entering the coefficients in a different form, or check that a is not zero.

How do I find the y-values of the maximum and minimum?

Take each critical x-value from the output, substitute it back into the original equation ax³ + bx² + cx + d, and compute. That gives you the y-coordinate of the local maximum or minimum. The larger y-value corresponds to the local max if a > 0 (the curve opens upward overall).

Can a cubic equation have only two real roots?

Yes, but only if one root is repeated (a double root). This happens when the discriminant equals zero. Graphically, the curve touches the x-axis at the double root (it’s a tangent point) and crosses at the third root.

What is the difference between a root and a zero?

Nothing. A root of a polynomial f(x) is a value x where f(x) = 0, and that same value is called a zero of the function. The terms are interchangeable; “root” is more common when talking about equations, “zero” when talking about functions.

Why does my graphing calculator show three intersections but your calculator gives complex roots?

If your graphing calculator shows three real intersections, then the discriminant is positive and the roots are all real. Double-check that you entered the coefficients with the correct signs. A single sign error can flip the discriminant from positive to negative, changing real roots into complex ones.

How do I solve a cubic if a is not 1?

You don’t need to divide through first—just enter the values of a, b, c, and d directly into the calculator. The formula handles any nonzero a. If you prefer to solve by hand, dividing the entire equation by a first gives you a monic cubic (leading coefficient 1), which simplifies the arithmetic but is not required.

Related

Formula used
in a | Coefficient a | - | 1 | -1000000 | 1000000
in b | Coefficient b | - | -6 | -1000000 | 1000000
in c | Coefficient c | - | 11 | -1000000 | 1000000
in d | Coefficient d | - | -6 | -1000000 | 1000000
out r1 | Root 1 | - | (-b/(3a) - (cbrt(2)*(-b^2 + 3*a*c))/(3*a*cbrt(-2*b^3 + 9*a*b*c - 27*a^2*d + sqrt(4*(-b^2 + 3*a*c)^3 + (-2*b^3 + 9*a*b*c - 27*a^2*d)^2))) + cbrt(-2*b^3 + 9*a*b*c - 27*a^2*d + sqrt(4*(-b^2 + 3*a*c)^3 + (-2*b^3 + 9*a*b*c - 27*a^2*d)^2))/(3*a*cbrt(2))) | 4
out r2 | Root 2 | - | (-b/(3a) + ((1 + sqrt(-3))/2)*cbrt(-2*b^3 + 9*a*b*c - 27*a^2*d + sqrt(4*(-b^2 + 3*a*c)^3 + (-2*b^3 + 9*a*b*c - 27*a^2*d)^2))/(3*a*cbrt(2)) + ((1 - sqrt(-3))/2)*(-b^2 + 3*a*c)/(3*a*cbrt(-2*b^3 + 9*a*b*c - 27*a^2*d + sqrt(4*(-b^2 + 3*a*c)^3 + (-2*b^3 + 9*a*b*c - 27*a^2*d)^2)))) | 4
out r3 | Root 3 | - | (-b/(3a) + ((1 - sqrt(-3))/2)*cbrt(-2*b^3 + 9*a*b*c - 27*a^2*d + sqrt(4*(-b^2 + 3*a*c)^3 + (-2*b^3 + 9*a*b*c - 27*a^2*d)^2))/(3*a*cbrt(2)) + ((1 + sqrt(-3))/2)*(-b^2 + 3*a*c)/(3*a*cbrt(-2*b^3 + 9*a*b*c - 27*a^2*d + sqrt(4*(-b^2 + 3*a*c)^3 + (-2*b^3 + 9*a*b*c - 27*a^2*d)^2)))) | 4
out crit | Critical x-values | - | (-b ± sqrt(b^2 - 3*a*c)) / (3*a) | 4
out infl | Inflection x | - | -b/(3*a) | 4

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More on this panel

The whole Algebra and Polynomials panel →