CALCULATOR WORKSPACE
MATH / CALCULATOR

Equation Solver

Solve ax² + bx + c = 0 for real x, including linear and degenerate cases.

YOUR INPUTS

Calculate Equation Solver

01 / 02
Use 0 for a linear equation.
YOUR ANSWER

Results

02 / 02
=

Your result will appear here

Enter values above, then select Calculate result. Your inputs stay in this browser.

THE BASICS

How a, b and c decide the type and number of real solutions

The equation ax² + bx + c = 0 is quadratic only when a is nonzero. This solver checks that first, handles the linear or constant cases explicitly, and uses the discriminant to tell how many real quadratic roots exist. It reports real solutions and explains what a negative discriminant means without silently inventing complex output.

A single input form can describe a quadratic, a linear equation or a constant statement. When a is nonzero, the discriminant b² − 4ac controls the real-root branch: positive produces two distinct real roots, zero one repeated real root, and negative none. When a is zero, applying the quadratic formula would divide by zero, so the solver instead examines b and c directly. This distinction matters more than memorizing one formula for every input.

The solver first classifies the polynomial, then shows the discriminant branch and real roots. It handles a = 0 explicitly and labels no-real-root cases without hiding the role of complex numbers.

YOUR INPUTS

How coefficients a, b and c, and their signs, change the roots

The solver reads only three signed numbers, so the work is in rearranging your equation correctly. A sign typed wrongly changes the roots completely.

Coefficient a
The multiplier on x², from −1,000,000 to 1,000,000. Zero switches the solver to the linear case, so 0x² + 2x − 8 returns x = 4. A nonzero a smaller than 0.000000000001 is rejected, and a small accepted a can push one root far away: a = 0.001, b = 1000, c = 1 gives −999,999.999 and −0.001.
Coefficient b
The multiplier on x, sign included. Dropping a minus is the usual slip: x² − 3x + 2 has roots 1 and 2, but entering b as 3 solves x² + 3x + 2 and returns −2 and −1. Use 0 when there is no x term, as in x² − 2 = 0, which gives −1.414214 and 1.414214.
Constant c
The number left after every term has been moved to the left side with zero on the right. For 2x² + 4x = 6, subtracting 6 from both sides makes c = −6. Its sign can decide whether real roots exist at all: x² + x + 1 has a discriminant of −3 and no real roots.
Common factors
Multiplying all three coefficients by the same nonzero number leaves the roots unchanged: 2x² + 4x − 6 and x² + 2x − 3 both give −3 and 1, even though the discriminant changes from 64 to 16. Dividing out a shared factor first gives smaller numbers that are easier to check by hand.
Six-decimal roots
Roots are displayed to six decimal places, so √2 appears as 1.414214. Substituting a rounded root back into the equation leaves a small remainder rather than exactly zero, which is a display effect and not an error in the solution.

Steps

  1. Write your expression in the form ax² + bx + c = 0, moving all terms to the left if needed.
  2. Enter signed coefficients a, b and c; enter a = 0 for a linear or constant equation.
  3. Calculate, then inspect the classification, discriminant branch and solution cards. Check rounded roots in the original equation if you need numerical precision.

Reading tip: Before entering coefficients, collect like terms on one side and set the other side to zero. For example, x² = 3x − 2 becomes x² − 3x + 2 = 0, so a = 1, b = −3 and c = 2.

PRACTICAL USES

Algebra checks a coefficient-based solver can settle

01

Check quadratic homework

Enter coefficients from standard form and inspect both real roots.

02

Explain the discriminant

Compare positive, zero and negative D cases with the real-root count.

03

Handle a linear limit

Set a to zero and see bx+c=0 solved without dividing by zero.

04

Recognize identities

Distinguish 0=0 from a nonzero constant contradiction.

THE METHOD

How the calculation works

