Quadratics

How to Derive the Quadratic Formula

The quadratic formula x=−b±b2−4ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} comes from completing the square on the general equation ax2+bx+c=0ax^2 + bx + c = 0, done once with letters instead of numbers. Every time you use it, you are replaying that one completed square with your own values of aa, bb and cc.

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

Try it with your numbers

Show every step

Seeing the derivation makes the formula far easier to remember, and it explains the plus-or-minus sign, the discriminant and the link to parabolas. The steps below are all short algebra moves. If you want the formula as a ready-to-use tool first, see the quadratic formula page, then come back here for the reason it works.

How do you derive the quadratic formula step by step?

Start with ax2+bx+c=0ax^2 + bx + c = 0 where a≠0a \neq 0. The idea is to force the left side into the shape (something)2(\text{something})^2, because a squared quantity can be undone with a square root. That is exactly what completing the square does.

First divide every term by aa, then move the constant to the right:

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

Now take half of the xx coefficient and square it. Half of ba\frac{b}{a} is b2a\frac{b}{2a}, and its square is b24a2\frac{b^2}{4a^2}. Add that to both sides:

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

The left side is now (x+b2a)2\left(x + \frac{b}{2a}\right)^2. On the right, rewrite −ca-\frac{c}{a} as −4ac4a2-\frac{4ac}{4a^2} so both terms share a denominator:

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

Take the square root of both sides. Since 4a2\sqrt{4a^2} is 2a2a in absolute value, and the ±\pm covers both signs anyway, you get x+b2a=±b2−4ac2ax + \frac{b}{2a} = \pm\frac{\sqrt{b^2 - 4ac}}{2a}. Subtract b2a\frac{b}{2a} and combine the fractions:

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

Quick check

Divide 2x2+8x−3=02x^2 + 8x - 3 = 0 by 22. What number must you add to both sides to complete the square?

Can you derive the quadratic formula without fractions?

Yes, and it is shorter. Multiply the whole equation by 4a4a before doing anything else:

4a2x2+4abx+4ac=04a^2x^2 + 4abx + 4ac = 0

The first term is now (2ax)2(2ax)^2 and the middle term is 2⋅(2ax)⋅b2 \cdot (2ax) \cdot b. A perfect square (2ax+b)2(2ax + b)^2 needs only a final b2b^2. Move 4ac4ac to the right and add b2b^2 to both sides:

4a2x2+4abx+b2=b2−4ac4a^2x^2 + 4abx + b^2 = b^2 - 4ac

(2ax+b)2=b2−4ac(2ax + b)^2 = b^2 - 4ac

Now the square root method finishes the job: 2ax+b=±b2−4ac2ax + b = \pm\sqrt{b^2 - 4ac}, so x=−b±b2−4ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}. No b24a2\frac{b^2}{4a^2} and no common denominators, which means fewer places to slip.

Why multiply by 4a?

It makes the first term a perfect square, (2ax)2(2ax)^2, and turns the middle term into 2⋅(2ax)⋅b2 \cdot (2ax) \cdot b. The only piece missing from a perfect square is then b2b^2.

Why does the quadratic formula have a plus-or-minus sign?

Squaring erases signs, so undoing a square must give back both possibilities. Since (x+b2a)2\left(x + \frac{b}{2a}\right)^2 equals a single positive number (when the discriminant is positive), x+b2ax + \frac{b}{2a} can be either the positive or the negative root of it. Those are your two solutions.

The same fact explains why a negative aa causes no trouble. Strictly, 4a2=∣2a∣\sqrt{4a^2} = |2a|, but a ±\pm in front makes the absolute value bars unnecessary. The formula holds for every nonzero aa.

Most lost points come from three slips when substituting:

  • Forgetting that −b-b is positive when bb is negative: for b=−5b = -5, −b=5-b = 5.
  • Squaring a negative bb without brackets: (−5)2=25(-5)^2 = 25, never −25-25. The order of operations is the culprit here.
  • Dividing only the radical by 2a2a: the fraction bar sits under the entire numerator.

Worked example 1: solve 2x2−5x−3=02x^2 - 5x - 3 = 0. Here a=2a = 2, b=−5b = -5, c=−3c = -3.

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

So x=124=3x = \frac{12}{4} = 3 or x=−24=−12x = \frac{-2}{4} = -\frac{1}{2}. Test x=3x = 3: 2(9)−15−3=02(9) - 15 - 3 = 0. It works.

How does the derivation connect to the axis of symmetry?

Look at the finished formula as two pieces: −b2a-\frac{b}{2a} and ±b2−4ac2a\pm\frac{\sqrt{b^2 - 4ac}}{2a}. The first piece is a fixed center. The second is a distance you step left and right from it. That center is the axis of symmetry of the parabola y=ax2+bx+cy = ax^2 + bx + c, and the roots sit equally far on either side.

