How to Solve Quadratic Equations: Three Methods
Every quadratic equation can be solved by factoring, completing the square, or the quadratic formula. All three give the same answers, but each is easiest for a different kind of equation, and knowing which to reach for saves time and mistakes.
Last updated:
What makes an equation quadratic
A quadratic equation is one in which the highest power of the unknown is 2. It can always be rearranged into the standard form ax² + bx + c = 0 with a ≠ 0. If a were 0, the x² term would vanish and you would be left with the linear equation bx + c = 0, which has the single solution x = −c ÷ b (or no solution, or every number, when b is also 0).
A quadratic has at most two solutions, also called roots. Quadratics appear whenever two unknown quantities are multiplied together. For example, suppose a rectangle has a perimeter of 20 cm and an area of 21 cm². If one side is x, the other is 10 − x, so x(10 − x) = 21, which rearranges to x² − 10x + 21 = 0. Areas, projectile heights and break-even problems all lead to equations of this shape.
Method 1: factoring
If you can rewrite the left side as (x − p)(x − q), the zero product property finishes the job: a product is zero only when one of its factors is zero, so x = p or x = q. When it works, factoring is the fastest method.
For x² − 5x + 6 = 0, look for two numbers that multiply to 6 and add to −5. Those are −2 and −3, so (x − 2)(x − 3) = 0 and the roots are x = 2 and x = 3. The rectangle equation x² − 10x + 21 = 0 factors as (x − 3)(x − 7) = 0, so the rectangle is 3 cm by 7 cm.
Many quadratics do not factor neatly over the integers. If a minute of trial and error turns up nothing, switch methods instead of forcing it.
Method 2: completing the square
Completing the square rewrites the equation as (x + m)² = k, after which you take square roots of both sides. The trick is to add and subtract the square of half the x coefficient.
Take x² + 6x + 2 = 0. Half of 6 is 3, and 3² = 9, so write x² + 6x + 9 − 9 + 2 = 0, which is (x + 3)² = 7. Then x + 3 = ±√7, giving x = −3 ± √7, or about −0.354 and −5.646.
The same move reveals the vertex of a parabola. The function y = x² − 5x + 6 can be written as y = (x − 2.5)² − 0.25, so its lowest point is at (2.5, −0.25). That connection between the algebra and the graph is the main reason completing the square is worth learning even if you usually use the formula.
Method 3: the quadratic formula
Completing the square on the general equation ax² + bx + c = 0 produces the quadratic formula: x = (−b ± √(b² − 4ac)) ÷ 2a. It always works, which makes it the method of choice for awkward coefficients, decimals, or equations that refuse to factor.
For 2x² − 4x − 3 = 0, a = 2, b = −4 and c = −3. Then b² − 4ac = 16 + 24 = 40, so x = (4 ± √40) ÷ 4 = 1 ± √10 ÷ 2, roughly 2.581 and −0.581. The most common slip is the sign of b: here −b is +4, not −4.
A quick way to check your answers is Vieta's formulas. The two roots always add up to −b ÷ a and multiply to c ÷ a. In this example the sum should be 2 and the product −1.5, and 2.581 + (−0.581) = 2 and 2.581 × (−0.581) ≈ −1.5 confirm it.
- Quadratic formula: x = (−b ± √(b² − 4ac)) ÷ 2a
- Sum of roots = −b ÷ a; product of roots = c ÷ a
The discriminant tells you what kind of roots to expect
The expression under the square root, D = b² − 4ac, is called the discriminant. Its sign tells you what the solutions look like before you compute them.
If D > 0 there are two different real roots; x² − 5x + 6 = 0 has D = 1. If D = 0 the two roots coincide in a single repeated (double) root; x² − 6x + 9 = 0 has D = 0 and the only solution is x = 3. If D < 0 there is no real solution, because no real number squares to a negative value.
Negative discriminants still have answers once you allow the imaginary unit i, defined by i² = −1. For x² + 2x + 5 = 0, D = 4 − 20 = −16 and √(−16) = 4i, so x = (−2 ± 4i) ÷ 2 = −1 ± 2i. Roots like these, with the same real part and opposite imaginary parts, are called complex conjugates, and a quadratic with real coefficients always produces them in pairs.
Ignoring air resistance, a ball thrown straight up from the ground at 19.6 m/s is at height h = 19.6t − 4.9t² meters after t seconds. When is it 14.7 m above the ground? Setting 19.6t − 4.9t² = 14.7 and dividing through by 4.9 gives t² − 4t + 3 = 0, which factors as (t − 1)(t − 3) = 0. The ball passes 14.7 m twice: at 1 second on the way up and at 3 seconds on the way down. The discriminant is 4, which is positive.
Ask about 19.6 m instead and you get t² − 4t + 4 = 0, with D = 0 and the single root t = 2. That is the instant the ball reaches its peak, so it is at that height exactly once. Ask about 24.5 m and you get t² − 4t + 5 = 0, with D = −4. There is no real solution, which simply means the ball never gets that high. In applied problems the three discriminant cases translate directly into twice, once, or never.
- D > 0: two distinct real roots
- D = 0: one repeated real root
- D < 0: no real roots; two complex conjugate roots
Seeing the roots on the parabola
The real roots of ax² + bx + c = 0 are the x-coordinates where the parabola y = ax² + bx + c crosses the x-axis. A positive discriminant means two crossings, zero means the vertex just touches the axis, and a negative discriminant means the parabola floats entirely above or below it. The axis of symmetry is the vertical line x = −b ÷ 2a, and the two real roots always sit the same distance on either side of it.
The quadratic equation calculator takes a, b and c, classifies the roots using the discriminant, and shows real, repeated or complex solutions along with the vertex, axis of symmetry and a graph of the parabola. Comparing the graph with your hand calculation is a good way to catch sign errors. If a is 0 the equation is not quadratic, so use the linear equation calculator instead.