{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"cubic-equation"},"result":{"entity_type":"calculator","id":"cubic-equation","calculator_id":"cubic-equation","canonical_url":"https://tttkmbb.com/math/cubic-equation","name":"Cubic Equation Solver","title":"Cubic Equation Solver – Real and Complex Roots of ax³ + bx² + cx + d = 0 (Cardano and Trigonometric Method)","category":"math","category_name":"Math","tool_name":"solve_cubic_equation","featured_mcp_tool":false,"description":"Solves ax³ + bx² + cx + d = 0 by depressing the cubic and applying Cardano's formula (one real root) or the trigonometric method (three real roots), and reports the discriminant, the nature of the roots and every root, complex roots as strings.","use_when":"You need the solutions of a third-degree polynomial equation, including repeated roots and complex conjugate pairs.","do_not_use_when":"a is 0 (the equation is quadratic: use quadratic-equation) or the polynomial has degree 4 or more (use a numerical root finder).","inputs":[{"name":"a","label":"a (x³ coefficient)","type":"number","required":true,"description":"Coefficient of x³. Must not be 0.","example":1},{"name":"b","label":"b (x² coefficient)","type":"number","required":true,"description":"Coefficient of x².","example":-6},{"name":"c","label":"c (x coefficient)","type":"number","required":true,"description":"Coefficient of x.","example":11},{"name":"d","label":"d (constant)","type":"number","required":true,"description":"Constant term.","example":-6}],"outputs":[{"name":"discriminant","label":"Discriminant","type":"number","decimals":6,"description":"Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d²; positive → three distinct real roots, zero → a repeated root, negative → one real root and a complex pair."},{"name":"nature","label":"Nature of roots","type":"string","decimals":4,"description":"Classification of the roots from the sign of the discriminant."},{"name":"roots","label":"All roots","type":"string","decimals":4,"description":"All three roots as text: real roots in ascending order, complex roots written like '0+1i, 0-1i'."},{"name":"root1","label":"Root 1","type":"number","decimals":6,"description":"Smallest real root."},{"name":"root2","label":"Root 2","type":"number","decimals":6,"description":"Middle real root (only when all three roots are real)."},{"name":"root3","label":"Root 3","type":"number","decimals":6,"description":"Largest real root (only when all three roots are real)."},{"name":"real_roots","label":"Real roots","type":"number_list","decimals":6,"description":"Real roots in ascending order; a repeated root is listed once per multiplicity."},{"name":"depressed_p","label":"p of the depressed cubic","type":"number","decimals":6,"description":"p = c/a − b²/(3a²) in t³ + pt + q = 0, obtained with x = t − b/(3a)."},{"name":"depressed_q","label":"q of the depressed cubic","type":"number","decimals":6,"description":"q = 2b³/(27a³) − bc/(3a²) + d/a."},{"name":"sum_of_roots","label":"Sum of roots","type":"number","decimals":6,"description":"−b / a (Vieta's formula)."},{"name":"product_of_roots","label":"Product of roots","type":"number","decimals":6,"description":"−d / a (Vieta's formula)."}],"input_schema":{"type":"object","properties":{"a":{"description":"Coefficient of x³. Must not be 0.","type":"number","examples":[1]},"b":{"description":"Coefficient of x².","type":"number","examples":[-6]},"c":{"description":"Coefficient of x.","type":"number","examples":[11]},"d":{"description":"Constant term.","type":"number","examples":[-6]}},"additionalProperties":false,"required":["a","b","c","d"]},"output_schema":{"type":"object","properties":{"discriminant":{"description":"Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d²; positive → three distinct real roots, zero → a repeated root, negative → one real root and a complex pair.","type":"number"},"nature":{"description":"Classification of the roots from the sign of the discriminant.","type":"string"},"roots":{"description":"All three roots as text: real roots in ascending order, complex roots written like '0+1i, 0-1i'.","type":"string"},"root1":{"description":"Smallest real root.","type":"number"},"root2":{"description":"Middle real root (only when all three roots are real).","type":"number"},"root3":{"description":"Largest real root (only when all three roots are real).","type":"number"},"real_roots":{"description":"Real roots in ascending order; a repeated root is listed once per multiplicity.","type":"array","items":{"type":"number"}},"depressed_p":{"description":"p = c/a − b²/(3a²) in t³ + pt + q = 0, obtained with x = t − b/(3a).","type":"number"},"depressed_q":{"description":"q = 2b³/(27a³) − bc/(3a²) + d/a.","type":"number"},"sum_of_roots":{"description":"−b / a (Vieta's formula).","type":"number"},"product_of_roots":{"description":"−d / a (Vieta's formula).","type":"number"}}},"formula":"Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d²; x = t − b/(3a) gives t³ + pt + q = 0. Δ > 0: t_k = 2√(−p/3)·cos(⅓·arccos((3q/(2p))·√(−3/p)) − 2πk/3), k = 0, 1, 2. Δ < 0: u = ∛(−q/2 + √(q²/4 + p³/27)), v = ∛(−q/2 − √(q²/4 + p³/27)), real root u + v, complex pair −(u + v)/2 ± i·(u − v)·√3/2. Δ = 0: double root −3q/(2p) and simple root 3q/p (triple root t = 0 when p = q = 0).","method":"Real roots from the closed forms are refined with up to three Newton steps on the original polynomial; a discriminant within 10^-10 of the size of its terms is treated as zero.","sources":[{"name":"Wikipedia – Cubic equation","url":"https://en.wikipedia.org/wiki/Cubic_equation","type":"reference","retrieved_at":"2026-09-24"},{"name":"Wolfram MathWorld – Cubic Formula","url":"https://mathworld.wolfram.com/CubicFormula.html","type":"reference","retrieved_at":"2026-09-24"},{"name":"Wikipedia – Discriminant","url":"https://en.wikipedia.org/wiki/Discriminant","type":"reference","retrieved_at":"2026-09-24"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"x³ − 6x² + 11x − 6 = 0","inputs":{"a":1,"b":-6,"c":11,"d":-6},"expected":{"discriminant":4,"nature":"Three distinct real roots","roots":"1, 2, 3","root1":1,"root2":2,"root3":3,"real_roots":[1,2,3],"depressed_p":-1,"depressed_q":0,"sum_of_roots":6,"product_of_roots":6},"url":"https://tttkmbb.com/api/v1/calculate/cubic-equation?a=1&b=-6&c=11&d=-6"},{"name":"x³ + x² + x + 1 = 0","inputs":{"a":1,"b":1,"c":1,"d":1},"expected":{"discriminant":-16,"nature":"One real root and two complex conjugate roots","roots":"-1, 0+1i, 0-1i","root1":-1,"real_roots":[-1],"sum_of_roots":-1,"product_of_roots":-1},"url":"https://tttkmbb.com/api/v1/calculate/cubic-equation?a=1&b=1&c=1&d=1"}],"faq":[{"q":"Why does a cubic always have at least one real root?","a":"A real cubic polynomial tends to −∞ on one side and +∞ on the other, so it must cross the x-axis; the other two roots are either real or a complex conjugate pair."},{"q":"How are repeated roots reported?","a":"A double root appears twice in real_roots (e.g. x³ − 3x + 2 gives [-2, 1, 1]) and a triple root three times; nature names the multiplicity."},{"q":"Why the trigonometric method for three real roots?","a":"When Δ > 0 Cardano's formula needs cube roots of complex numbers (the casus irreducibilis); the trigonometric identity for cos 3θ gives the three real roots directly."}],"tags":["cubic equation","cubic formula","cardano","solve cubic","third degree polynomial","roots of cubic"],"related":[{"calculator_id":"quadratic-equation","reason":"Second-degree equations and their discriminant."},{"calculator_id":"complex-numbers","reason":"Arithmetic on the complex roots returned as strings."},{"calculator_id":"nth-root","reason":"Cube roots used in Cardano's formula."}],"links":{"html":"https://tttkmbb.com/math/cubic-equation","markdown":"https://tttkmbb.com/math/cubic-equation.md","json":"https://tttkmbb.com/math/cubic-equation.json","api":"https://tttkmbb.com/api/v1/calculate/cubic-equation","schema":"https://tttkmbb.com/api/v1/calculators/cubic-equation","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-24"},"timestamp":"2026-09-24T01:46:43Z","next_actions":[{"tool":"run_calculator","calculator_id":"cubic-equation","reason":"Run Cubic Equation Solver with the inputs above."}],"links":{"markdown":"https://tttkmbb.com/math/cubic-equation.md"}}