This site is a work in progress. New lessons are added regularly. Contact us

The Quadratic Formula and the Discriminant

Learning goals

  • Prove the formula by completing the square on the general case
  • Split it into the axis plus a symmetric offset
  • Read Δ=b24ac\Delta = b^2 - 4ac and the vertex height Δ4a-\tfrac{\Delta}{4a}
  • State three biconditionals linking Δ\Delta to the real roots
  • Test rational factorization by whether Δ\Delta is a perfect square
  • Choose factoring, completing the square, or the formula by the equation

From completing the square to a formula

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 ax2+bx+c=0ax^2 + bx + c = 0, where a0a \ne 0 so the equation is genuinely quadratic.

Divide through by aa, which is legal precisely because a0a \ne 0, to make the leading coefficient 11:

x2+bax+ca=0.x^2 + \frac{b}{a}\,x + \frac{c}{a} = 0.

Move the constant to the right, then complete the square on the left. Half of the coefficient ba\tfrac{b}{a} is b2a\tfrac{b}{2a}, and its square is b24a2\tfrac{b^2}{4a^2}, so add that to both sides:

x2+bax+b24a2=ca+b24a2.x^2 + \frac{b}{a}\,x + \frac{b^2}{4a^2} = -\frac{c}{a} + \frac{b^2}{4a^2}.

The left side is now a perfect square by construction. Combine the right side over the common denominator 4a24a^2, writing ca=4ac4a2\tfrac{c}{a} = \tfrac{4ac}{4a^2}:

(x+b2a)2=b24ac4a2.\left(x + \frac{b}{2a}\right)^2 = \frac{b^2 - 4ac}{4a^2}.

This one line already holds the whole story, but push on to the formula. Take square roots of both sides. The previous lesson fixed the rule: k\sqrt{k} names the non-negative root, so undoing a square needs a ±\pm to recover both possibilities. Here 4a2=2a\sqrt{4a^2} = 2\lvert a\rvert, and the ±\pm already in front of the radical supplies both signs regardless of the sign of aa. So dividing by 2a2\lvert a\rvert or by 2a2a merely trades which sign is which, so we may write the root over 2a2a:

x+b2a=±b24ac2a.x + \frac{b}{2a} = \pm\,\frac{\sqrt{b^2 - 4ac}}{2a}.

Finally subtract b2a\tfrac{b}{2a} and collect the two terms over their shared denominator:

x=b2a±b24ac2a=b±b24ac2a.x = -\frac{b}{2a} \pm \frac{\sqrt{b^2 - 4ac}}{2a} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}.

That is the quadratic formula. One warning is already visible in the line before it: the step “take square roots” needs b24ac0b^2 - 4ac \ge 0, because a real square root of a negative number does not exist. If b24ac<0b^2 - 4ac < 0, the squared quantity on the left 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 fame because of what the derivation just proved about it. It is not a lucky pattern that happens to work on the examples in a textbook. It is the exact output of an algorithm that provably solves every quadratic, so the formula inherits that guarantee. This is what a theorem is: a result proved once, in general, and then owned outright. You never have to complete the square on a specific quadratic again, because you already did it on all of them at once.

x=b±b24ac2a\boxed{\,x = \dfrac{-b \pm \sqrt{b^2 - 4ac}}{2a}\,}

The roots straddle the axis of symmetry

Read the formula slowly, because it is telling you something the first lesson of this chapter promised. Split it into its two pieces:

x=b2athe axis  ±  b24ac2athe offset.x = \underbrace{-\frac{b}{2a}}_{\text{the axis}} \;\pm\; \underbrace{\frac{\sqrt{b^2 - 4ac}}{2a}}_{\text{the offset}}.

