keisoku

Cubic Equation Solver

Enter the coefficients of ax³+bx²+cx+d=0 to find all three roots (real and complex) with Cardano's method, plus the discriminant and the number of real roots.

Input

Enter the coefficients of the cubic equation ax³+bx²+cx+d=0. Setting a to 0 solves it as a lower degree equation.

a x³ + b x² + c x + d = 0

Result

Roots

x1 = 3

x2 = 2

x3 = 1

Discriminant

4

Number of real roots

3

The discriminant is positive, so there are three distinct real roots.


Details of each root

Root 1Real3
Root 2Real2
Root 3Real1

How it works

  • Solves the cubic equation ax³+bx²+cx+d=0. If you set a to 0, it automatically treats the input as a quadratic or linear equation.
  • It first divides by a to normalize to x³+p₂x²+p₁x+p₀=0, then substitutes x=t-p₂/3 to obtain the depressed cubic t³+pt+q=0.
  • The sign of the discriminant D=(q/2)²+(p/3)³ determines the nature of the roots. Positive D gives one real root and two conjugate complex roots, zero D gives all real roots including repeated ones, and negative D gives three distinct real roots.
  • When D is negative, the three real roots are obtained with a trigonometric method.
  • The displayed discriminant is the discriminant of the whole polynomial, and the real root count is the number of distinct real roots, counting a repeated root once.

Reviews

Tell us what you think of this calculator.

Write a review

  1. Home
  2. Cubic Equation Solver