Algebra

Quadratic Equation Solver

Enter the coefficients of a quadratic equation ax² + bx + c = 0. The solver reports the vertex and axis of symmetry, computes the discriminant Δ = b² − 4ac to classify the roots, and applies the quadratic formula x = (−b ± √Δ) / (2a), showing every substitution.

Quadratic Equation Solver

Solve ax² + bx + c = 0 with roots, vertex and discriminant.

Try:
Answerx₁ = 2, x₂ = 1
  1. Equation1x² − 3x + 2 = 0
  2. Vertex(h, k) = (−b/2a, c − b²/4a) = (1.5, -0.25)
  3. Axis of symmetryx = 1.5
  4. DiscriminantΔ = b² − 4ac = (-3)² − 4·1·2 = 1
  5. Formulax = (−b ± √Δ) / (2a)
  6. x₁(−(-3) + √1) / (2·1) = 2
  7. x₂(−(-3) − √1) / (2·1) = 1

What this solver is for

A quadratic equation is any equation that can be rearranged into the shape ax² + bx + c = 0, where a is not zero. That single restriction — a squared term, and nothing of higher degree — is what makes quadratics the most completely understood family of equations in elementary algebra. There is a formula that solves every one of them, it always terminates, and it tells you the answer exactly rather than approximately.

This calculator takes the three coefficients and returns the roots, the discriminant that classifies them, the vertex of the parabola, and the axis of symmetry. It shows the substitution at each stage rather than only the final numbers, because for most people the difficulty with quadratics is not the arithmetic but keeping track of signs while carrying a negative coefficient through a square and a square root.

The tool is aimed at three moments in particular. The first is checking homework: you have solved a quadratic by factoring or by completing the square, and you want to confirm the roots without redoing the work. The second is the case that will not factor — where the roots are irrational or complex and there is no clean pair of integers to spot. The third is reading a parabola rather than solving it, when what you actually need is the vertex or the axis of symmetry rather than the x-intercepts.

It is deliberately not a general polynomial solver. Everything it reports depends on the equation being exactly second degree, which is what makes the closed-form answer possible. If your leading coefficient is zero the equation is linear, not quadratic, and the tool will tell you so instead of dividing by zero and returning nonsense.

How to use this calculator

  1. Rearrange your equation so one side is zero The formula assumes the standard form ax² + bx + c = 0. If you are looking at something like 2x² + 5 = 7x, move every term to the left first: 2x² − 7x + 5 = 0. Skipping this is the single most common source of wrong answers, because the coefficients you read off an unarranged equation are not the ones the formula expects.
  2. Read off a, b and c with their signs attached The sign belongs to the coefficient. In 2x² − 7x + 5 = 0 the value of b is −7, not 7. Enter the minus sign; the solver will not infer it.
  3. Enter a missing term as zero An equation like x² − 9 = 0 has no linear term, so b is 0. Leaving a field blank is not the same as entering zero — blank fields are treated as missing input rather than as a zero coefficient.
  4. Read the discriminant before the roots The discriminant line tells you what kind of answer to expect: two real roots, one repeated root, or a complex conjugate pair. Checking it first means the shape of the result is never a surprise.
  5. Check the steps, not just the answer Each intermediate line shows the actual substitution, so if your hand-worked answer disagrees you can find the exact stage where the two calculations diverge rather than starting over.

The formula, and where it comes from

x = (−b ± √Δ) / (2a), where Δ = b² − 4ac

The quadratic formula is not a rule to memorise on faith — it is what completing the square gives you when you do it symbolically instead of numerically. Start from ax² + bx + c = 0, divide through by a, and move the constant across: x² + (b/a)x = −c/a. Add the square of half the linear coefficient to both sides, which is (b/2a)², and the left-hand side becomes a perfect square: (x + b/2a)² = b²/4a² − c/a.

