The Quadratic Formula

Learning goals

  • Derive the quadratic formula by completing the square on ax2+bx+c=0ax^2 + bx + c = 0
  • Write a quadratic in standard form and read off aa, bb, cc with their signs
  • Apply the formula, simplifying radicals and reducing the fraction to find the roots
  • Use D=b2−4acD = b^2 - 4ac to predict real, repeated, or complex roots before solving

Deriving the formula by completing the square

The quadratic formula is not a rule to accept on faith. It is exactly what completing the square gives when you feed it the general equation. Every move below is one you already made in the last lesson on specific numbers, for example a=2a = 2, b=5b = 5, c=−3c = -3 in 2x2+5x−3=02x^2 + 5x - 3 = 0. The only new thing is that now those numbers stay as letters all the way through.

Deriving the quadratic formula from ax2+bx+c=0ax^2 + bx + c = 0#

Start from the general quadratic equation, where aa, bb, and cc are real numbers with a≠0a \ne 0. If aa were 00 there would be no x2x^2 term and the equation would not be quadratic at all:

ax2+bx+c=0.ax^2 + bx + c = 0.

Completing the square needs the leading coefficient to be 11, so divide every term by aa. Because a≠0a \ne 0, dividing by it is allowed:

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

Move the constant term to the right side, so the left holds only the two terms that carry xx:

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

Now complete the square on the left. Half of the coefficient of xx is b2a\dfrac{b}{2a}, and squaring it gives b24a2\dfrac{b^2}{4a^2}. Add that constant to both sides, which keeps the equation balanced:

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

The left side is now a perfect square. Since half of ba\tfrac{b}{a} is b2a\tfrac{b}{2a}, it factors as

(x+b2a)2=b24a2−ca.\left(x + \frac{b}{2a}\right)^2 = \frac{b^2}{4a^2} - \frac{c}{a}.

Combine the right side into one fraction. The common denominator is 4a24a^2, and rewriting ca=4ac4a2\dfrac{c}{a} = \dfrac{4ac}{4a^2} lets the two pieces subtract cleanly:

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

Take the square root of both sides. Squaring erases a sign, so undoing it creates two possible equations, one for each sign the squared side could have had; attach a ±\pm to capture both, and split the root over numerator and denominator. (x\sqrt{\phantom{x}} itself always names one fixed value, never two: 9\sqrt{9} names 33 and not −3-3, exactly as established in Imaginary Numbers. The two signs come from the ±\pm, not from the radical.) Since 4a24a^2 is a perfect square, its root simplifies the denominator to 2a2a (the note after this derivation explains the one subtlety in that step):

x+b2a=±b2−4ac4a2=±b2−4ac2a.x + \frac{b}{2a} = \pm\sqrt{\frac{b^2 - 4ac}{4a^2}} = \pm\frac{\sqrt{b^2 - 4ac}}{2a}.

Finally subtract b2a\dfrac{b}{2a} from both sides to isolate xx:

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

Both terms on the right already share the denominator 2a2a, so they merge into a single fraction, and that fraction is the quadratic formula:

x=−b±b2−4ac2a.x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}.

Because the derivation never assumed anything about the real numbers aa, bb, and cc beyond a≠0a \ne 0, the formula holds for every quadratic equation. Whatever completing the square would have found, the formula finds too, with none of the repeated setup.

Check your understanding

In the derivation, why must every term be divided by aa before completing the square?

Answer choices

Check your understanding

In the derivation, why is (b2a)2\left(\dfrac{b}{2a}\right)^2, and not b2a\dfrac{b}{2a} or ba\dfrac{b}{a}, the constant added to both sides to complete the square?

Answer choices

What the formula says

Here is the result on its own, worth memorizing because you will use it constantly:

ax2+bx+c=0⟹x=−b±b2−4ac2a.ax^2 + bx + c = 0 \quad\Longrightarrow\quad x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}.