The derivation also contains vertex form in disguise. Multiply the squared line (x+b2a)2=b2−4ac4a2\left(x + \frac{b}{2a}\right)^2 = \frac{b^2 - 4ac}{4a^2} by aa and move everything to one side:

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

So the vertex of the parabola is (−b2a, −b2−4ac4a)\left(-\frac{b}{2a},\, -\frac{b^2 - 4ac}{4a}\right). Both vertex coordinates fall out of the same algebra that produced the roots.

Worked example 2: solve x2−6x+5=0x^2 - 6x + 5 = 0. Here a=1a = 1, b=−6b = -6, c=5c = 5, so the center is 62=3\frac{6}{2} = 3. The discriminant is 36−20=1636 - 20 = 16, so the half-width is 162=2\frac{\sqrt{16}}{2} = 2. The roots are 3±23 \pm 2, which is 11 and 55. The vertex height is −164=−4-\frac{16}{4} = -4, and indeed 32−18+5=−43^2 - 18 + 5 = -4.

Quick check

The roots of y=2x2−8x+6y = 2x^2 - 8x + 6 are symmetric about which vertical line?

Where does the discriminant come from in the derivation?

The expression b2−4acb^2 - 4ac is not chosen, it is forced. It is what remains when b24a2\frac{b^2}{4a^2} and −ca-\frac{c}{a} are put over the same denominator. Because the denominator 4a24a^2 is always positive, the sign of the right side of (x+b2a)2=b2−4ac4a2\left(x + \frac{b}{2a}\right)^2 = \frac{b^2 - 4ac}{4a^2} depends only on b2−4acb^2 - 4ac.

That one fact is the whole story of the discriminant. A real number squared cannot be negative, so a negative value means no real solution. Zero gives a single repeated root, and a positive value gives two.

When the discriminant is negative, the formula still works if you allow complex numbers, using i2=−1i^2 = -1. Worked example 3: solve x2+2x+5=0x^2 + 2x + 5 = 0.

x=−2±4−202=−2±−162=−2±4i2=−1±2ix = \frac{-2 \pm \sqrt{4 - 20}}{2} = \frac{-2 \pm \sqrt{-16}}{2} = \frac{-2 \pm 4i}{2} = -1 \pm 2i

Check with x=−1+2ix = -1 + 2i: (−1+2i)2=1−4i+4i2=−3−4i(-1 + 2i)^2 = 1 - 4i + 4i^2 = -3 - 4i. Adding 2x=−2+4i2x = -2 + 4i gives −5−4i+4i-5 - 4i + 4i… more carefully, −3−4i+(−2+4i)=−5-3 - 4i + (-2 + 4i) = -5, and −5+5=0-5 + 5 = 0. It holds.

Complex roots come in pairs

When aa, bb and cc are real, the ±\pm turns −16\sqrt{-16} into +4i+4i and −4i-4i. The two solutions are always conjugates, like −1+2i-1 + 2i and −1−2i-1 - 2i.

How can you check quadratic roots without plugging in?

Sum and product of roots 3 and −0.5 match −b over a and c over a for 2x² − 5x − 3
For 2x² − 5x − 3 = 0, the roots 3 and −0.5 add to 2.5 and multiply to −1.5, matching −b/a and c/a.

Add the two roots from the formula. The ±b2−4ac\pm\sqrt{b^2 - 4ac} parts cancel and you are left with:

x1+x2=−b+D2a+−b−D2a=−bax_1 + x_2 = \frac{-b + \sqrt{D}}{2a} + \frac{-b - \sqrt{D}}{2a} = -\frac{b}{a}

Multiply them and the difference of squares gives b2−D4a2=4ac4a2\frac{b^2 - D}{4a^2} = \frac{4ac}{4a^2}, so x1x2=cax_1 x_2 = \frac{c}{a}. These two facts let you check an answer in seconds, and they also show why a(x−x1)(x−x2)a(x - x_1)(x - x_2) equals the original quadratic, which links straight back to solving by factoring.

Test it on example 1, where the roots were 33 and −12-\frac{1}{2}. Their sum is 52\frac{5}{2}, and −ba=52-\frac{b}{a} = \frac{5}{2}. Their product is −32-\frac{3}{2}, and ca=−32\frac{c}{a} = -\frac{3}{2}. Both match, so the roots are right. If either check fails, the error is almost always a dropped sign on bb.

Try this: Solve 6x2−x−2=06x^2 - x - 2 = 0 with the formula, then check your two roots using only −ba-\frac{b}{a} and ca\frac{c}{a} before you substitute anything back.