Putting the right-hand side over a common denominator gives (b² − 4ac)/4a². Taking the square root of both sides introduces the plus-or-minus, because a positive number has two square roots, and subtracting b/2a leaves x = (−b ± √(b² − 4ac)) / 2a. Every quadratic formula you have ever used is that derivation, frozen.

The quantity under the root, b² − 4ac, is called the discriminant and written Δ. It does the classifying. Because it sits under a square root, its sign alone decides whether the roots are two distinct real numbers, one repeated real number, or a conjugate pair of complex numbers — and you can know which before computing anything else.

What each input means

a Leading coefficient — form field “a (x² coefficient)”
The multiplier on x². It must not be zero; if it were, the x² term would vanish and the equation would be linear. Its sign controls which way the parabola opens — positive opens upward with a minimum at the vertex, negative opens downward with a maximum.
b Linear coefficient — form field “b (x coefficient)”
The multiplier on x. It shifts the parabola horizontally and appears twice in the formula: once as −b in the numerator and once inside the discriminant as b². Because it is squared there, the discriminant is unaffected by the sign of b even though the roots are not.
c Constant term — form field “c (constant)”
The term with no x. It is the y-intercept of the parabola, since substituting x = 0 leaves exactly c. Its sign relative to a largely determines whether real roots exist at all.
Δ Discriminant
The derived quantity b² − 4ac. It is not an input — the solver computes it — but it is the number to read first, because it classifies the roots before any square root is taken.

Worked examples

Every number below is produced by the same calculation engine the tool above runs. Nothing here is typed by hand, so the walkthrough cannot drift from what you get when you enter the same values yourself.

A quadratic that factors cleanly

Take x² − 3x + 2 = 0, the kind of equation that appears early in an algebra course because it is designed to factor into (x − 1)(x − 2). Working it with the formula shows that the formula and the factoring agree, which is worth seeing once.

Inputs a (x² coefficient) = 1, b (x coefficient) = -3, c (constant) = 2

  1. Equation 1x² − 3x + 2 = 0
  2. Vertex (h, k) = (−b/2a, c − b²/4a) = (1.5, -0.25)
  3. Axis of symmetry x = 1.5
  4. Discriminant Δ = b² − 4ac = (-3)² − 4·1·2 = 1
  5. Formula x = (−b ± √Δ) / (2a)
  6. x₁ (−(-3) + √1) / (2·1) = 2
  7. x₂ (−(-3) − √1) / (2·1) = 1

Result x₁ = 2, x₂ = 1

The discriminant is positive and, more usefully, a perfect square. That is the structural reason this equation factors over the integers: a perfect-square discriminant means the square root is rational, so the two roots come out as whole numbers or simple fractions. When you are hunting for factors by inspection and getting nowhere, computing the discriminant first tells you whether integer factors exist at all before you waste time looking.

Notice that the vertex sits midway between the two roots. That is not a coincidence of this example — a parabola is symmetric about its axis, so whenever there are two real roots the axis of symmetry lies exactly halfway between them. It is a useful arithmetic check: average the roots, and you should get the vertex x-coordinate.

A repeated root, where the discriminant is zero

Now x² − 4x + 4 = 0. This is the boundary case between two real roots and none, and it is where the plus-or-minus in the formula stops doing any work.

Inputs a (x² coefficient) = 1, b (x coefficient) = -4, c (constant) = 4

  1. Equation 1x² − 4x + 4 = 0
  2. Vertex (h, k) = (−b/2a, c − b²/4a) = (2, 0)
  3. Axis of symmetry x = 2
  4. Discriminant Δ = b² − 4ac = (-4)² − 4·1·4 = 0
  5. One real root Δ = 0 → x = −b / (2a) = 2

Result x = 2 (double root)

With the discriminant at zero the square root contributes nothing, so adding and subtracting it give the same value and the two roots collapse into one. The parabola does not cross the x-axis here — it touches it and turns back, which is why the root coincides exactly with the vertex.

Textbooks call this a repeated root or a root of multiplicity two, and the distinction matters beyond terminology. The expression factors as (x − 2)², so the factor appears twice; in calculus, that repetition is what makes the curve tangent to the axis rather than crossing it, and the derivative vanishes at the same point.

