{"id":61501,"date":"2021-02-02T16:51:49","date_gmt":"2021-02-02T14:51:49","guid":{"rendered":"https:\/\/wpcalc.com\/?p=61501"},"modified":"2026-09-30T20:23:31","modified_gmt":"2026-09-30T17:23:31","slug":"cubic-equation","status":"publish","type":"post","link":"https:\/\/wpcalc.com\/en\/mathematics\/cubic-equation\/","title":{"rendered":"Cubic Equation Solver"},"content":{"rendered":"<section class=\"not-prose calculator-box\" aria-labelledby=\"calculator-title\"><div class=\"flex items-baseline sm:items-center justify-between gap-2 sm:gap-3\"><div class=\"flex flex-col sm:flex-row sm:items-center gap-2\"><span class=\"icon icon-calculator text-primary-700! text-base! dark:text-primary-300!\" aria-hidden=\"true\"><\/span><h2 id=\"calculator-title\" class=\"text-lg font-display font-bold\">Cubic Equation<\/h2><\/div><div class=\"calcdash-favorite group\">\n  <button type=\"button\" class=\"favorite\" id=\"favorite\" data-favorite-id=\"61501\" data-favorite-title=\"Cubic Equation\" data-favorite-url=\"https:\/\/wpcalc.com\/en\/mathematics\/cubic-equation\/\" data-favorite-excerpt=\"Enter the coefficients a, b, c and d to solve any cubic equation of the form ax\u00b3 + bx\u00b2 + cx + d = 0. The calculator finds all real roots using Cardano&#039;s method and indicates when the remaining roots are complex.\" aria-label=\"Add to Favorites\" data-favorite-icon=\"icon icon-algebra\">\n    <span class=\"icon icon-shape-star-empty\" aria-hidden=\"true\"><\/span>\n  <\/button>\n  <div class=\"calcdash-favorite__tip\" aria-hidden=\"true\">\n   <span class=\"favorite-tooltip\" id=\"favorite-tooltip\"><\/span>\n  <\/div>\n  <span class=\"sr-only\" role=\"status\" id=\"favorite-status\"><\/span>\n<\/div><\/div><form action=\"https:\/\/wpcalc.com\/en\/mathematics\/cubic-equation\/\" method=\"POST\" class=\"calculator\" id=\"calculator-61501\" data-post=\"61501\"><fieldset class=\"fieldset-input\"><legend class=\"sr-only\">Input Fields<\/legend><div class=\"field has-term\" id=\"input-1\"><label for=\"field-1\">Coefficient a<\/label><div class=\"term\">a<\/div>  <div class=\"absolute bottom-0 left-16 top-8 w-2 h-0.5 bg-blue-500\"><\/div><input type=\"number\" name=\"coefficient_a\" id=\"field-1\" step=\"any\" value=\"1\"\/><\/div><div class=\"field has-term\" id=\"input-2\"><label for=\"field-2\">Coefficient b<\/label><div class=\"term\">b<\/div>  <div class=\"absolute bottom-0 left-16 top-8 w-2 h-0.5 bg-blue-500\"><\/div><input type=\"number\" name=\"coefficient_b\" id=\"field-2\" step=\"any\" value=\"8\"\/><\/div><div class=\"field has-term\" id=\"input-3\"><label for=\"field-3\">Coefficient c<\/label><div class=\"term\">c<\/div>  <div class=\"absolute bottom-0 left-16 top-8 w-2 h-0.5 bg-blue-500\"><\/div><input type=\"number\" name=\"coefficient_c\" id=\"field-3\" step=\"any\" value=\"16\"\/><\/div><div class=\"field has-term\" id=\"input-4\"><label for=\"field-4\">Coefficient d<\/label><div class=\"term\">d<\/div>  <div class=\"absolute bottom-0 left-16 top-8 w-2 h-0.5 bg-blue-500\"><\/div><input type=\"number\" name=\"coefficient_d\" id=\"field-4\" step=\"any\" value=\"0\"\/><\/div><\/fieldset><div class=\"buttons\"><button type=\"submit\" data-text=\"Re-Calculate\" id=\"calculate-button\" data-post=\"61501\">Calculate<\/button><button type=\"reset\">Reset<\/button><\/div><div class=\"field is-checkbox hidden!\" id=\"field-auto-calc\"><input type=\"checkbox\" id=\"auto-calc\"><label for=\"auto-calc\">Calculate automatically<\/label><small>If enabled, the result will update automatically when you change any value.<\/small><\/div><div class=\"fieldset-result is-hidden\" aria-labelledby=\"result-title\" aria-live=\"polite\" role=\"region\"> <h3 class=\"result-title bg-gradient-to-r from-primary-50 to-gray-50 dark:from-primary-900 dark:to-gray-800\" id=\"result-title\"><span class=\"icon icon-s-pulse\" aria-hidden=\"true\"><\/span> Your Results<\/h3><div class=\"result-box\"><div class=\"field-result\" id=\"output-1\"><span class=\"field-title\"><span>Root x\u2081<\/span><\/span><span class=\"field-value\" id=\"result-1\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><div class=\"field-result\" id=\"output-2\"><span class=\"field-title\"><span>Root x\u2082<\/span><\/span><span class=\"field-value\" id=\"result-2\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><div class=\"field-result\" id=\"output-3\"><span class=\"field-title\"><span>Root x\u2083<\/span><\/span><span class=\"field-value\" id=\"result-3\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><\/div><div class=\"result-actions\"><button type=\"button\" class=\"copy-link\"><svg viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M12.232 4.232a2.5 2.5 0 0 1 3.536 3.536l-1.225 1.224a.75.75 0 0 0 1.061 1.06l1.224-1.224a4 4 0 0 0-5.656-5.656l-3 3a4 4 0 0 0 .225 5.865.75.75 0 0 0 .977-1.138 2.5 2.5 0 0 1-.142-3.667l3-3Z\"\/><path d=\"M11.603 7.963a.75.75 0 0 0-.977 1.138 2.5 2.5 0 0 1 .142 3.667l-3 3a2.5 2.5 0 0 1-3.536-3.536l1.225-1.224a.75.75 0 0 0-1.061-1.06l-1.224 1.224a4 4 0 1 0 5.656 5.656l3-3a4 4 0 0 0-.225-5.865Z\"\/><\/svg><span class=\"copy-link__text\">Copy link to this calculation<\/span><\/button><span class=\"sr-only\" role=\"status\" id=\"copy-link-status\"><\/span><\/div><\/div><a href=\"#respond\" class=\"hidden transition-opacity duration-300 opacity-0 w-50 text-sm justify-center items-center gap-2 px-4 py-2 rounded bg-gray-200 text-gray-700 hover:bg-gray-300\" id=\"leave-comment\"><span class=\"icon icon-comments\" aria-hidden=\"true\"><\/span>Leave a Comment<\/a><\/form><\/section><section id=\"calc-reactions\" class=\"not-prose hidden my-12 bg-gradient-to-r from-primary-50 to-gray-50 border border-indigo-100 rounded-xl px-6 py-4 shadow-sm\" data-post=\"61501\" aria-live=\"polite\" aria-labelledby=\"calc-reactions-title\"><p id=\"calc-reactions-title\" class=\"text-sm text-gray-500 text-center mb-2\">How did this result make you feel?<\/p><div role=\"group\" aria-labelledby=\"calc-reactions-title\" class=\"grid grid-cols-3 sm:flex sm:flex-row sm:justify-around gap-4 sm:items-center sm:flex-wrap\"><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"like\"><span class=\"reaction-count\" data-reaction-count=\"like\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\ude00 <\/span><span class=\"reaction-description font-medium\">Like <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"helpful\"><span class=\"reaction-count\" data-reaction-count=\"helpful\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\udca1 <\/span><span class=\"reaction-description font-medium\">Helpful <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"confused\"><span class=\"reaction-count\" data-reaction-count=\"confused\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\ude15 <\/span><span class=\"reaction-description font-medium\">Confused <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"disappointed\"><span class=\"reaction-count\" data-reaction-count=\"disappointed\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\ude1e <\/span><span class=\"reaction-description font-medium\">Disappointed <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"inaccurate\"><span class=\"reaction-count\" data-reaction-count=\"inaccurate\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\u274c <\/span><span class=\"reaction-description font-medium\">Inaccurate <\/span><\/button><\/div><div id=\"reaction-message\" class=\"hidden mt-8 rounded-md border border-primary-100 bg-white\/50 backdrop-blur-sm px-4 py-2 text-sm text-center shadow-sm\"><\/div><\/section><div class=\"calcdash-ad not-prose calcdash-ad--calc_result calcdash-ad--in-article\"><ins class=\"adsbygoogle\" style=\"display:block\" data-ad-client=\"ca-pub-1721569815777345\" data-ad-slot=\"6317458308\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\"><\/ins><script>(adsbygoogle = window.adsbygoogle || []).push({});<\/script><\/div>\n<style id=\"wpcoderpro-inline-1\">.formula-box {\r\n\tborder-bottom: none !important;\r\n}<\/style><section class=\"formula-box\" aria-labelledby=\"formula-title\">\r\n\t<div id=\"formula-title\" class=\"not-prose font-display mb-4\"><span class=\"icon icon-formula\" aria-hidden=\"true\"><\/span><h2>Cubic Equation Formula<\/h2><\/div>\r\n\t<figure class=\"not-prose formula\">\r\n\t\t<figcaption class=\"formula-title\">Formula<\/figcaption>\r\n\t\t<div class=\"text-base text-gray-800\" id=\"formula\">\n\\[ ax^3 + bx^2 + cx + d = 0 \\quad (a \\neq 0) \\]\n\\[ \\text{Substitute } x = t - \\frac{b}{3a} \\text{ to get the depressed cubic } t^3 + pt + q = 0 \\]\n\\[ p = \\frac{3ac - b^2}{3a^2}, \\qquad q = \\frac{2b^3 - 9abc + 27a^2d}{27a^3} \\]\n\\[ t = \\sqrt[3]{-\\frac{q}{2} + \\sqrt{\\Delta}} + \\sqrt[3]{-\\frac{q}{2} - \\sqrt{\\Delta}}, \\qquad \\Delta = \\left(\\frac{q}{2}\\right)^2 + \\left(\\frac{p}{3}\\right)^3 \\]\n<\/div>\r\n\t<\/figure>\r\n\t<\/p>\n<p><strong>Where:<\/strong><\/p>\n<ul>\n<li>\\(a, b, c, d\\) \u2014 coefficients of the cubic equation<\/li>\n<li>\\(x\\) \u2014 the unknown; each root \\(x_i\\) is recovered from \\(x_i = t_i - \\frac{b}{3a}\\)<\/li>\n<li>\\(\\Delta\\) \u2014 the discriminant of the depressed cubic: if \\(\\Delta &gt; 0\\) there is one real root and two complex roots; if \\(\\Delta = 0\\) all roots are real with at least two equal; if \\(\\Delta &lt; 0\\) there are three distinct real roots, found with a trigonometric form of Cardano&#039;s formula.<\/li>\n<\/ul>\n<p>The substitution \\(x = t - \\frac{b}{3a}\\) removes the quadratic term, and Cardano's formula then gives the roots of the simpler depressed cubic.<\/p>\n<p>\r\n<\/section>\n<style id=\"wpcoderpro-inline-459\">.calculation-box {\r\n\tborder-bottom: none !important;\r\n}<\/style><section id=\"calculation\" class=\"calculation-box\" aria-labelledby=\"calculation-title\">\r\n\t<div id=\"calculation-title\" class=\"not-prose font-display\"><span class=\"icon icon-unordered-list\" aria-hidden=\"true\"><\/span><h2>Cubic Equation \u2013 Calculation Example<\/h2><\/div>\r\n\r\n<\/p>\n<p><strong>Example:<\/strong> solve \\(x^3 + 8x^2 + 16x = 0\\), i.e. \\(a = 1\\), \\(b = 8\\), \\(c = 16\\), \\(d = 0\\) (the default values of the calculator).<\/p>\n<p>\\[ p = \\frac{3 \\cdot 1 \\cdot 16 - 8^2}{3 \\cdot 1^2} = \\frac{48 - 64}{3} = -\\frac{16}{9} \\]<\/p>\n<p>\\[ q = \\frac{2 \\cdot 8^3 - 9 \\cdot 1 \\cdot 8 \\cdot 16 + 27 \\cdot 1^2 \\cdot 0}{27 \\cdot 1^3} = \\frac{1024 - 1152}{27} = \\frac{64}{27} \\]<\/p>\n<p>\\[ \\Delta = \\left(\\frac{64}{54}\\right)^2 + \\left(-\\frac{16}{27}\\right)^3 = \\frac{4096}{729} - \\frac{4096}{729} = 0 \\]<\/p>\n<p>Since \\(\\Delta = 0\\), all roots are real and at least two coincide. With \\(\\sqrt[3]{q\/2 + 0}\\;=\\;\\sqrt[3]{64\/27} = \\frac{4}{3}\\) and \\(\\frac{b}{3a} = \\frac{8}{3}\\):<\/p>\n<p>\\[ x_1 = -\\frac{8}{3} + 2 \\cdot \\frac{4}{3} = 0, \\qquad x_2 = x_3 = -\\left(\\frac{4}{3} + \\frac{8}{3}\\right) = -4 \\]<\/p>\n<p><strong>Result:<\/strong> \\(x_1 = 0\\), \\(x_2 = x_3 = -4\\). Indeed, \\(x^3 + 8x^2 + 16x = x(x + 4)^2 = 0\\).<\/p>\n<p>\n\r\n<\/section>\n<h2>How to Use the Cubic Equation Calculator<\/h2>\n<ol>\n<li>Enter the coefficient <strong>a<\/strong> of the \\(x^3\\) term. It must not be zero \u2014 otherwise the equation is not cubic (a helpful error message appears if you enter 0).<\/li>\n<li>Enter the coefficient <strong>b<\/strong> of the \\(x^2\\) term, the coefficient <strong>c<\/strong> of the \\(x\\) term, and the constant term <strong>d<\/strong>. Use 0 for any missing term.<\/li>\n<li>The three roots \\(x_1\\), \\(x_2\\) and \\(x_3\\) are calculated instantly as you type.<\/li>\n<li>Check the results: if two roots are equal, the equation has a double (repeated) root; if a result shows \u201cComplex root\u201d, that pair of roots is complex and only the real root is displayed numerically.<\/li>\n<\/ol>\n<h2>What Is a Cubic Equation?<\/h2>\n<p>A cubic equation is any equation that can be written as \\(ax^3 + bx^2 + cx + d = 0\\) with \\(a \\neq 0\\). It is the next step up from the <a href=\"https:\/\/wpcalc.com\/en\/mathematics\/quadratic-equation-2\/\">quadratic equation<\/a>, and unlike quadratics it is guaranteed to have at least one real root \u2014 a consequence of the fact that a third-degree polynomial always crosses the x-axis somewhere.<\/p>\n<p>By the fundamental theorem of algebra, a cubic has exactly three roots when complex roots are counted. The three possibilities are: three distinct real roots; one real root plus a pair of complex conjugate roots; or real roots with one of them repeated (a double root), as in the worked example above. Which case applies is decided by the sign of the discriminant \\(\\Delta\\) of the depressed cubic.<\/p>\n<p>The solution method used here goes back to Gerolamo Cardano's <em>Ars Magna<\/em> (1545). The key trick is the substitution \\(x = t - \\frac{b}{3a}\\), which eliminates the \\(x^2\\) term and reduces the problem to the depressed cubic \\(t^3 + pt + q = 0\\). When \\(\\Delta &lt; 0\\), the square roots in Cardano&#039;s formula become imaginary even though the final roots are real \u2014 historically called the <em>casus irreducibilis<\/em> \u2014 so the calculator switches to a trigonometric variant using \\(\\cos\\) and \\(\\arccos\\) to produce the three real roots directly.<\/p>\n<p>Cubic equations appear wherever a quantity depends on volume or on a third power: finding dimensions of a box with a given volume, computing intersections of a line and a cubic curve, eigenvalue problems in engineering, and thermodynamic property calculations.<\/p>\n<h2>Interpreting the Results<\/h2>\n<p>Each root \\(x_i\\) is a value of \\(x\\) at which the polynomial equals zero \u2014 geometrically, an x-intercept of the curve \\(y = ax^3 + bx^2 + cx + d\\). A double root (two equal values in the results) means the curve touches the axis at that point without crossing it. When the output shows \u201cComplex root\u201d, the two non-real roots form a <a href=\"https:\/\/wpcalc.com\/en\/mathematics\/complex-conjugate\/\">complex conjugate pair<\/a>, so only the single real root is given numerically. Results are rounded to 5 decimal places, which is enough for most practical purposes.<\/p>\n<h2>Tips, Assumptions and Limitations<\/h2>\n<ul>\n<li><strong>Coefficient a must be non-zero.<\/strong> If \\(a = 0\\), the equation is actually quadratic (or linear), and you should use the <a href=\"https:\/\/wpcalc.com\/en\/mathematics\/quadratic-equation-2\/\">quadratic equation calculator<\/a> instead.<\/li>\n<li><strong>Complex roots are not listed numerically.<\/strong> If your equation has one real and two complex roots, only the real root is shown; the complex pair can be found from \\(x_2 + x_3 = -\\frac{b}{a} - x_1\\) and \\(x_2 x_3 = \\frac{d\/a}{x_1}\\). The <a href=\"https:\/\/wpcalc.com\/en\/mathematics\/complex-root\/\">complex root calculator<\/a> covers complex solutions in more detail.<\/li>\n<li><strong>Rounding.<\/strong> Roots are rounded to 5 decimal places. Values shown as, e.g., 3.99999 or \u22120.00001 for a \u201cnice\u201d equation are simply rounding artifacts.<\/li>\n<li><strong>Check by factoring when possible.<\/strong> If one root \\(r\\) is found, \\((x - r)\\) divides the polynomial, and the remaining roots come from a quadratic. Tools like <a href=\"https:\/\/wpcalc.com\/en\/mathematics\/descartes-rule-of-signs\/\">Descartes' rule of signs<\/a> can help you predict how many positive or negative roots to expect before solving.<\/li>\n<li><strong>Higher degrees.<\/strong> For fourth-degree equations, use the <a href=\"https:\/\/wpcalc.com\/en\/mathematics\/quartic-equation\/\">quartic equation solver<\/a>; general polynomials of degree five and higher have no formula in radicals at all.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Enter the coefficients a, b, c and d to solve any cubic equation of the form ax\u00b3 + bx\u00b2 + cx + d = 0. The calculator finds all real roots using Cardano's method and indicates when the remaining roots are complex.<\/p>\n","protected":false},"author":70,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[7],"tags":[11],"class_list":["post-61501","post","type-post","status-publish","format-standard","hentry","category-mathematics","tag-algebra"],"acf":[],"_links":{"self":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/61501","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/users\/70"}],"replies":[{"embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/comments?post=61501"}],"version-history":[{"count":4,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/61501\/revisions"}],"predecessor-version":[{"id":66216,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/61501\/revisions\/66216"}],"wp:attachment":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/media?parent=61501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/categories?post=61501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/tags?post=61501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}