The single ±\pm packs both solutions into one line. Read with a plus it gives one root; read with a minus it gives the other. The one part people misread is the denominator: the 2a2a divides the entire numerator, both the −b-b and the b2−4ac\sqrt{b^2 - 4ac} together, not just one piece of it.

Anatomy of the quadratic formulaThe formula negative b plus or minus the square root of b squared minus 4 a c, over 2 a, with the numerator boxed to show it is all divided by 2 a, and b squared minus 4 a c labeled as the discriminant.b² - 4ac is the discriminant-b ± √(b² - 4ac)2athe whole numerator is divided by 2a
The anatomy of the quadratic formula. Everything in the numerator, the negative b term and the square-root term together, sits over 2a, so the whole top is divided by 2a. The quantity b squared minus 4ac beneath the root is the discriminant, and its sign decides whether the roots are real, repeated, or complex.

To use the formula you first need the three numbers aa, bb, and cc. They are the coefficients when the equation is written in standard form, with everything on one side and zero on the other:

ax2+bx+c=0.ax^2 + bx + c = 0.

Here aa is the coefficient of x2x^2, bb is the coefficient of xx, and cc is the constant term. Read them with their signs. In 3x2−5x+2=03x^2 - 5x + 2 = 0 the coefficients are a=3a = 3, b=−5b = -5, and c=2c = 2; the minus sign belongs to bb. Getting a sign wrong here is the fastest way to a wrong answer, so it is worth a moment of care before you substitute.

The discriminant

Look again at the quantity under the square root:

D=b2−4ac.D = b^2 - 4ac.

This is called the discriminant, and it alone decides what kind of roots a quadratic has. (If you compare it with the quantity RR from the last lesson’s derivation, for a=1a = 1 this one equals 4R4R. Multiplying by a positive number never flips a sign, so the same three cases below still hold.) There are exactly three cases, and each comes straight from what a square root does to a positive number, to zero, and to a negative number.

If D>0D > 0, then D\sqrt{D} is a nonzero real number, and the ±\pm pulls it once above and once below −b-b, giving two different real roots.

If D=0D = 0, then D=0\sqrt{D} = 0, and adding or subtracting 00 makes no difference, so the two roots fall together into one repeated real root, x=−b2ax = -\dfrac{b}{2a}.

If D<0D < 0, then D\sqrt{D} is the square root of a negative number, which is imaginary. Writing D=i∣D∣\sqrt{D} = i\sqrt{\lvert D\rvert} turns the answer into two complex roots, a conjugate pair −b2a±∣D∣2a i-\dfrac{b}{2a} \pm \dfrac{\sqrt{\lvert D\rvert}}{2a}\,i. Before this chapter that case simply had no answer; now that ii is available, it does.

Discriminant D=b2−4acD = b^2 - 4acThe square root D\sqrt{D}Roots of the quadratic
D>0D > 0a nonzero real numbertwo distinct real roots
D=0D = 0zeroone repeated real root
D<0D < 0imaginarytwo complex conjugate roots

You can name the type of roots from DD alone, without ever finishing the solve.

Check your understanding

Without solving, what does the discriminant tell you about the roots of 2x2−3x+5=02x^2 - 3x + 5 = 0?

Answer choices

Applying the formula

With the formula, the discriminant, and the imaginary unit in hand, one procedure now solves any quadratic. Put the equation in standard form, read off aa, bb, and cc with their signs, substitute, and simplify.

Worked example 1 Solve 2x2+5x−3=02x^2 + 5x - 3 = 0

The equation is already in standard form, so read off a=2a = 2, b=5b = 5, and c=−3c = -3, keeping the sign on cc. Substitute into the formula, watching the double negative in −4ac-4ac:

x=−5±52−4(2)(−3)2(2)=−5±25+244.x = \frac{-5 \pm \sqrt{5^2 - 4(2)(-3)}}{2(2)} = \frac{-5 \pm \sqrt{25 + 24}}{4}.

The term −4(2)(−3)=+24-4(2)(-3) = +24 is positive because cc was negative, so the discriminant is 25+24=4925 + 24 = 49, a perfect square:

x=−5±494=−5±74.x = \frac{-5 \pm \sqrt{49}}{4} = \frac{-5 \pm 7}{4}.

Now split the ±\pm into its two cases:

x=−5+74=24=12,x=−5−74=−124=−3.x = \frac{-5 + 7}{4} = \frac{2}{4} = \frac{1}{2}, \qquad x = \frac{-5 - 7}{4} = \frac{-12}{4} = -3.

The two roots are x=12x = \tfrac{1}{2} and x=−3x = -3. When the discriminant is a perfect square, the roots come out rational, exactly the case that ordinary factoring could also have caught.

Worked example 2 Solve 3x2−6x+1=03x^2 - 6x + 1 = 0

Read off a=3a = 3, b=−6b = -6, and c=1c = 1. Because b=−6b = -6, the term −b-b is +6+6, and b2=(−6)2=36b^2 = (-6)^2 = 36 is positive; a common slip is to write −36-36 here. Substitute:

x=−(−6)±(−6)2−4(3)(1)2(3)=6±36−126=6±246.x = \frac{-(-6) \pm \sqrt{(-6)^2 - 4(3)(1)}}{2(3)} = \frac{6 \pm \sqrt{36 - 12}}{6} = \frac{6 \pm \sqrt{24}}{6}.

The discriminant 2424 is not a perfect square, so the roots are irrational. Simplify the radical using 24=4×624 = 4 \times 6 and 4=2\sqrt{4} = 2:

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

Every term in the fraction shares a factor of 22, so divide the numerator and denominator by 22 to reduce:

x=2(3±6)6=3±63.x = \frac{2\left(3 \pm \sqrt{6}\right)}{6} = \frac{3 \pm \sqrt{6}}{3}.

The roots are x=3+63x = \dfrac{3 + \sqrt{6}}{3} and x=3−63x = \dfrac{3 - \sqrt{6}}{3}, both real and irrational. Reduce only by a factor common to −b-b, the radical, and the denominator; here that shared factor is 22.

Check your understanding

Solve 2x2+4x−1=02x^2 + 4x - 1 = 0 with the quadratic formula.

Answer choices

The formula does not stop at real roots. When the discriminant is negative, the same substitution runs straight into a square root of a negative number, which the imaginary unit ii handles.

Worked example 3 Solve x2+4x+13=0x^2 + 4x + 13 = 0 (complex roots)

Read off a=1a = 1, b=4b = 4, and c=13c = 13, and substitute:

x=−4±42−4(1)(13)2(1)=−4±16−522=−4±−362.x = \frac{-4 \pm \sqrt{4^2 - 4(1)(13)}}{2(1)} = \frac{-4 \pm \sqrt{16 - 52}}{2} = \frac{-4 \pm \sqrt{-36}}{2}.

The discriminant is −36-36, negative, so the roots are complex. Rewrite the root of the negative with ii, using −36=i36=6i\sqrt{-36} = i\sqrt{36} = 6i:

x=−4±6i2.x = \frac{-4 \pm 6i}{2}.

Divide both parts of the numerator by 22:

x=−42±6i2=−2±3i.x = \frac{-4}{2} \pm \frac{6i}{2} = -2 \pm 3i.

The roots are the conjugate pair x=−2+3ix = -2 + 3i and x=−2−3ix = -2 - 3i. Whenever the discriminant is negative, the two roots always arrive as a conjugate pair like this, matching in real part and opposite in imaginary part.

Worked example 4 Solve 4x2−12x+9=04x^2 - 12x + 9 = 0 (a repeated root)

Read off a=4a = 4, b=−12b = -12, and c=9c = 9. Substitute, being careful that −b=12-b = 12 and b2=(−12)2=144b^2 = (-12)^2 = 144:

x=12±(−12)2−4(4)(9)2(4)=12±144−1448=12±08.x = \frac{12 \pm \sqrt{(-12)^2 - 4(4)(9)}}{2(4)} = \frac{12 \pm \sqrt{144 - 144}}{8} = \frac{12 \pm \sqrt{0}}{8}.

The discriminant is 00, so 0=0\sqrt{0} = 0 and the ±\pm adds nothing. The two roots collapse into one:

x=128=32.x = \frac{12}{8} = \frac{3}{2}.

There is a single repeated root, x=32x = \tfrac{3}{2}. A zero discriminant always signals that the quadratic factors as aa times a squared linear expression, a(x−r)2a(x - r)^2, so the same root repeats twice; here 4x2−12x+9=(2x−3)24x^2 - 12x + 9 = (2x - 3)^2.

Check your understanding

Solve x2−6x+10=0x^2 - 6x + 10 = 0 with the quadratic formula.

Answer choices

A quadratic does not always arrive in standard form. When it does not, move every term to one side first, so that the other side is 00, and only then read off aa, bb, and cc.

Worked example 5 Solve x2=3x+10x^2 = 3x + 10 by first reaching standard form

As written, the equation is not set to 00, so you cannot read the coefficients yet. Subtract 3x3x and 1010 from both sides to gather everything on the left:

x2−3x−10=0.x^2 - 3x - 10 = 0.

Now it is in standard form with a=1a = 1, b=−3b = -3, and c=−10c = -10. Substitute, noting that −4ac=−4(1)(−10)=+40-4ac = -4(1)(-10) = +40:

x=−(−3)±(−3)2−4(1)(−10)2(1)=3±9+402=3±492.x = \frac{-(-3) \pm \sqrt{(-3)^2 - 4(1)(-10)}}{2(1)} = \frac{3 \pm \sqrt{9 + 40}}{2} = \frac{3 \pm \sqrt{49}}{2}.

The discriminant is 4949, so

x=3±72⇒x=5  or  x=−2.x = \frac{3 \pm 7}{2} \quad\Rightarrow\quad x = 5 \ \text{ or }\ x = -2.

Reaching standard form first is what made aa, bb, and cc readable. Skipping that step, and reading coefficients off x2=3x+10x^2 = 3x + 10 directly, is a reliable way to get the signs wrong.

Check your understanding

Solve x2+x=12x^2 + x = 12 with the quadratic formula. (Reach standard form first.)

Answer choices

That single procedure, put in standard form and substitute, now handles every quadratic you will meet. The next lesson applies it to real-world situations, where an unknown length, time, or price is whatever value makes a quadratic equal zero.

Common mistakes

Practice

Multiple Choice Questions (MCQ)

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

Core practice

Practice problems at the level of the course, to be worked out on paper. Hints one at a time, then the answer or the full worked solution, with your progress kept in this browser.

Core practice Work it out on paper 10 problems 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)

Look at the four in b2−4acb^2 - 4ac and ask where it came from. Your derivation made it by hand. You put two fractions over the common denominator 4a24a^2, and the four survived into the answer. There is an older route that never meets a fraction at all.

Around the year 900, in India, a mathematician named Shridhara wrote down a rule for quadratics. Do not divide by aa, it says. Multiply the whole equation by four times aa instead. Then add the square of the original middle coefficient to both sides, and take the root.

Follow that on ax2+bx+c=0ax^2 + bx + c = 0 and watch what happens. Multiplying by 4a4a gives 4a2x2+4abx+4ac=04a^2x^2 + 4abx + 4ac = 0, which is (2ax)2+2(2ax)b+4ac=0(2ax)^2 + 2(2ax)b + 4ac = 0. Move 4ac4ac to the right side, then add b2b^2 to both sides. The left is now the exact square (2ax+b)2(2ax + b)^2, with no halves anywhere in it, and the right side is b2−4acb^2 - 4ac. Your discriminant falls straight out of the multiplier he chose.

Both routes end on the same line, and neither is more correct than the other. The four in the discriminant is just the price of clearing the fraction, paid at the start rather than at the end.