FormulaAt a glance
Quadratic roots when a ≠ 0=−b ± √(b² − 4ac)2a
Where:
a
Coefficient of x²; a must be nonzero for the quadratic formula.
b
Coefficient of x, which remains the linear coefficient when a is zero.
c
Constant term on the left of the equation.
D
Discriminant b²−4ac; its sign controls the real-root count.
COMPLETE FORMULA & VARIATIONS
If a = 0 and b ≠ 0: x = −c/b
If a = b = 0: c = 0 → all real x; c ≠ 0 → no solution
If a ≠ 0: D = b² − 4ac
If D ≥ 0: x = (−b ± √D)/(2a); if D < 0: no real roots

The cancellation-aware numerical evaluation is algebraically equivalent to the published quadratic formula. Complex roots are outside this tool.

What every part means

a
Coefficient of x²; a must be nonzero for the quadratic formula.
b
Coefficient of x, which remains the linear coefficient when a is zero.
c
Constant term on the left of the equation.
D
Discriminant b²−4ac; its sign controls the real-root count.

Calculate it step by step

1. Classify the equation
If a = 0, solve bx + c = 0; if b = 0 too, inspect c = 0

The quadratic denominator 2a is invalid when a is zero.

2. Compute the discriminant
D = b² − 4ac

Its sign determines the count of real quadratic roots.

3. Apply the quadratic formula
For a ≠ 0 and D ≥ 0: x = (−b ± √D) / (2a)

D = 0 gives one repeated value; D > 0 gives two distinct real values.

4. Preserve numerical stability
For D > 0, q = −(b + sign(b)√D)/2; roots = q/a and c/q

This equivalent form reduces cancellation when two close quantities would otherwise be subtracted.

OpenStax provides the standard quadratic formula and discriminant interpretation. The linear and constant branches follow direct algebra. Calculation Guide's coefficient limit of ±1,000,000 and nonzero magnitude floor of 10⁻¹² are technical input rules for bounded, readable output, not mathematical validity limits. Positive-D roots use an algebraically equivalent cancellation-aware evaluation; displayed roots are rounded to six decimals unless a tiny nonzero value needs more significant digits.

WORKED EXAMPLE

See it in practice

01 Sample inputs
Coefficient a · x²
1
Coefficient b · x
-3
Constant c
2
02 Put values into the formula

For x² − 3x + 2 = 0: a=1, b=−3, c=2. D = 9−8 = 1. x = (3±1)/2, so the real roots are 1 and 2.

03 Verified resultx = 1 or 2Two real roots
  • Equation classQuadratic
  • Discriminant1
GOOD TO KNOW

Interpretation & limitations

How to read your result

The classification card tells you whether the input is quadratic, linear, an identity or a contradiction. A negative D reports no real roots; it does not claim no complex solutions. A repeated root is one distinct real value counted twice by algebraic multiplicity. The displayed decimal may not make the original equation exactly zero after rounding.

Where this estimate stops

This tool handles one real-coefficient polynomial of degree at most two in x. It does not parse arbitrary expressions, show complex roots, solve inequalities or prove symbolic exact radicals. Input precision matters near a repeated root or a nearly zero leading coefficient; verify high-stakes calculations independently.

COMMON QUESTIONS

Frequently asked questions

01What if a is zero?

The x² term vanishes. The tool solves bx + c = 0 as a linear equation when b is nonzero, or classifies a constant identity or contradiction when b is zero too.

02Does a negative discriminant mean no solutions at all?

It means no real roots. Complex solutions can exist, but this tool does not calculate them.

03Why are there sometimes two roots?

When D is positive, the plus and minus branches of the quadratic formula produce two distinct real values.

04What does D = 0 mean?

The two formula branches coincide, giving one repeated real root.

05What does 0 = 0 return?

Every real number satisfies it, so the solver reports all real numbers rather than one root.

06Why can a root be slightly rounded?

Square roots often have nonterminating decimals. The calculation keeps decimal precision internally and rounds the displayed answer.

FURTHER READING

Sources & references

KEEP EXPLORING

Related calculators