The first piece, b2a-\tfrac{b}{2a}, is exactly the axis of symmetry that Quadratic Functions and Parabolas dug out of ax2+bx+cax^2 + bx + c 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 x=b2ax = -\tfrac{b}{2a}, one to its left and one to its right. That common distance is the magnitude b24ac2a\tfrac{\sqrt{b^2 - 4ac}}{2\lvert a\rvert}. The roots are a mirror pair about the axis, the same fact the parabola showed you before any algebra. The two xx-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 ±b24ac2a\pm\tfrac{\sqrt{b^2 - 4ac}}{2a}.

This also explains, with no extra work, why the roots average to b2a-\tfrac{b}{2a}. Add the two values from the formula and the ±\pm pieces cancel:

b+b24ac2a+bb24ac2a=2b2a=ba,\frac{-b + \sqrt{b^2 - 4ac}}{2a} + \frac{-b - \sqrt{b^2 - 4ac}}{2a} = \frac{-2b}{2a} = -\frac{b}{a},

so their average is b2a-\tfrac{b}{2a}, the axis, precisely as symmetry demanded.

Worked example 1 A quadratic that does not factor nicely

Solve x26x+7=0x^2 - 6x + 7 = 0.

Try factoring first, honestly. You want two integers with product 77 and sum 6-6; the only integer pairs multiplying to 77 are 1,71, 7 and 1,7-1, -7, summing to 88 and 8-8, never 6-6. The integer search fails, so reach for the formula. Here a=1a = 1, b=6b = -6, c=7c = 7:

x=(6)±(6)24(1)(7)2(1)=6±36282=6±82.x = \frac{-(-6) \pm \sqrt{(-6)^2 - 4(1)(7)}}{2(1)} = \frac{6 \pm \sqrt{36 - 28}}{2} = \frac{6 \pm \sqrt{8}}{2}.

Simplify the radical: 8=42=22\sqrt{8} = \sqrt{4 \cdot 2} = 2\sqrt{2}, so

x=6±222=3±2.x = \frac{6 \pm 2\sqrt{2}}{2} = 3 \pm \sqrt{2}.

The two roots are 3+24.413 + \sqrt{2} \approx 4.41 and 321.593 - \sqrt{2} \approx 1.59. Notice they straddle x=3x = 3, which is the axis b2a=62=3-\tfrac{b}{2a} = \tfrac{6}{2} = 3, each a distance 2\sqrt{2} 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 2x2+4x1=02x^2 + 4x - 1 = 0 with the quadratic formula.

Answer choices

The discriminant fixes the vertex

The quantity under the square root did all the deciding in the derivation, so it earns a name. The discriminant of ax2+bx+cax^2 + bx + c is

Δ=b24ac.\Delta = b^2 - 4ac.

The Greek letter Δ\Delta (capital delta) is standard for it. Everything interesting about the number of real roots is packed into the sign of Δ\Delta, and the reason is not a coincidence of algebra. The discriminant is, up to a fixed factor, the height of the vertex.

The vertex height is Δ4a-\dfrac{\Delta}{4a}#

The first lesson of this chapter located the vertex of f(x)=ax2+bx+cf(x) = ax^2 + bx + c at x=b2ax = -\tfrac{b}{2a}. Evaluate ff there to find its height:

f ⁣(b2a)=a(b24a2)+b(b2a)+c=b24ab22a+c.f\!\left(-\frac{b}{2a}\right) = a\left(\frac{b^2}{4a^2}\right) + b\left(-\frac{b}{2a}\right) + c = \frac{b^2}{4a} - \frac{b^2}{2a} + c.

Put the first two terms over 4a4a, using b22a=2b24a\tfrac{b^2}{2a} = \tfrac{2b^2}{4a}, and combine everything over 4a4a:

f ⁣(b2a)=b22b24a+c=b2+4ac4a=b24ac4a=Δ4a.f\!\left(-\frac{b}{2a}\right) = \frac{b^2 - 2b^2}{4a} + c = \frac{-b^2 + 4ac}{4a} = -\frac{b^2 - 4ac}{4a} = -\frac{\Delta}{4a}.

So the yy-coordinate of the vertex is exactly Δ4a-\tfrac{\Delta}{4a}.