Complex roots, where the parabola never meets the axis

Finally x² + 2x + 5 = 0. Nothing about the coefficients looks unusual, but this equation has no real solution at all.

Inputs a (x² coefficient) = 1, b (x coefficient) = 2, c (constant) = 5

  1. Equation 1x² + 2x + 5 = 0
  2. Vertex (h, k) = (−b/2a, c − b²/4a) = (-1, 4)
  3. Axis of symmetry x = -1
  4. Discriminant Δ = b² − 4ac = (2)² − 4·1·5 = -16
  5. Complex roots Δ < 0 → two complex conjugate roots
  6. x (−b ± √Δ) / 2a = -1 ± 2i

Result x = -1 ± 2i

The discriminant is negative, so the square root is of a negative number and the roots are complex. They arrive as a conjugate pair — identical real parts, equal and opposite imaginary parts — which is always the case when the coefficients themselves are real. You never get one complex root on its own.

Geometrically the parabola opens upward and its vertex sits above the x-axis, so the curve never reaches zero. If you are solving a problem where only real answers are meaningful, such as a length or an elapsed time, a negative discriminant is the signal that the model has no valid solution rather than that the arithmetic went wrong.

Reading the result

The discriminant, read first

A positive discriminant means two distinct real roots and a parabola that crosses the x-axis twice. Zero means one repeated real root and a parabola tangent to the axis. Negative means a complex conjugate pair and a curve that never touches the axis. Reading this line before the roots turns the rest of the output from a list of numbers into a confirmation of something you already expected.

The roots

The roots are the x-values that make the expression zero — the x-intercepts of the parabola. The solver labels them x₁ and x₂, with x₁ taken from the plus branch of the formula. That ordering is a convention of this tool, not a mathematical property: the two roots are interchangeable, and swapping their labels changes nothing.

Real roots are reported as decimals rounded to six significant figures, which is enough to absorb floating-point noise without hiding genuine precision. If a root looks like it should be exact, such as 0.333333, the underlying value is the true fraction and the display is the rounding.

The vertex

The vertex is the turning point, at x = −b/2a with the corresponding y-value. When a is positive it is the minimum of the function; when a is negative it is the maximum. In applied problems this is usually the number you actually want — the peak height, the lowest cost, the optimal price — rather than the roots.

The axis of symmetry

The axis of symmetry is the vertical line through the vertex, written x = −b/2a. Every parabola is mirror-symmetric about it. Practically, it means that if you know one root and the axis, you get the other root for free by reflecting across it, and that the vertex x-coordinate is always the average of the two roots when both are real.

When you would use this

Projectile and free-fall problems

Height under constant gravity is quadratic in time, so questions like when an object lands or how high it rises are quadratic questions. The positive root is usually the landing time and the negative root is discarded as physically meaningless; the vertex gives the maximum height and the moment it occurs.

Optimisation with a single variable

Revenue models where price affects quantity sold are frequently quadratic, because multiplying a linear demand curve by price produces a squared term. The vertex, not the roots, is the answer to such problems: it gives the price that maximises revenue. The roots tell you where revenue falls to zero, which is rarely the interesting question.

Geometry and area constraints

Fixing a perimeter and asking for a given area produces a quadratic in one side length. Here the discriminant earns its keep as a feasibility test: if it is negative, no rectangle with that perimeter achieves that area, and the problem has no solution rather than an awkward one. A zero discriminant identifies the single extreme case, which for a fixed perimeter is the square.

Assumptions and limitations

What this calculator assumes

  • The equation is written in standard form ax² + bx + c = 0, with every term moved to one side.
  • The leading coefficient a is non-zero. When a is zero the equation is linear and the quadratic formula does not apply, because the 2a denominator would be zero.
  • The coefficients are real numbers. The roots may be complex, but the inputs are assumed not to be.
  • The coefficients are exact as entered. If they are themselves rounded measurements, the roots inherit that uncertainty, and the solver has no way to know it.
  • Arithmetic is done in IEEE-754 double precision, the standard for numeric computing, and results are rounded for display only after the computation is complete.

