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

The Quadratic Formula

Learning goals

  • Derive the formula by completing the square in general
  • Divide the whole numerator, both b-b and the radical, by 2a2a
  • Read D=b24acD = b^2 - 4ac to sort the roots
  • Write standard form and read aa, bb, cc with their signs
  • Simplify the radical, then reduce the fraction
  • Accept complex roots when the discriminant is negative

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, so we earn it step by step. Every move below is one you already made in the last lesson on specific numbers; the only new thing is that the numbers are now letters.

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

Start from the general quadratic equation, with the single restriction that a0a \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 a0a \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=b24a2ca.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=b24a2ca.\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=b24a24ac4a2=b24ac4a2.\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. A square root carries two signs, so attach a ±\pm, and split the root over numerator and denominator:

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

The denominator simplified because 4a2=2a\sqrt{4a^2} = 2a. (Strictly the root is 2a2\lvert a\rvert, but the ±\pm in front already delivers both signs, so writing 2a2a throws nothing away.) Finally subtract b2a\dfrac{b}{2a} from both sides to isolate xx:

x=b2a±b24ac2a.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±b24ac2a.x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}.

Because the derivation never assumed anything about aa, bb, and cc beyond a0a \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.

What the formula says

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

ax2+bx+c=0x=b±b24ac2a.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 b24ac\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 3x25x+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=b24ac.D = b^2 - 4ac.

This number is called the discriminant, and it alone decides what kind of roots a quadratic has. The reason is that the discriminant is the thing you are about to take the square root of. 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=iD\sqrt{D} = i\sqrt{\lvert D\rvert} turns the answer into two complex roots, a conjugate pair b2a±D2ai-\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=b24acD = 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

Notice you can name the type of roots from DD alone, without ever finishing the solve. Computing the discriminant first is a quick way to know what you are heading toward.

Check your understanding

Without solving, what does the discriminant tell you about the roots of 2x23x+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+5x3=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±524(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=574=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 3x26x+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)24(3)(1)2(3)=6±36126=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=363x = \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+4x1=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±424(1)(13)2(1)=4±16522=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=23ix = -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 4x212x+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)24(4)(9)2(4)=12±1441448=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 is the exact border between real and complex roots, and it always signals that the quadratic is a perfect square, here 4x212x+9=(2x3)24x^2 - 12x + 9 = (2x - 3)^2.

Check your understanding

Solve x26x+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:

x23x10=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)24(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±72x=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.

That single procedure, put in standard form and substitute, now handles every quadratic you will meet. The next lesson turns it loose on 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.

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)

Look at the four in b24acb^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 turns the leading term into (2ax)2(2ax)^2 and the middle term into 2(2ax)b2(2ax)b. Add b2b^2 to both sides and the left is an exact square, (2ax+b)2(2ax + b)^2, with no halves anywhere in it. The right side is b24acb^2 - 4ac. Your discriminant falls straight out of the multiplier he chose.

Shridhara’s own book on algebra is lost, and even his dates are uncertain. The rule survives because a later Indian writer quoted it and named him, and in India the formula still carries his name.

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.