This little identity turns the sign of Δ\Delta into a statement about the picture. Take a parabola that opens upward, so a>0a > 0. Then Δ4a-\tfrac{\Delta}{4a} has the opposite sign to Δ\Delta: when Δ>0\Delta > 0 the vertex sits below the xx-axis, so the upward arms must cross the axis twice. When Δ=0\Delta = 0 the vertex sits on the axis, so the parabola just touches it. When Δ<0\Delta < 0 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, a<0a < 0, every “above” and “below” swaps, but the conclusion about meeting the axis is identical. The reason is that a downward parabola with its vertex above the axis still crosses twice. The sign of the discriminant is the algebra of where the vertex sits relative to the xx-axis.

The three sign cases of the discriminant as three vertex heightsThree upward parabolas of identical shape. Delta greater than zero has its vertex below the x-axis and two crossings; delta equal to zero has its vertex on the axis and one touch; delta less than zero has its vertex above the axis and no crossing.Δ > 0two real rootsΔ = 0one real rootΔ < 0no real roots
One parabola shape, slid up and down. The only thing that changes across the three panels is the height of the vertex, which the identity vertex y = minus delta over 4a ties directly to the sign of the discriminant. A vertex below the axis (delta positive) forces two crossings, a vertex on the axis (delta zero) gives one, and a vertex above the axis (delta negative) gives none.

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 makes them biconditionals: each root count happens exactly when its sign of Δ\Delta holds, converse included. 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:

(x+b2a)2=Δ4a2.\left(x + \frac{b}{2a}\right)^2 = \frac{\Delta}{4a^2}.

The denominator 4a24a^2 is positive, since a0a \ne 0, so the right side has the same sign as Δ\Delta. A real number xx solves the equation exactly when the left side, a real square, can equal the right side. Three cases, and they are exhaustive and mutually exclusive because every real number Δ\Delta is positive, zero, or negative and nothing else.

If Δ>0\Delta > 0, the right side is a positive number, and a positive number has two distinct real square roots, so x+b2a=±Δ2ax + \tfrac{b}{2a} = \pm\tfrac{\sqrt{\Delta}}{2a} gives two distinct values of xx. Two distinct real roots.

If Δ=0\Delta = 0, the right side is 00, so the equation is (x+b2a)2=0\left(x + \tfrac{b}{2a}\right)^2 = 0, which holds only for x=b2ax = -\tfrac{b}{2a}, and holds there. Exactly one real root, the double root sitting on the axis, where the parabola is tangent to the xx-axis.

If Δ<0\Delta < 0, the right side is negative, but the left side is a square and no real square is negative, so no real xx works. No real roots.

Now the converse comes for free, and this is the point people skip. The three hypotheses on Δ\Delta partition every possibility, and the three conclusions (two roots, one root, no roots) are mutually exclusive outcomes. When a full partition of the input matches one-to-one with mutually exclusive outputs, the matching automatically runs backward as well. Two distinct real roots can therefore only have come from Δ>0\Delta > 0, since the other two signs produce exactly one root or none. Similarly one real root can only have come from Δ=0\Delta = 0, and no real roots only from Δ<0\Delta < 0, by the same elimination. So each statement is an “if and only if”, not just an “if”.

Say the three biconditionals out loud in their full form, because their exactness is what makes them usable. That same exactness is also what makes them easy to overclaim in a moment.

These hold for every real a0a \ne 0, bb, cc, 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 Δ<0\Delta < 0 case, 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 2x25x+1=02x^2 - 5x + 1 = 0: here a=2a = 2, b=5b = -5, c=1c = 1, so

Δ=(5)24(2)(1)=258=17>0,\Delta = (-5)^2 - 4(2)(1) = 25 - 8 = 17 > 0,

which means two distinct real roots.

For x24x+4=0x^2 - 4x + 4 = 0: Δ=(4)24(1)(4)=1616=0\Delta = (-4)^2 - 4(1)(4) = 16 - 16 = 0, so exactly one real root. Indeed the left side is (x2)2(x - 2)^2, with the double root x=2x = 2.

