Quadratic Equation Solver
Solve any quadratic equation ax² + bx + c = 0 using the quadratic formula. Finds real and complex roots.
Did this tool work for you?
How to use this calculator
The discriminant b²−4ac determines the nature of roots: positive = two real roots, zero = one repeated root, negative = two complex roots.
- 1
Enter the coefficient a (of x²), b (of x), and c (constant).
- 2
For example, x² − 5x + 6 = 0 uses a=1, b=−5, c=6.
- 3
The calculator applies the quadratic formula and shows roots.
- 4
A negative discriminant means the roots are complex (imaginary).
Frequently asked questions
What is the quadratic formula?
For ax² + bx + c = 0 with a ≠ 0, the solutions are x = (−b ± √(b² − 4ac)) ÷ 2a. The expression under the square root, b² − 4ac, is the discriminant. It tells you what kind of roots to expect before you finish the calculation.
What does the discriminant tell me?
If it is positive there are two distinct real roots, the parabola crosses the x-axis twice. If it is zero there is one repeated real root and the parabola just touches the axis. If it is negative there are no real roots and the solutions are a pair of complex conjugates. For x² − 5x + 6 the discriminant is 1, for x² − 4x + 4 it is 0, and for x² + 2x + 5 it is −16.
What if a = 0?
Then the equation is linear, not quadratic, and has a single solution x = −c ÷ b. The solver reports an error for a = 0 because the quadratic formula would divide by zero.
What are complex roots and when do I need them?
When the discriminant is negative the roots take the form p ± qi, where i is the square root of −1. For x² + 2x + 5 = 0 they are −1 + 2i and −1 − 2i. In a physics or geometry problem that asks only for real solutions, a negative discriminant means no real answer exists. In algebra, electrical engineering and signal processing the complex pair is the answer.
How can I check my answer?
Use Vieta’s formulas. The roots add up to −b ÷ a and multiply to c ÷ a. For x² − 5x + 6, the roots 2 and 3 sum to 5 and multiply to 6, matching −(−5) ÷ 1 and 6 ÷ 1. You can also substitute each root back into the equation and confirm it gives zero.
How do I find the vertex and the axis of symmetry?
The axis of symmetry is x = −b ÷ 2a, exactly halfway between the roots. Substitute that x into the equation to get the y-coordinate of the vertex. If a is positive the vertex is the minimum of the parabola, and if a is negative it is the maximum.
Can I solve an equation that is not in standard form?
Move every term to one side first. For 2x² = 3x − 1, subtract 3x and add 1 to get 2x² − 3x + 1 = 0, so a = 2, b = −3 and c = 1. The solver then gives x = 1 and x = 0.5.
Quadratic equation solver — real and complex roots, discriminant and steps
How the solver works
Enter the coefficients a, b and c of ax² + bx + c = 0. The solver computes the discriminant D = b² − 4ac and then the two roots x = (−b ± √D) ÷ 2a. It classifies the result as two real roots, one repeated root or a complex conjugate pair, and shows the discriminant so you can see why. Results are rounded to six decimal places.
Worked examples for each case
The discriminant decides the kind of answer. Each row below was run through the solver.
| Equation | a, b, c | Discriminant | Roots |
|---|---|---|---|
| x² − 5x + 6 = 0 | 1, −5, 6 | 1 | 3 and 2 |
| 2x² − 3x + 1 = 0 | 2, −3, 1 | 1 | 1 and 0.5 |
| x² − 4x + 4 = 0 | 1, −4, 4 | 0 | 2 (repeated) |
| x² + 2x + 5 = 0 | 1, 2, 5 | −16 | −1 + 2i and −1 − 2i |
A real-world example: when does a thrown ball land?
A ball launched upward from an 80-foot ledge at 64 feet per second has height h = −16t² + 64t + 80 feet after t seconds. It lands when h = 0, so solve −16t² + 64t + 80 = 0 with a = −16, b = 64 and c = 80. The discriminant is 9,216 and the roots are t = −1 and t = 5. A negative time makes no physical sense, so the ball lands after 5 seconds. The vertex is at t = −b ÷ 2a = 2 seconds, which is the moment of greatest height.
Factoring, completing the square or the formula?
Factoring is quickest when the roots are whole numbers, such as x² − 5x + 6 = (x − 2)(x − 3). Completing the square gives the vertex form y = a(x − h)² + k directly and is how the quadratic formula is derived. The quadratic formula works for every quadratic, including those with fractions, irrational roots or complex roots, which is why a solver uses it.
Common mistakes
Forgetting that a, b and c include their signs is the most common error: in x² − 5x + 6 the coefficient b is −5, not 5. Dividing only part of the numerator by 2a is another. Check that the equation equals zero before reading off the coefficients, and use the sum and product check to catch slips.
Learn more from an authoritative source:
WikipediaPrime Number Checker
Check if a number is prime and find all prime factors. Also lists the nearest primes above and below.
GCD & LCM Calculator
Calculate the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of two or three numbers.
Factorial Calculator
Calculate the factorial of any non-negative integer. Also computes permutations (nPr) and combinations (nCr).
Triangle Calculator
Calculate the area, perimeter, angles, and height of a triangle from three sides using Heron's formula.
Circle Calculator
Calculate the area, circumference, diameter, and arc length of a circle from radius, diameter, or circumference.
Pythagorean Theorem Calculator
Calculate any side of a right triangle using the Pythagorean theorem. Solve for hypotenuse or either leg.
Results are estimates for informational purposes only and do not constitute professional financial, medical, legal, or technical advice. Read full disclaimer →