{"id":61935,"date":"2021-05-31T08:38:13","date_gmt":"2021-05-31T06:38:13","guid":{"rendered":"https:\/\/wpcalc.com\/?p=61935"},"modified":"2026-09-30T20:23:36","modified_gmt":"2026-09-30T17:23:36","slug":"polynomial-equation","status":"publish","type":"post","link":"https:\/\/wpcalc.com\/en\/mathematics\/polynomial-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=\"61935\" data-favorite-title=\"Cubic Equation\" data-favorite-url=\"https:\/\/wpcalc.com\/en\/mathematics\/polynomial-equation\/\" data-favorite-excerpt=\"Solves any cubic equation ax\u00b3 + bx\u00b2 + cx + d = 0 using Cardano&#039;s method. Enter the four coefficients and the calculator returns the real roots, flags complex ones, and detects repeated roots.\" 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\/polynomial-equation\/\" method=\"POST\" class=\"calculator\" id=\"calculator-61935\" data-post=\"61935\"><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=\"61935\">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=\"61935\" 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^2 d}{27a^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 the coefficients of the cubic equation<\/li>\n<li>\\(p, q\\) \u2014 the coefficients of the depressed cubic after removing the quadratic term<\/li>\n<\/ul>\n<p>From here, Cardano's method applies. The key quantity is the discriminant \\(\\Delta = \\left(\\frac{q}{2}\\right)^2 + \\left(\\frac{p}{3}\\right)^3\\):<\/p>\n<ul>\n<li>If \\(\\Delta &gt; 0\\), there is one real root, given by<br \/>\\( t = \\sqrt[3]{-\\frac{q}{2} + \\sqrt{\\Delta}} + \\sqrt[3]{-\\frac{q}{2} - \\sqrt{\\Delta}} \\)<\/li>\n<li>If \\(\\Delta = 0\\), all roots are real and at least two coincide: \\( t_1 = 2\\sqrt[3]{-\\frac{q}{2}} \\), \\( t_2 = t_3 = -\\sqrt[3]{-\\frac{q}{2}} \\)<\/li>\n<li>If \\(\\Delta &lt; 0\\), there are three distinct real roots, found with the trigonometric form \\( t_k = 2\\sqrt{-\\frac{p}{3}} \\cos\\left(\\frac{\\theta + 2\\pi k}{3}\\right) \\), where \\( \\cos\\theta = \\frac{3q}{2p}\\sqrt{-\\frac{3}{p}} \\), \\( k = 0, 1, 2 \\)<\/li>\n<\/ul>\n<p>Each root of the original equation is recovered by back-substitution: \\( x = t - \\frac{b}{3a} \\).<\/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 \\) (coefficients \\( a = 1 \\), \\( b = 8 \\), \\( c = 16 \\), \\( d = 0 \\) \u2014 the calculator's default values).<\/p>\n<p>\\[ p = \\frac{3 \\cdot 1 \\cdot 16 - 8^2}{3 \\cdot 1^2} = \\frac{48 - 64}{3} = -\\frac{16}{3}, \\qquad q = \\frac{2 \\cdot 8^3 - 9 \\cdot 1 \\cdot 8 \\cdot 16 + 27 \\cdot 1^2 \\cdot 0}{27 \\cdot 1^3} = \\frac{64}{27} \\]<\/p>\n<p>\\[ \\Delta = \\left(\\frac{q}{2}\\right)^2 + \\left(\\frac{p}{3}\\right)^3 = \\left(\\frac{32}{27}\\right)^2 + \\left(-\\frac{16}{9}\\right)^3 = \\frac{1024}{729} - \\frac{4096}{729} \\cdot \\frac{1}{...} = 0 \\]<\/p>\n<p>Since \\( \\Delta = 0 \\), the equation has a repeated root. With \\( \\sqrt[3]{-\\frac{q}{2}} = \\sqrt[3]{-\\frac{32}{27}} = -\\frac{4}{3} \\):<\/p>\n<p>\\[ t_1 = 2\\left(-\\frac{4}{3}\\right) = -\\frac{8}{3}, \\qquad t_2 = t_3 = -\\left(-\\frac{4}{3}\\right) = \\frac{4}{3} \\]<\/p>\n<p>Back-substituting \\( x = t - \\frac{8}{3} \\):<\/p>\n<p>\\[ x_1 = -\\frac{8}{3} - \\frac{8}{3} = 0, \\qquad x_2 = x_3 = \\frac{4}{3} - \\frac{8}{3} = -4 \\]<\/p>\n<p><strong>Result:<\/strong> \\( x_1 = 0 \\), \\( x_2 = -4 \\), \\( x_3 = -4 \\). You can verify this by factoring: \\( x^3 + 8x^2 + 16x = x(x+4)^2 \\).<\/p>\n<p>\n\r\n<\/section>\n<h2>How to Use the Calculator<\/h2>\n<ol>\n<li>Enter the leading <strong>Coefficient a<\/strong> (the number multiplying \\( x^3 \\)). It must not be 0 \u2014 otherwise the equation is not cubic, and the calculator shows an error.<\/li>\n<li>Enter <strong>Coefficient b<\/strong>, the multiplier of \\( x^2 \\).<\/li>\n<li>Enter <strong>Coefficient c<\/strong>, the multiplier of \\( x \\).<\/li>\n<li>Enter <strong>Coefficient d<\/strong>, the constant term. Use 0 if the equation has no constant (as in \\( x^3 + 8x^2 + 16x = 0 \\)).<\/li>\n<li>Read the results: <strong>Root x\u2081<\/strong>, <strong>Root x\u2082<\/strong> and <strong>Root x\u2083<\/strong>. If the equation has only one real solution, the other two fields display \u201cComplex root\u201d, since the remaining two roots are complex conjugates.<\/li>\n<\/ol>\n<h2>What Is a Cubic Equation?<\/h2>\n<p>A cubic equation is any polynomial equation of degree three, written in the standard form \\( ax^3 + bx^2 + cx + d = 0 \\) with \\( a \\neq 0 \\). Every cubic equation with real coefficients has at least one real root and at most three. Unlike a <a href=\"https:\/\/wpcalc.com\/en\/mathematics\/quadratic-equation-2\/\">quadratic equation<\/a>, which can be solved with a single compact formula, a cubic requires either factoring, Cardano's method, or a numerical approach \u2014 which is why a solver tool saves so much time.<\/p>\n<p>The calculator works by first eliminating the \\( x^2 \\) term. The substitution \\( x = t - \\frac{b}{3a} \\) turns any cubic into a <em>depressed cubic<\/em> \\( t^3 + pt + q = 0 \\), a simpler form known since the 16th century. Cardano's formula then computes a discriminant-like quantity \\( \\Delta \\) that tells you the nature of the roots before they are even computed: one real plus two complex roots when \\( \\Delta &gt; 0 \\), all real with a repeated root when \\( \\Delta = 0 \\), and three distinct real roots when \\( \\Delta &lt; 0 \\).<\/p>\n<p>Interpreting the output is straightforward. If all three roots are numbers, the graph of \\( y = ax^3 + bx^2 + cx + d \\) crosses the x-axis at those points (touching it at a repeated root). If two fields say \u201cComplex root\u201d, the graph crosses the x-axis only once, at the single real root shown. The two hidden roots are a <a href=\"https:\/\/wpcalc.com\/en\/mathematics\/complex-conjugate\/\">complex conjugate pair<\/a>; you can explore them further with the <a href=\"https:\/\/wpcalc.com\/en\/mathematics\/complex-number-calculator\/\">complex number calculator<\/a>.<\/p>\n<p>Cubic equations appear everywhere in applied mathematics: finding intersection points in geometry, computing eigenvalues in linear algebra, modeling volume problems in physics, and analyzing stability in engineering and economics.<\/p>\n<h2>Assumptions, Limitations and Tips<\/h2>\n<ul>\n<li><strong>Coefficient a must be nonzero.<\/strong> If \\( a = 0 \\), the equation is actually quadratic (or linear) \u2014 use the quadratic equation solver instead.<\/li>\n<li><strong>Complex roots are flagged, not computed.<\/strong> The calculator reports real roots numerically and shows \u201cComplex root\u201d for the non-real pair. This keeps the output clean for everyday use.<\/li>\n<li><strong>Rounding to 5 decimal places.<\/strong> Results are rounded, so a root like \\( \\sqrt[3]{2} \\) appears as 1.25992. For most purposes this is more than enough precision; tiny discrepancies may appear if you substitute a rounded root back into the equation.<\/li>\n<li><strong>Numerical edge cases.<\/strong> Very large or very small coefficients can cause floating-point round-off, so a discriminant that is mathematically exactly zero may compute as a very small positive or negative number. In such cases the displayed roots may differ in the last decimals.<\/li>\n<li><strong>Check with Descartes' rule.<\/strong> Before solving, you can estimate how many positive and negative real roots exist using the <a href=\"https:\/\/wpcalc.com\/en\/mathematics\/descartes-rule-of-signs\/\">Descartes' Rule of Signs calculator<\/a>, then use the result as a sanity check on the solver's output. Hand in hand with that, the <a href=\"https:\/\/wpcalc.com\/en\/mathematics\/cubic-roots\/\">cubic root calculator<\/a> is useful when you only need \\( \\sqrt[3]{n} \\) for a single number.<\/li>\n<li><strong>Simple factoring first.<\/strong> Always check whether \\( x = 0 \\) is a root (i.e., \\( d = 0 \\)) or whether an obvious integer like 1, \u22121, 2 or \u22122 satisfies the equation \u2014 factoring out one root reduces the cubic to a quadratic you can solve mentally.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Solves any cubic equation ax\u00b3 + bx\u00b2 + cx + d = 0 using Cardano's method. Enter the four coefficients and the calculator returns the real roots, flags complex ones, and detects repeated roots.<\/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-61935","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\/61935","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=61935"}],"version-history":[{"count":3,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/61935\/revisions"}],"predecessor-version":[{"id":66217,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/61935\/revisions\/66217"}],"wp:attachment":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/media?parent=61935"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/categories?post=61935"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/tags?post=61935"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}