Lelifi·tools

Quadratic Equation Calculator

x = (-b +/- sqrt(b^2 - 4ac)) / 2a gives both roots of a quadratic equation. It shows the discriminant, both roots including complex ones, the vertex, the sum and product of the roots and the factored form, and it switches to a linear solve when a is zero.

Enter a, b and c for ax^2 + bx + c = 0. Negative numbers and decimals are fine, and a = 0 is handled as a straight line.

Enter a, b and c to solve ax² + bx + c = 0 and see its roots, discriminant, vertex, factored form, and checks.

By the Lelifi editors ·

Key takeaways

-2-11234-8-6-4-224(-1, 0)(3, 0)vertex (1, -8)y = 2x^2 - 4x - 6 crosses the x axis at -1 and 3The vertex sits halfway between the roots, at x = 1
The parabola for 2x^2 - 4x - 6 crosses the x axis at -1 and 3, and its vertex sits at (1, -8).
The same numbers the calculator runsa = 2, b = -4, c = -6D = b^2 - 4ac = 16 + 48 = 64sqrt(64) = 8, so 2a = 4x = (4 + 8) / 4 = 3x = (4 - 8) / 4 = -1= check: 3 + (-1) = 2 and 3 x (-1) = -3Sum of roots -b/a = 2, product c/a = -3, both match.
The same five steps the calculator prints, with the sum and product checks that confirm both roots.
On this page
  1. What a quadratic equation means
  2. Worked example: 2x^2 - 4x - 6 = 0
  3. Completing the square on a messy leading coefficient
  4. Choosing between factoring, the formula, and completing the square
  5. The discriminant predicts the roots
  6. Vertex, symmetry, and word problems
  7. Checks and common mistakes
  8. A compact reference for each coefficient

What a quadratic equation means

A quadratic equation has the form ax2 + bx + c = 0, where a is not zero. The highest power is 2, so its graph is a parabola rather than a straight line. The coefficients control the shape and position: a changes the opening and width, b shifts the balance of the terms, and c is the y-intercept. The quadratic formula works even when the roots are awkward fractions or decimals, so you do not need to guess factors.

The formula is x = (-b ± √(b2 - 4ac)) / (2a). The expression inside the square root is the discriminant, D. This page follows the usual real-number convention and also reports complex roots when D is negative. Entering a = 0 is handled separately because the equation has then become linear.

The current 2026 edition of OpenStax College Algebra 2e covers quadratic equations, factoring, completing the square, and the formula in one section. The OpenStax quadratic equations reference is useful when you want the derivation behind the calculator.

Worked example: 2x^2 - 4x - 6 = 0

Take a = 2, b = -4, and c = -6. The discriminant is D = (-4)2 - 4(2)(-6) = 16 + 48 = 64. Since the square root of 64 is 8, the two roots are x = (4 + 8) / 4 = 3 and x = (4 - 8) / 4 = -1. The equation therefore factors as 2(x - 3)(x + 1) = 0.

The vertex provides a second view. Its x-coordinate is -b/(2a) = 4/4 = 1. Substituting 1 gives y = 2(1)2 - 4(1) - 6 = -8, so the vertex is (1, -8). The axis of symmetry is x = 1, exactly halfway between -1 and 3. Vieta's rules provide a fast check: the root sum is -b/a = 2, while 3 + (-1) = 2; the product is c/a = -3, while 3(-1) = -3.

Substitution closes the check. At x = 3, 2(9) - 12 - 6 = 0. At x = -1, 2(1) + 4 - 6 = 0. If rounding makes a check look like 0.000001 instead of 0, the displayed roots were rounded while the internal calculation retains more digits.

Completing the square on a messy leading coefficient

Completing the square is the route that produces the quadratic formula, and it still earns its keep when you want vertex form or a hand solution with clean halves. Take 3x2 - 12x + 7 = 0, where the leading 3 blocks a direct square. Divide every term by 3 to get x2 - 4x + 7/3 = 0, then move the constant: x2 - 4x = -7/3. Half of -4 is -2, and squaring it gives 4, so add 4 to both sides and the left side folds into a single square.

