{
    "name": "Cubic Equation Calculator",
    "url": "https://calculators.geekmidst.com/calculators/cubic-equation-roots-calculator",
    "markdown": "https://calculators.geekmidst.com/calculators/cubic-equation-roots-calculator.md",
    "category": "Algebra, geometry & advanced math",
    "description": "Solve any cubic equation with the trigonometric method or Cardano’s formula, with the discriminant, depressed cubic and real or complex roots.",
    "summary": "Enter a, b, c and d. The discriminant decides the method: three real roots by the trigonometric formula, one real root by Cardano’s formula, or exact repeated roots when it is zero.",
    "also_called": [
        "Cubic formula calculator",
        "Cubic solver"
    ],
    "applies_to": "Worldwide",
    "last_updated": "2026-10-29",
    "computation": "Results are computed in the visitor’s browser on the HTML page. This API describes the calculator; it does not compute results.",
    "inputs": [
        {
            "name": "a",
            "label": "a (x³ coefficient)",
            "type": "number",
            "default": "1"
        },
        {
            "name": "b",
            "label": "b (x² coefficient)",
            "type": "number",
            "default": "-6"
        },
        {
            "name": "c",
            "label": "c (x coefficient)",
            "type": "number",
            "default": "11"
        },
        {
            "name": "d",
            "label": "d (constant)",
            "type": "number",
            "default": "-6"
        }
    ],
    "outputs": [
        {
            "key": "roots",
            "label": "Roots",
            "format": "text"
        },
        {
            "key": "x1",
            "label": "x₁",
            "format": "text"
        },
        {
            "key": "x2",
            "label": "x₂",
            "format": "text"
        },
        {
            "key": "x3",
            "label": "x₃",
            "format": "text"
        },
        {
            "key": "discriminant",
            "label": "Discriminant Δ",
            "format": "number"
        },
        {
            "key": "nature",
            "label": "Nature of the roots",
            "format": "text"
        },
        {
            "key": "depressed",
            "label": "Depressed cubic",
            "format": "text"
        },
        {
            "key": "method",
            "label": "Method used",
            "format": "text"
        }
    ],
    "formula": {
        "text": "Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d²;  x = t − b/3a gives t³ + pt + q = 0;  Δ > 0: t = 2√(−p/3)·cos(⅓·arccos((3q/2p)√(−3/p)) − 2πk/3);  Δ < 0: t = ∛(−q/2 + √D) + ∛(−q/2 − √D), D = q²/4 + p³/27",
        "variables": {
            "a, b, c, d": "the coefficients (a ≠ 0)",
            "Δ": "the discriminant",
            "p, q": "coefficients of the depressed cubic",
            "k": "0, 1, 2"
        }
    },
    "worked_example": {
        "inputs": {
            "a": "1",
            "b": "-6",
            "c": "11",
            "d": "-6"
        },
        "steps": [
            "Δ = 18(1)(−6)(11)(−6) − 4(−216)(−6) + (36)(121) − 4(1331) − 27(36) = 7128 − 5184 + 4356 − 5324 − 972 = 4 > 0, so there are three distinct real roots.",
            "Substituting x = t + 2 gives the depressed cubic t³ − t = 0, so p = −1 and q = 0.",
            "Trigonometric formula: t = 2√(1/3)·cos(30° − 120°k) gives t = 1, −1 and 0, so x = 3, 1 and 2."
        ],
        "result": "x³ − 6x² + 11x − 6 = 0 has the roots x = 1, 2 and 3."
    },
    "interpretation": "Δ > 0 means three distinct real roots, Δ < 0 one real root and a complex-conjugate pair, Δ = 0 a repeated root. Every cubic with real coefficients has at least one real root.",
    "assumptions": [
        "Coefficients are real; a must not be 0."
    ],
    "limitations": [
        "Roots are shown to 10 significant figures; exact radical forms are not written out."
    ],
    "rules": null,
    "faqs": [
        {
            "question": "Why use cosines when all three roots are real?",
            "answer": "In that case Cardano’s formula needs cube roots of complex numbers even though the answers are real (the “casus irreducibilis”). The trigonometric form gives the same roots using only real arithmetic."
        },
        {
            "question": "How is accuracy protected?",
            "answer": "The discriminant is computed exactly from your coefficients, so the case is never misjudged by rounding. Cardano’s formula takes the larger cube root first to avoid cancellation, and every root is refined with Newton’s method."
        }
    ],
    "sources": [],
    "related": [
        {
            "name": "Quadratic Formula Calculator",
            "url": "https://calculators.geekmidst.com/calculators/quadratic-formula-calculator"
        },
        {
            "name": "Quartic Equation Calculator",
            "url": "https://calculators.geekmidst.com/calculators/quartic-equation-roots-calculator"
        },
        {
            "name": "Polynomial Roots Calculator",
            "url": "https://calculators.geekmidst.com/calculators/polynomial-roots-calculator"
        }
    ],
    "disclaimer": null,
    "publisher": "GM¹X CalcVerse"
}