The Quadratic Formula and the Discriminant
Learning goals
- Use the quadratic formula to solve a quadratic equation, identifying , , and
- Predict the number of real roots a quadratic has from
- Test whether a quadratic with integer coefficients factors over the rationals, using whether is a perfect square
From completing the square to a formula
Take the destination on faith for one example before deriving it. For any with and , so that a real solution exists, the solutions turn out to be . For , that means , , , so
giving or . Check either one in the original equation and it holds. That is the whole workflow: identify , , , substitute, simplify. What is not yet clear is why this always works whenever a real solution exists, and what the formula tells you on the quadratics where one does not. That is what the derivation below proves, once and for all.
Everything rests on one derivation, so watch every step. We start from the general quadratic equation and complete the square on it exactly as the previous lesson taught, the only difference being that the coefficients are letters.
The quadratic formula, derived by completing the square#
Begin with , where so the equation is genuinely quadratic.
Divide through by , which is legal precisely because , to make the leading coefficient :
Move the constant to the right, then complete the square on the left. Half of the coefficient is , and its square is , so add that to both sides:
The left side is now a perfect square by construction. Combine the right side over the common denominator , writing :
This one line already holds the whole story, but push on to the formula. Multiply both sides by , which clears every denominator at once: the left side becomes , because .
Now take square roots of both sides. This step needs , because a real square root of a negative number does not exist; the previous lesson fixed the rule that names the non-negative root, so undoing a square needs a to recover both possibilities:
Finally subtract and divide by :
That is the quadratic formula, and it carried its one hypothesis along the whole way: it needs . If , the squared quantity would have to equal a negative number, which no real square ever does, so the equation has no real solution at all. Hold that thought; it becomes the whole next half of the lesson.
The formula deserves its place because of what the derivation just proved. It is not a pattern that happens to work on the examples in a textbook. It is the exact result of completing the square on every quadratic at once, so it inherits that guarantee for any .
The roots straddle the axis of symmetry
This section is about the case , where there are two distinct real roots. (If there is only one root, sitting on the axis itself, so nothing straddles anything; if there is no real root to place on the graph at all. Both of those cases get their own treatment soon.) Read the formula slowly, because it is telling you something the first lesson of this chapter promised. Split it into its two pieces:
The first piece, , is exactly the axis of symmetry that Quadratic Functions and Parabolas dug out of using symmetry alone. The second piece is a single signed offset added on one side and subtracted on the other. So the formula says the two roots sit the same distance to either side of the line , one to its left and one to its right. That common distance is the magnitude . The roots are a mirror pair about the axis, the same fact the parabola showed you before any algebra. The two -intercepts are reflections of each other, so their midpoint lands on the axis. The graph knew where the roots were, up to that one offset, and the formula supplies it as .
This also explains, with no extra work, why the roots average to . Add the two values from the formula and the pieces cancel:
so their average is , the axis, precisely as symmetry demanded.
Worked example 1 A quadratic that does not factor nicely
Solve .
Try factoring first, honestly. You want two integers with product and sum ; the only integer pairs multiplying to are and , summing to and , never . The integer search fails, so reach for the formula. Here , , :
Simplify the radical: , so
The two roots are and . Notice they straddle , which is the axis , each a distance away. The integer search never had a chance, because the answers are irrational, but the formula found them without breaking stride.
Check your understanding
Solve with the quadratic formula.
With , , , the discriminant is .
The simplification and the shared factor of in the numerator and denominator are what turn the raw output into .
The discriminant and the vertex height
The quantity under the square root did all the deciding in the derivation, so it earns a name. The discriminant of is
The Greek letter (capital delta) is standard for it. Everything interesting about the number of real roots is packed into the sign of , and the reason is not a coincidence of algebra. The vertex sits at , a fact the first lesson of this chapter already found; its height, the -coordinate, turns out to be a fixed multiple of , once is fixed too.
The vertex height is #
The first lesson of this chapter located the vertex of at . Evaluate there to find its height:
Put the first two terms over , using , and combine everything over :
So the -coordinate of the vertex is exactly .
This little identity turns the sign of into a statement about the picture, once you also know the sign of . Take a parabola that opens upward, so . Then has the opposite sign to : when the vertex sits below the -axis, so the upward arms must cross the axis twice. When the vertex sits on the axis, so the parabola just touches it. When the vertex sits above the axis, so the whole upward parabola floats clear of it and never meets it. For a parabola that opens downward, , every “above” and “below” swaps: the same positive now puts the vertex above the axis instead of below it, because flipping the sign of flips the sign of too. What never changes is whether the axis gets crossed, which is why the root-count table below depends on alone, with no mention of ‘s sign at all.
Three signs, three outcomes, proved both ways
The picture makes the three cases believable. The completed-square line from the derivation makes them certain, and it even runs backward: each root count comes from exactly one sign of , never two. This is the most careful passage in the lesson, so read the logic, not just the conclusions.
The discriminant counts the real roots#
Return to the line the derivation reached before any square roots:
The denominator is positive, since , so the right side has the same sign as . A real number solves the equation exactly when the left side, a real square, can equal the right side. Every real number is positive, zero, or negative, and nothing else, so those are the only three cases to check.
If , the right side is a positive number, and a positive number has two distinct real square roots, so gives two distinct values of .
If , the right side is , so the equation is , which holds only for , and holds there: one root, sitting on the axis where the parabola is tangent to it.
If , the right side is negative, but the left side is a square and no real square is negative, so no real works.
Now run it backward, which is the point people skip. The three signs of cover every possibility with none left over, and the three outcomes, two roots, one root, no roots, can never overlap. So each outcome could only have come from its one matching sign: two distinct real roots only from , since the other two signs give exactly one root or none, and likewise for the other two cases. Each statement in the table below is therefore an “if and only if”, not just an “if”.
| Sign of | Under the square root | Real roots | Parabola and the -axis |
|---|---|---|---|
| positive radicand; gives two values | two distinct | crosses it twice | |
| zero; gives one value | exactly one (a double root) | tangent to it | |
| negative; no real square root exists | none | never meets it |
This holds for every real , , , with no hypothesis about the coefficients being whole or rational. The number of real roots is a question the discriminant answers completely. In Chapter 5 the number system itself is enlarged so that the row, too, acquires roots; for now, “no real roots” is the full and honest answer.
Worked example 2 Counting roots without solving
For each equation, use only the discriminant to say how many real solutions it has.
For : here , , , so
which means two distinct real roots.
For : , so exactly one real root. Indeed the left side is , with the double root .
For : , so no real roots. This is the very quadratic the factoring lesson proved is positive for every real . The discriminant now certifies the same fact in one subtraction, and the parabola floats entirely above the axis.
Check your understanding
How many real solutions does have?
Read off , , and compute the discriminant.
A negative discriminant means the parabola never meets the -axis, so there are no real solutions. The discriminant settles the count with complete certainty, so the last option is wrong.
When a quadratic factors, and over what
The factoring lesson left a question open on purpose. It showed that has real zeros yet refuses to factor over the rationals, and it warned that “factors” is meaningless until you name the number system. The discriminant closes that question, but only if you keep two claims apart, because they are genuinely different and blurring them is the classic error at this exact spot.
The first claim is a real test with a real hypothesis.
The perfect-square test (for rational coefficients only)#
Let have rational coefficients (integers are the common case), with . The roots are , and since and are rational, these roots are rational exactly when is rational. A factoring lesson result says a quadratic with rational coefficients factors over the rationals exactly when it has a rational root. Chaining the two,
For integer coefficients is an integer. If there is no real square root at all, so no real (and hence no rational) root either. If , then is rational exactly when is a perfect square; a non-negative integer that is not a perfect square has an irrational square root. So a quadratic with integer coefficients factors over the rationals if and only if its discriminant is a non-negative perfect square. That is the version you will use almost every time, since most coefficients you meet are integers; the “square of a rational number” version above is what actually holds when the coefficients are rational but not whole.
The hypothesis is not decoration. The test speaks only about quadratics whose coefficients are rational, and it says nothing about a quadratic with irrational coefficients. State it with its hypothesis attached every single time.
The second claim is the trap, and it is false: a non-negative discriminant does not mean a quadratic “factors nicely.” Having real roots and factoring over the rationals are different properties. A quadratic with has two real zeros, and each real zero buys a real factor. So such a quadratic always factors over the reals, but with integer coefficients it factors over the rationals only when that is a perfect square on top of being positive. The next example holds the two apart.
Worked example 3 Real roots, yet no rational factorization
Does factor over the rationals? Does ?
For , the coefficients are integers, so run the test:
Now is positive, so there are two distinct real roots, but is not a perfect square, so is irrational and the roots are irrational. The quadratic does not factor over the rationals, even though it factors over the reals as . Real roots did not buy a rational factorization.
Change the constant by one, to , and the story flips:
a perfect square, so this one does factor over the rationals, as . The two quadratics look almost identical, both have two real roots, and the discriminant quickly predicts which one an integer factoring search can crack, before you spend time searching. This is the honest retirement of the factoring lesson’s open question: “factors” always needs a number system named, and the discriminant is what names it.
Check your understanding
The equation has integer coefficients and discriminant . What does that tell you?
The discriminant is , a perfect square, and the coefficients are integers, so the perfect-square test applies.
Both roots are rational, so it factors over the rationals as . A perfect-square discriminant with integer coefficients is exactly the condition for a rational factorization.
Designing with the discriminant, and choosing a method
Because controls the root count, you can run the logic backwards: fix the number of roots you want and solve for the coefficient that delivers it. The condition in particular is the exact knife edge between two roots and none. So problems that ask for “exactly one solution” or a graph “tangent to the axis” are really asking you to set the discriminant to zero.
Worked example 4 Forcing a single root
For which values of does have exactly one real solution?
Exactly one real solution is the case . With , , ,
Set it to zero: , so and . Both work, and they are geometrically the two ways to slide the parabola until its vertex just kisses the axis. At the equation is with double root ; at it is with double root . A single condition on the discriminant pinned down both designs.
The formula always works, which tempts you to reach for it every time, but “always works” is not the same as “always fastest.” Match the method to the equation. If a quadratic factors on sight, like , factoring reads off the roots in seconds and the formula is slower busy work. If the equation is already a square, or one step from being one, like or , taking a square root directly beats expanding into , , and running the full formula. Reach for the formula once neither shortcut is available, which tends to happen when the coefficients are awkward or the roots turn out irrational. A quick glance at the discriminant tells you which world you are in before you commit. With integer coefficients, a perfect-square discriminant means the quadratic factors over the rationals, so a factoring search will succeed; with rational, non-integer coefficients the matching condition is that is the square of a rational number. Either way, any other value means factoring over the rationals is hopeless, and the formula is your reliable route.
One caution belongs with any formula that produces radicals. The quadratic formula is a statement about exact arithmetic. The value is an exact root of ; the decimal is only an approximation. Rounding too early can quietly corrupt an answer, especially when the formula subtracts two nearly equal numbers. Keep radicals in exact form as long as you can, and round only at the very end if a decimal is what the problem wants.