StepExpressionWhat changed
13x2 - 12x + 7 = 0a = 3, so divide through by 3
2x2 - 4x = -7/3constant moved to the right side
3(x - 2)2 = 4 - 7/3 = 5/3half of -4 squared is 4
4x = 2 +/- sqrt(5/3)sqrt(5/3) is about 1.291
5x = 3.291 or x = 0.709rounded to three decimals

The formula agrees. For the same equation, D = 144 - 84 = 60, and (12 +/- sqrt(60)) / 6 gives 3.291 and 0.709. Substitution confirms both: 3(3.291)2 - 12(3.291) + 7 = 0 to within rounding, and the same holds at 0.709. The steps also hand you the vertex form for free: 3(x - 2)2 - 5 expands back to 3x2 - 12x + 7, since at x = 0 it gives 12 - 5 = 7 and at x = 1 it gives 3 - 5 = -2, both matching the original coefficients. The vertex is therefore (2, -5).

Choosing between factoring, the formula, and completing the square

Three methods solve the same equation, and the fastest one depends on the coefficients. Factoring wins when the roots are rational, because two seconds of inspection beats a square root. The formula always works and handles irrational or complex roots without complaint. Completing the square earns its place when vertex form is the goal, as in graphing or optimization problems, since it rewrites the equation as a(x - h)2 + k in a few moves.

MethodBest when, with a worked case
FactoringRoots are rational integers; x2 - 5x + 6 = (x - 2)(x - 3) gives 2 and 3 on sight
Quadratic formulaAny coefficients; x2 - 2x - 1 = 0 has D = 8, so the roots are 1 +/- sqrt(2), about 2.414 and -0.414
Completing the squareVertex form is the target; 3x2 - 12x + 7 becomes 3(x - 2)2 - 5 with vertex (2, -5)

A practical order: try a quick factor check first, since integer roots near the factors of c show up often in coursework. If nothing appears within a minute, run the formula; it cannot fail while a is nonzero. Switch to completing the square when the question asks for a maximum, a minimum, or a graph's turning point, because the vertex falls out of the rewrite without extra work. The calculator mirrors this workflow by printing the factored form when the roots are rational and the vertex and discriminant in every case, so you can compare methods on the same numbers instead of trusting one path.

The discriminant predicts the roots

D is more than an intermediate number. When D is positive, the parabola crosses the x-axis twice and the calculator returns two different real roots. When D is zero, it touches the axis once and the repeated root is -b/(2a). When D is negative, the graph has no real x-intercept; the conjugate complex roots have real part -b/(2a) and imaginary part √(-D)/(2a).

DiscriminantRootsGraph meaningExample
D > 0Two real rootsCrosses x-axis twicex2 - 5x + 6: D = 1
D = 0One repeated real rootTouches x-axisx2 - 4x + 4: D = 0
D < 0Two complex rootsNo real crossingx2 + 4x + 8: D = -16

For the last example, the roots are -2 + 2i and -2 - 2i. Complex answers are not a calculator failure. They say that no real number makes the polynomial equal zero. NIST's Digital Library of Mathematical Functions section on polynomial zeros gives broader reference material on roots and polynomial methods.

Vertex, symmetry, and word problems

For y = ax2 + bx + c, the vertex is (h, k), where h = -b/(2a) and k is found by substituting h into the equation. If a is positive, the vertex is the minimum; if a is negative, it is the maximum. The line x = h splits the parabola into two matching halves. These features matter in applications because a root can represent a time, distance, or break-even point, while the vertex often represents the best or worst value.

Suppose a toy rocket's height in feet is h(t) = -16t2 + 64t + 5. The launch height is 5 feet, and the coefficient -16 makes the path open downward. The landing time solves -16t2 + 64t + 5 = 0. The positive root is about 4.08 seconds; the negative root describes the mathematical extension before launch and is not a physical time. The vertex occurs at t = 2 seconds and height 69 feet. NASA's ballistic flight equations explain the ideal assumptions behind projectile models.

For a business example, profit P(x) = -2x2 + 80x - 300 has break-even roots when P is zero. Its vertex is at x = 20 and P = 500, so the model's highest profit is 500 currency units at 20 items, before checking whether the model is realistic over that sales range.

