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.
| Equation | |
| Discriminant | |
| Kind of roots | |
| First root | |
| Second root | |
| Vertex | |
| Axis of symmetry | |
| Sum of roots | |
| Product of roots | |
| Factored form | |
| Check | |
| y-intercept |
All calculations run in your browser, and nothing you type is uploaded or stored.
Enter a, b and c to solve ax² + bx + c = 0 and see its roots, discriminant, vertex, factored form, and checks.
Key takeaways
- For 2x^2 - 4x - 6 = 0 the discriminant is 64 and the roots are 3 and -1
- A negative discriminant means no real roots: x^2 + 2x + 5 = 0 gives -1 + 2i and -1 - 2i
- The vertex is at x = -b / 2a, which is 1 for this equation, with height -8
- The roots always sum to -b / a and multiply to c / a, so 3 + (-1) = 2 and 3 x (-1) = -3
- A projectile launched at 40 ft/s from 3 ft lands after 2.57 seconds, and the negative root is discarded
On this page
- What a quadratic equation means
- Worked example: 2x^2 - 4x - 6 = 0
- Completing the square on a messy leading coefficient
- Choosing between factoring, the formula, and completing the square
- The discriminant predicts the roots
- Vertex, symmetry, and word problems
- Checks and common mistakes
- 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.
| Step | Expression | What changed |
|---|---|---|
| 1 | 3x2 - 12x + 7 = 0 | a = 3, so divide through by 3 |
| 2 | x2 - 4x = -7/3 | constant moved to the right side |
| 3 | (x - 2)2 = 4 - 7/3 = 5/3 | half of -4 squared is 4 |
| 4 | x = 2 +/- sqrt(5/3) | sqrt(5/3) is about 1.291 |
| 5 | x = 3.291 or x = 0.709 | rounded 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.
| Method | Best when, with a worked case |
|---|---|
| Factoring | Roots are rational integers; x2 - 5x + 6 = (x - 2)(x - 3) gives 2 and 3 on sight |
| Quadratic formula | Any coefficients; x2 - 2x - 1 = 0 has D = 8, so the roots are 1 +/- sqrt(2), about 2.414 and -0.414 |
| Completing the square | Vertex 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).
| Discriminant | Roots | Graph meaning | Example |
|---|---|---|---|
| D > 0 | Two real roots | Crosses x-axis twice | x2 - 5x + 6: D = 1 |
| D = 0 | One repeated real root | Touches x-axis | x2 - 4x + 4: D = 0 |
| D < 0 | Two complex roots | No real crossing | x2 + 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.
- Do not use the quadratic formula when a is zero without switching to the linear equation.
- Do not discard a negative root before checking what the variable means in the word problem.
- Do not round the discriminant before taking its square root.
- Use the vertex formula with the original a and b, including their signs.
- Substitute each displayed root back into ax2 + bx + c and inspect the residual.
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
| Output | Formula | Use |
|---|---|---|
| Discriminant | D = b2 - 4ac | Counts real roots |
| Roots | (-b ± √D)/(2a) | Solves for x |
| Vertex x | -b/(2a) | Finds symmetry line |
| Vertex y | f(-b/(2a)) | Finds maximum or minimum |
| Root sum | -b/a | Vieta check |
| Root product | c/a | Vieta 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
Fee schedules, rates and rules change without notice. Always confirm important figures with the official source before you rely on them.