For x2+x+1=0x^2 + x + 1 = 0: Δ=124(1)(1)=14=3<0\Delta = 1^2 - 4(1)(1) = 1 - 4 = -3 < 0, so no real roots. This is the very quadratic the factoring lesson proved is positive for every real xx. The discriminant now certifies the same fact in one subtraction, and the parabola y=x2+x+1y = x^2 + x + 1 floats entirely above the axis.

Check your understanding

How many real solutions does 3x22x+5=03x^2 - 2x + 5 = 0 have?

Answer choices

When a quadratic factors, and over what

The factoring lesson left a question open on purpose. It showed that x22x^2 - 2 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 ax2+bx+cax^2 + bx + c have rational coefficients (integers are the common case), with a0a \ne 0. The roots are b±Δ2a\tfrac{-b \pm \sqrt{\Delta}}{2a}, and since aa and bb are rational, these roots are rational exactly when Δ\sqrt{\Delta} 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,

factors over Q    rational root    Δ rational    Δ is a perfect square.\begin{aligned} \text{factors over } \mathbb{Q} &\iff \text{rational root} \\ &\iff \sqrt{\Delta}\ \text{rational} \\ &\iff \Delta\ \text{is a perfect square}. \end{aligned}

For integer coefficients Δ\Delta is an integer, and Δ\sqrt{\Delta} is rational exactly when Δ\Delta is a perfect square (a non-square integer has an irrational square root). So a quadratic with integer coefficients factors over the rationals if and only if its discriminant is a perfect square.

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 Δ>0\Delta > 0 has two real zeros, and each real zero buys a real factor. So such a quadratic always factors over the reals, but it factors over the rationals only when that Δ\Delta is a perfect square on top of being positive. The next example holds the two apart.

Worked example 3 Perfect square, so it factors over the rationals

Solve 6x2x2=06x^2 - x - 2 = 0, and connect the answer to factoring.

Compute the discriminant: a=6a = 6, b=1b = -1, c=2c = -2, so

Δ=(1)24(6)(2)=1+48=49=72.\Delta = (-1)^2 - 4(6)(-2) = 1 + 48 = 49 = 7^2.

The discriminant is a perfect square and the coefficients are integers, so the test predicts rational roots and a rational factorization before we even finish. The formula confirms it:

x=1±4912=1±712,x=812=23  or  x=612=12.x = \frac{1 \pm \sqrt{49}}{12} = \frac{1 \pm 7}{12}, \qquad x = \frac{8}{12} = \frac{2}{3} \ \text{ or } \ x = \frac{-6}{12} = -\frac{1}{2}.

Both roots are rational, so the quadratic factors over the rationals. Cashing each root in for a factor, 6x2x2=6(x23)(x+12)=(3x2)(2x+1)6x^2 - x - 2 = 6\left(x - \tfrac{2}{3}\right)\left(x + \tfrac{1}{2}\right) = (3x - 2)(2x + 1). A perfect square discriminant was the early warning that the integer search of the factoring lesson would have succeeded here.

Worked example 4 Real roots, yet no rational factorization

Does 3x2+5x13x^2 + 5x - 1 factor over the rationals? Does 3x2+5x23x^2 + 5x - 2?

For 3x2+5x13x^2 + 5x - 1, the coefficients are integers, so run the test:

Δ=524(3)(1)=25+12=37.\Delta = 5^2 - 4(3)(-1) = 25 + 12 = 37.

Now 3737 is positive, so there are two distinct real roots, but 3737 is not a perfect square, so 37\sqrt{37} is irrational and the roots 5±376\tfrac{-5 \pm \sqrt{37}}{6} are irrational. The quadratic does not factor over the rationals, even though it factors over the reals as 3(x5+376)(x5376)3\left(x - \tfrac{-5 + \sqrt{37}}{6}\right)\left(x - \tfrac{-5 - \sqrt{37}}{6}\right). Real roots did not buy a rational factorization.

