Solve \(ax^2+bx+c=0\) from its three coefficients. The calculator classifies the roots, shows exact expressions, and labels rounded real-root approximations. It also handles a zero leading coefficient as a linear or constant equation.

Move every term to one side first. Enter zero for a missing term and retain each coefficient’s sign. For \(2x^2+3x=5\), the entries are \(a=2,\ b=3,\ c=-5\).

A parabola y equals x squared minus five x plus six crosses the horizontal axis at x equals two and three.
The example x squared minus five x plus six has two exact roots, two and three.Credit: MathBlog

Solve ax² + bx + c = 0

Enter decimal coefficients with at most 12 digits in total and 6 decimal places each. No exponents or thousands separators. The equation must already equal zero. A zero a coefficient is handled as a linear or constant equation.

Calculations run in your browser. Your entries are not sent to a MathBlog calculation service. Exact results and approximate values are labeled separately.

Example with two real roots

For \(x^2-5x+6=0\), the discriminant is \((-5)^2-4\times1\times6=1\). The quadratic formula gives \(\frac{5\pm1}{2}\), so the roots are 2 and 3.

Check by substitution: \(2^2-5(2)+6=0\) and \(3^2-5(3)+6=0\). The equation also factors as \((x-2)(x-3)=0\).

Repeated and complex roots

A zero discriminant gives one repeated real root. For \(x^2+2x+1=0\), the root is −1 and the expression factors as \((x+1)^2\).

A negative discriminant gives no real roots but does give a complex conjugate pair. For \(x^2+1=0\), the roots are i and −i, where \(i^2=-1\). The tool labels these separately from the real cases.

Decimal coefficients and exact classification

Each coefficient accepts at most 12 total digits and 6 decimal places. Commas, units, and scientific notation are rejected. The calculator multiplies all finite decimal coefficients by a common positive factor to obtain an equivalent integer-coefficient equation.

The displayed discriminant belongs to that scaled equation. Its sign is exact, but its numerical value can differ from the original decimal equation’s discriminant by the square of the scale factor. The roots remain unchanged.

Perfect-square discriminants yield exact rational roots. Otherwise, the output retains an exact radical expression. Positive nonsquare discriminants also receive real-root approximations to at most 12 significant digits, calculated with a form that reduces subtraction cancellation.

Inputs that are not quadratic

If a is zero and b is nonzero, solve \(bx+c=0\). If both a and b are zero, a zero c gives the identity \(0=0\), while a nonzero c gives no solution.

These cases are reported rather than passed through a formula that would divide by zero. For more background, read MathBlog’s quadratic formula reference. Exact expressions should be preferred over rounded values when checking symbolic equalities.

Further reading