How to solve a quadratic equation
A quadratic equation has the form ax² + bx + c = 0, and there are three reliable ways to solve it. Here is factoring, completing the square and the quadratic formula, when to use each, worked examples, and how the discriminant tells you how many real solutions to expect.
Solve ax² + bx + c = 0 for its roots, real or complex.
A quadratic equation is any equation that can be written in the form ax² + bx + c = 0, where a, b and c are numbers and a is not zero. The x² term is what makes it quadratic, and it is why a quadratic can have two solutions, one, or none in the real numbers. There are three reliable ways to solve one: factoring, completing the square, and the quadratic formula. This guide shows all three, when to reach for each, worked examples, and how the discriminant tells you in advance how many solutions to expect. The first move is always the same: rearrange the equation so one side is zero and you can read off a, b and c.
First, identify a, b and c
Before any method, get the equation into standard form ax² + bx + c = 0, with everything on one side and zero on the other. For example, x² + 5x = −6 becomes x² + 5x + 6 = 0, which gives a = 1, b = 5, c = 6. Keep the signs with the numbers: in x² − 3x − 10 = 0, b is −3 and c is −10. A dropped minus sign on b or c is the single most common source of wrong answers, so check the signs before you solve.
Method 1: solve a quadratic equation by factoring (fastest when it works)
Factoring rewrites the quadratic as two brackets multiplied together, then uses the fact that if two things multiply to zero, at least one of them must be zero. Take x² − 5x + 6 = 0. You want two numbers that multiply to c (6) and add to b (−5): those are −2 and −3. So it factors to (x − 2)(x − 3) = 0, which means x − 2 = 0 or x − 3 = 0, giving x = 2 or x = 3.
Factoring is the quickest method when the numbers are friendly, but not every quadratic factors neatly with whole numbers. If you cannot spot the pair in a few seconds, do not force it: switch to the formula, which always works.
Method 2: the quadratic formula (always works)
The quadratic formula solves any quadratic once it is in standard form:
x = ( −b ± √(b² − 4ac) ) ÷ (2a)
The ± sign is why you usually get two answers: one using plus, one using minus. Worked example on 2x² + 3x − 2 = 0, so a = 2, b = 3, c = −2. First the part under the root: b² − 4ac = 3² − 4(2)(−2) = 9 + 16 = 25. Its square root is 5. Then x = (−3 ± 5) ÷ (2 × 2) = (−3 ± 5) ÷ 4. The plus gives (−3 + 5) ÷ 4 = 2 ÷ 4 = 0.5; the minus gives (−3 − 5) ÷ 4 = −8 ÷ 4 = −2. So x = 0.5 or x = −2.
Watch the signs, especially the −4ac part when c is negative (two minuses made +16 above), and remember the whole −b is divided by 2a, not just part of it.
Method 3: completing the square to solve a quadratic equation
Completing the square rewrites the equation as a perfect square plus a constant. It is more work than the formula for plain solving, but it is the method the formula itself is derived from, and it is essential later for finding the turning point of a parabola. For x² + 6x + 5 = 0: move the 5 across to get x² + 6x = −5, then add the square of half the x-coefficient (half of 6 is 3, 3² = 9) to both sides: x² + 6x + 9 = 4. The left side is now (x + 3)², so (x + 3)² = 4, meaning x + 3 = ±2, giving x = −1 or x = −5.
For everyday solving, the formula is faster. Reach for completing the square when a question asks for it, or when you need the vertex form of a quadratic rather than just its roots.
The discriminant: how many solutions does a quadratic equation have?
The discriminant is the part under the square root, b² − 4ac, and its sign tells you how many real solutions a quadratic has before you finish solving:
- If b² − 4ac is positive, there are two different real solutions (the graph crosses the x-axis twice).
- If b² − 4ac equals zero, there is exactly one real solution, a repeated root (the graph just touches the x-axis).
- If b² − 4ac is negative, there are no real solutions, because you cannot take the real square root of a negative number (the solutions are complex, covered in later courses).
So a quick discriminant check saves effort. Two quick examples: in x² + x + 1 = 0, b² − 4ac = 1 − 4 = −3, which is negative, so there are no real solutions and there is no point grinding through the formula (the roots are complex, written (−1 ± i√3) ÷ 2, which later courses cover). In x² − 6x + 9 = 0, the discriminant is 36 − 36 = 0, so there is exactly one root: x = −b ÷ 2a = 6 ÷ 2 = 3, a repeated root where the graph just touches the x-axis. A discriminant that is a perfect square, such as the 25 in the formula example above, also tells you the quadratic will factor neatly over whole numbers.
Check your answers
Because the three methods must agree, solving one equation two ways is itself a check, but there is a faster one. For ax² + bx + c = 0, the two roots always add up to −b ÷ a and multiply to c ÷ a. Take 2x² + 3x − 2 = 0 with roots 0.5 and −2: they add to 0.5 + (−2) = −1.5 = −3 ÷ 2, and multiply to 0.5 × (−2) = −1 = −2 ÷ 2. Both match a, b and c, so the roots are right. This sum-and-product check catches a slipped sign in seconds.
The formula also handles roots that do not come out as neat whole numbers, which is where factoring gives up. For x² − 2x − 1 = 0, the discriminant is 4 + 4 = 8, so x = (2 ± √8) ÷ 2 = 1 ± √2, about 2.414 and −0.414. No pair of whole numbers factors that, but the formula solves it cleanly.
Which method should you use to solve a quadratic equation?
Try factoring first when the coefficients are small whole numbers, because it is fastest. If it does not factor cleanly within a few seconds, use the quadratic formula, which works every time and is the safe default. Use completing the square when a question specifically asks for it, or when you need the vertex of the parabola rather than just the roots. All three give the same answers when real solutions exist; they must agree, so solving one equation two ways is a good check.
Common mistakes
- Not setting the equation to zero first. The formula and factoring both assume ax² + bx + c = 0. Move everything to one side before reading off a, b and c.
- Losing a sign. If c is negative, −4ac becomes positive. Carry the signs carefully through b² − 4ac.
- Forgetting the ±. The formula gives two answers. Taking only the plus (or only the minus) misses a solution.
- Dividing only part by 2a. The whole numerator, −b ± the root, is divided by 2a, not just the root.
- Forgetting a cannot be zero. If a = 0 there is no x² term and it is not quadratic. If a, b and c share a common factor, divide it out first: 2x² + 4x − 6 = 0 becomes x² + 2x − 3 = 0, which is easier to factor.
Get the equation into standard form, check the discriminant, then factor if it is easy or use the formula if it is not, and the steps become mechanical. When you want the answer and the steps instantly, the free quadratic formula calculator solves any ax² + bx + c = 0 and shows the discriminant, and the scientific calculator handles the roots and powers along the way. And if a right triangle leaves you with a quadratic, as happens when a² + b² = c² has an unknown on both sides, the Pythagorean theorem calculator covers that case.
Frequently asked questions
What is the quadratic formula?
For an equation ax² + bx + c = 0, the solutions are x = (−b ± √(b² − 4ac)) ÷ 2a. The plus-or-minus sign gives the two solutions. It works for any quadratic once it is written in standard form with zero on one side.
How do I know how many solutions a quadratic has?
Check the discriminant, b² − 4ac. If it is positive there are two real solutions; if it is zero there is one repeated solution; if it is negative there are no real solutions (the roots are complex). This tells you what to expect before you finish solving.
When should I factor instead of using the formula?
Factor first when the coefficients are small whole numbers and you can quickly find two numbers that multiply to c and add to b, because it is the fastest route. If it does not factor neatly within a few seconds, use the quadratic formula, which always works.
What is the first step in solving a quadratic equation?
Rearrange it into standard form ax² + bx + c = 0, with everything on one side and zero on the other, then read off a, b and c keeping their signs. Every method depends on this, and most errors come from getting a, b or c wrong at the start.