Change the constant by one, to 3x2+5x23x^2 + 5x - 2, and the story flips:

Δ=524(3)(2)=25+24=49=72,\Delta = 5^2 - 4(3)(-2) = 25 + 24 = 49 = 7^2,

a perfect square, so this one does factor over the rationals, as (3x1)(x+2)(3x - 1)(x + 2). The two quadratics look almost identical, both have two real roots, and only the discriminant tells you which one an integer factoring search can crack. 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 2x2+7x+3=02x^2 + 7x + 3 = 0 has integer coefficients and discriminant Δ=4924=25\Delta = 49 - 24 = 25. What does that tell you?

Answer choices

Designing with the discriminant, and choosing a method

Because Δ\Delta 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 Δ=0\Delta = 0 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 5 Forcing a single root

For which values of kk does x2+kx+9=0x^2 + kx + 9 = 0 have exactly one real solution?

Exactly one real solution is the case Δ=0\Delta = 0. With a=1a = 1, b=kb = k, c=9c = 9,

Δ=k24(1)(9)=k236.\Delta = k^2 - 4(1)(9) = k^2 - 36.

Set it to zero: k236=0k^2 - 36 = 0, so k2=36k^2 = 36 and k=±6k = \pm 6. Both work, and they are geometrically the two ways to slide the parabola until its vertex just kisses the axis. At k=6k = 6 the equation is x2+6x+9=(x+3)2=0x^2 + 6x + 9 = (x + 3)^2 = 0 with double root 3-3; at k=6k = -6 it is (x3)2=0(x - 3)^2 = 0 with double root 33. 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 x23x10=(x5)(x+2)x^2 - 3x - 10 = (x - 5)(x + 2), factoring reads off the roots in seconds and the formula is slower busy work. If the equation is already a square or a shift away from one, completing the square is direct. Reach for the formula when factoring fails or would take longer than it is worth, which is exactly when the roots are irrational or the coefficients are awkward. A quick glance at the discriminant tells you which world you are in before you commit. With integer or rational coefficients, a perfect-square discriminant means the quadratic factors over the rationals, so a factoring search will succeed. With those same coefficients, 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 3+23 + \sqrt{2} is an exact root of x26x+7x^2 - 6x + 7; the decimal 4.4144.414 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.

Common mistakes

Practice

Multiple Choice Questions (MCQ)

Progressively harder sets of questions. Each opens on its own page.

Free Response Questions (FRQ)

Longer questions in parts, to be worked out on paper. Progressive hints, the answer on its own so you can check yourself and try again, then the full worked solution, plus a rubric to mark your own work against.

Free response Work it out on paper 5 questions Start →
More practice (optional)

Extra sets, as hard as the Challenge set. Each one opens on its own page.

More resources (optional)

Other explanations of this lesson, if you want a second take.

A bit of history (Optional)

People were solving quadratics for three thousand years before anyone could write one down.

Old Babylonian scribes, in what is now Iraq, left clay tablets from about 1800 BCE. They set the same puzzle over and over. A number and its partner have a known sum and a known product; find them. The procedure pressed into the clay is the one you ran in the last lesson. It goes move for move: halve, square, subtract, take the root. What the scribes lacked was not the method but the letters. With no way to say “for every aa, bb and cc”, each new problem began again from nothing.

Stating the rule in general also meant accepting answers people did not want. Around the year 628 the astronomer Brahmagupta, working in India, wrote out a verbal rule for the quadratic. It covers the equation almost completely. His arithmetic elsewhere let a negative quantity stand as a number in its own right, which was rare. Nearly everyone before him threw negative answers away as absurd, and most people did the same for centuries afterwards. They reported one solution where there were two.

Both of those inheritances sit inside the single line you proved today. The ±\pm is the scribes’ pair of numbers. Its minus branch is the kind of quantity Brahmagupta’s arithmetic already admitted, even where nobody yet wrote a rule that returned both roots at once. One derivation, carried out in letters rather than in clay, retires three thousand years of starting again.