Where it stops being the right tool

  • Only second-degree equations are handled. Cubics, quartics and higher polynomials need different methods and a different tool.
  • Roots are reported numerically rather than symbolically. An irrational root is shown as a decimal, not in surd form such as (3 + √5)/2.
  • Very large or very small coefficients can lose precision. When b² is enormous compared with 4ac, the subtraction inside the discriminant cancels most of the significant digits — a well-documented numerical effect known as catastrophic cancellation, not a bug in the arithmetic.
  • The tool solves for x only. It does not rearrange a formula to make a different symbol the subject, and it does not accept an equation typed as text.
  • Systems of equations, inequalities, and quadratics in two variables are out of scope; a quadratic inequality has a solution interval rather than a pair of roots.

Common mistakes

Dropping the sign of b

Why it happens. The formula opens with −b, so a negative b produces a double negative. Reading b as 3 instead of −3 in x² − 3x + 2 = 0 flips the sign of both roots, and the result still looks plausible enough to go unnoticed.

How to avoid it. Write the equation out with explicit signs before entering anything, and treat the minus as part of the number rather than as an operator sitting between terms.

Forgetting to set the equation to zero first

Why it happens. The derivation of the formula assumes one side is zero. Reading coefficients straight off 2x² + 5 = 7x gives b = 0 and c = 5, when the correct values after rearranging are b = −7 and c = 5.

How to avoid it. Always rearrange to standard form as a separate step, and only then read off the three coefficients.

Squaring a negative b incorrectly

Why it happens. In the discriminant, b² is always positive regardless of the sign of b. Writing −3² as −9 instead of 9 is an order-of-operations slip that flips the discriminant's sign and turns two real roots into a spurious complex pair.

How to avoid it. Bracket the coefficient before squaring it: compute (−3)², not −3². The solver's discriminant line shows the substitution with brackets so you can compare directly.

Dividing only part of the numerator by 2a

Why it happens. The whole numerator −b ± √Δ is divided by 2a, but written on one line it is easy to apply the division to the square root alone. This yields an answer that is wrong by exactly the −b/2a term.

How to avoid it. Compute the full numerator first, then divide. If the average of your two roots is not the vertex x-coordinate, this is almost certainly the error.

Sources and further reading

Key terms

Frequently asked questions

What does the discriminant tell me?

It is Δ = b² − 4ac, and its sign classifies the roots before you compute them. Positive gives two distinct real roots, zero gives one repeated real root, and negative gives a complex conjugate pair. If it is a perfect square, the roots are rational and the quadratic factors over the integers.

Why does the solver reject a leading coefficient of zero?

With a = 0 the x² term disappears and the equation is linear, not quadratic. The quadratic formula divides by 2a, so a zero would mean dividing by zero. Solve bx + c = 0 directly instead, which gives the single root x = −c/b.

Does it find the vertex and axis of symmetry?

Yes, both are reported alongside the roots. The vertex is at x = −b/2a with the matching y-value, and the axis of symmetry is the vertical line through it. When two real roots exist, the vertex x-coordinate is exactly their average.

Can it handle complex roots?

Yes. When the discriminant is negative the solver reports the roots as a conjugate pair in the form p ± qi rather than declaring the equation unsolvable. Because the coefficients are real, complex roots always come in conjugate pairs.

Are the roots exact or approximate?

The arithmetic is done in double precision and the display is rounded to six significant figures. Rational roots such as 2 or 0.5 are exact. Irrational roots are shown as decimals rather than in surd form, so (3 + √5)/2 appears as its decimal value.

Why do my hand-worked roots differ in the last digit?

Almost always because of when rounding happened. The solver rounds once, at the end; rounding the discriminant or the square root partway through and then continuing will shift the final digits. Compare the intermediate steps to find where the two calculations part company.