When does the quadratic formula break or simplify?

The formula has exactly one hard failure: a=0a = 0. Then the denominator 2a2a is zero, and the equation is linear, not quadratic. Everything else works, and several cases collapse into something quicker.

  • If b=0b = 0: the equation is ax2+c=0ax^2 + c = 0 and the formula reduces to x=±−cax = \pm\sqrt{-\frac{c}{a}}.
  • If c=0c = 0: one root is always 00, and the other is −ba-\frac{b}{a}, because ax2+bx=x(ax+b)ax^2 + bx = x(ax + b).
  • If a=1a = 1: the formula becomes x=−b±b2−4c2x = \frac{-b \pm \sqrt{b^2 - 4c}}{2}, often written with pp and qq as x=−p±p2−4q2x = \frac{-p \pm \sqrt{p^2 - 4q}}{2}.
  • If b2−4acb^2 - 4ac is a perfect square: and aa, bb, cc are integers, the roots are rational and the quadratic factors over the integers.

That last case is a fast test for whether factoring is worth trying. Compute the discriminant first. If it is not a perfect square, skip factoring and finish with the formula.

Quick check

Solve 3x2−12x=03x^2 - 12x = 0 using the special case where c=0c = 0.

Where is the quadratic formula used in real life?

Any time something is launched, thrown or dropped, its height follows a quadratic in time, and the formula tells you when it lands. A ball thrown upward at 3232 feet per second from a height of 66 feet has height h(t)=−16t2+32t+6h(t) = -16t^2 + 32t + 6. It lands when h(t)=0h(t) = 0. Divide by −2-2 to simplify: 8t2−16t−3=08t^2 - 16t - 3 = 0.

t=16±256+9616=16±35216t = \frac{16 \pm \sqrt{256 + 96}}{16} = \frac{16 \pm \sqrt{352}}{16}

Since 352≈18.76\sqrt{352} \approx 18.76, the two values are t≈2.17t \approx 2.17 and t≈−0.17t \approx -0.17. The negative time is before the throw, so the ball lands after about 2.172.17 seconds. The peak comes at t=−b2a=1t = -\frac{b}{2a} = 1 second, where h(1)=22h(1) = 22 feet, the same axis-of-symmetry center from the derivation.

The same method handles areas, revenue and break-even models, as shown in quadratic word problems. To lock in the pattern with your own numbers, work through quadratic formula practice problems and compare each answer with the sum and product check above.

Practice problems

0 of 5 solved

  1. Use the quadratic formula to solve x2−7x+10=0x^2 - 7x + 10 = 0.

  2. Solve 3x2+2x−8=03x^2 + 2x - 8 = 0.

  3. Solve −2x2+3x+5=0-2x^2 + 3x + 5 = 0.

  4. Solve x2−4x+13=0x^2 - 4x + 13 = 0. Give complex solutions.

  5. Solve 4x2−4x−1=04x^2 - 4x - 1 = 0 and give the exact simplified answers.

Common questions

What is the easiest way to derive the quadratic formula?

Multiply ax2+bx+c=0ax^2 + bx + c = 0 by 4a4a, add b2−4acb^2 - 4ac to both sides to get (2ax+b)2=b2−4ac(2ax + b)^2 = b^2 - 4ac, then take square roots and solve for xx. This avoids fractions entirely.

Why do you divide by a when deriving the quadratic formula?

Completing the square works cleanly when the x2x^2 term has coefficient 11. Dividing by aa gives that, and it is allowed because a≠0a \neq 0 in any quadratic.

Why is the quadratic formula plus or minus?

Taking a square root of both sides of (x+b2a)2=b2−4ac4a2(x + \frac{b}{2a})^2 = \frac{b^2 - 4ac}{4a^2} produces two values, one positive and one negative. Each gives a different solution, which matches the two x-intercepts of a parabola.

Where does b squared minus 4ac come from?

It is the numerator that appears when b24a2\frac{b^2}{4a^2} and −ca-\frac{c}{a} are put over the common denominator 4a24a^2. It is called the discriminant because its sign decides how many real solutions exist.

Can the quadratic formula be derived without completing the square?

Yes. Substituting x=u−b2ax = u - \frac{b}{2a} removes the linear term and leaves au2=b2−4ac4aau^2 = \frac{b^2 - 4ac}{4a}, which you solve for uu. Using the vertex of the parabola gives the same result.

Does the quadratic formula work when a is negative?

Yes. The plus-or-minus sign absorbs the sign of 2a2a, so the formula holds for every nonzero aa, positive or negative. Just keep the sign of aa in the denominator.

Up next