The calculator also runs the problem backwards. Give it a vertex and one point on the curve: with vertex (2, -3) and the point (0, 2), the opening value p works out to 1, so the equation is y = (x - 2)^2 - 3 = x^2 - 4x + 1, whose y-intercept is 1 and whose discriminant is 12.

Checks and common mistakes

First copy every term into standard form. An equation such as 3x2 = 7x - 2 becomes 3x2 - 7x + 2 = 0, so b is -7, not 7. Second, keep the entire b in b2: if b = -4, then b2 = 16. Third, use 2a as the whole denominator. Dividing by a before applying the plus and minus branches changes both roots.

The calculator displays the discriminant, root sum, product, vertex, factor form when real, and a substitution check. Those independent views make a sign error easier to spot than a single answer would.

A compact reference for each coefficient

OutputFormulaUse
DiscriminantD = b2 - 4acCounts real roots
Roots(-b ± √D)/(2a)Solves for x
Vertex x-b/(2a)Finds symmetry line
Vertex yf(-b/(2a))Finds maximum or minimum
Root sum-b/aVieta check
Root productc/aVieta check

These formulas describe one equation from several angles. For 6x2 + x - 2 = 0, D = 49, the roots are 1/2 and -2/3, their sum is -1/6, and their product is -1/3. The decimals shown by the widget are presentation values, not a replacement for exact fractions when a homework or proof requires them.

All calculations run in your browser, and nothing you type is uploaded or stored. For additional algebra practice, the site's exponent calculator, average calculator, and percentage calculator cover nearby operations.

Frequently asked questions

How do I solve a quadratic equation?

Write it in standard form ax^2 + bx + c = 0, read off a, b and c, then use x = (-b +/- sqrt(D)) / 2a. For 2x^2 - 4x - 6 = 0 the roots are 3 and -1.

What does the discriminant tell me?

D = b^2 - 4ac counts the real roots. D above 0 gives two, D equal to 0 gives one repeated root, and D below 0 gives complex roots. For x^2 + 4x + 8, D = 16 - 32 = -16.

How many real roots can a quadratic equation have?

At most two. A parabola can cross the x axis twice, touch it once, or miss it. x^2 - 4x + 4 has the single root x = 2.

How do I find the vertex of a parabola?

Compute h = -b/(2a), then k = f(h). For y = 2x^2 - 4x - 6, h = 1 and k = -8, so the vertex is (1, -8) and the axis is x = 1.

What is the Vieta check?

The roots must add to -b/a and multiply to c/a. For 2x^2 - 4x - 6, the sum is 2 and the product is -3, and 3 + (-1) = 2 while 3 x (-1) = -3.

What happens when a is zero?

The equation is linear, so the quadratic formula does not apply. For 4x - 8 = 0 the solution is x = 2, and the calculator handles that case separately.

How do I build an equation from a vertex and a point?

Start from y = a(x - h)^2 + k and use the point to find a. With vertex (2, -3) and the point (0, 2), the result is y = (x - 2)^2 - 3 = x^2 - 4x + 1.

What do complex roots look like?

For x^2 + 4x + 8 they are x = -2 + 2i and x = -2 - 2i. The real part is -b/(2a) and the imaginary part is sqrt(-D)/(2a).

Why do my roots fail the check by a tiny amount?

The displayed values are rounded. Substitute with more digits, or trust the residual the calculator reports, which is computed before rounding.

When can I factor a quadratic instead?

When the roots are rational. Because 2x^2 - 4x - 6 has roots 3 and -1, it factors as 2(x - 3)(x + 1). Irrational or complex roots leave no tidy factors.

Are roots, zeros and x-intercepts the same thing?

Yes, all three name the x values where the polynomial equals zero. The y-intercept is different: for 6x^2 + x - 2 it is the constant term -2.

When is a quadratic model useful?

For projectile heights and area problems. The model h(t) = -16t^2 + 64t + 5 lands after about 4.08 seconds and peaks at 69 feet at t = 2 seconds.

Spotted a wrong number or a broken result?

More Math tools

See all Math tools

Fee schedules, rates and rules change without notice. Always confirm important figures with the official source before you rely on them.