What Is the Quadratic Formula and When Should You Use It?

The quadratic formula isn't magic, it's completing the square, solved once and for all. Here's where it comes from, what the discriminant tells you before you even solve, and when you don't need it at all.

By Petrus Sheya

July 26, 2026 · 5 min read

Ever thrown a ball and wondered exactly where it's going to land?

Its path traces a curve, a parabola, rising then falling back to the ground. You could watch it and guess. Or you could work out, in advance, exactly where it touches down.

That second option is what the quadratic formula gives you. Not a guess. An exact answer, every time, for any parabola.

That's the whole point of it. A shortcut for finding where a curve crosses zero, built from a much older trick called completing the square.


What does "solving" a quadratic even mean?

A quadratic equation looks like ax2+bx+c=0ax^2 + bx + c = 0. "Solving" it means finding the values of xx that make it true.

Here's the visual version of that idea: plot y=ax2+bx+cy = ax^2 + bx + c as a curve, and the solutions are exactly where that curve crosses the x-axis. We call those crossing points the roots.

A parabola can cross the x-axis twice, touch it once, or miss it entirely. Same shape of equation, three completely different outcomes, depending on where the curve happens to sit.

Slide c up and down. Watch the parabola rise and fall, and the roots appear, merge, and vanish exactly where the curve meets the x-axis.

y = x² − 4x + c
Discriminant16.0
Real roots2
x-intercepts0.00, 4.00

Slide cc and watch it happen. Two roots become one, then none, as the parabola lifts clear of the axis. The number of solutions isn't fixed. It depends on where the curve lives.


Why does completing the square even work?

Before we get to the formula, we need one trick: completing the square. And the best way to understand it isn't algebra. It's geometry.

Picture x2+bxx^2 + bx as an actual square of side xx, with a rectangle of width bb stuck to one edge. Split that rectangle in half and wrap the two halves around two sides of the square instead. You're left with an L-shape... and a small bite missing from the corner.

Fill in that missing corner, a tiny square of side b/2b/2, and something clicks: the whole shape becomes one clean, complete square.

x² + bx is a square with a strip attached. Slide b, then add the small missing corner, (b/2)², and the whole thing becomes one clean square.

(b/2)x(b/2)x(b/2)²side = x + b/2
Missing corner (b/2)²4.00
Completed identityx² + 4.0x + 4.00 = (x + 2.0

That missing corner has area (b/2)2(b/2)^2. Add it to both sides of the equation and you've turned a messy expression into a perfect square. That one geometric move is the entire engine behind the quadratic formula.


From completed square to the formula

Now we write it down. Start with the general equation:

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

Divide through by aa, move c/ac/a to the other side, then complete the square on the left exactly like we just did with the tiles:

x2+bax=cax^2 + \frac{b}{a}x = -\frac{c}{a} (x+b2a)2=b24a2ca\left(x + \frac{b}{2a}\right)^2 = \frac{b^2}{4a^2} - \frac{c}{a}

Take the square root of both sides, remembering there are two of them, positive and negative:

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

Move the b/2ab/2a over, and there it is:

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

No new ideas here, just the geometric trick from the last section, written out symbolically and solved once for every possible aa, bb, cc. That's why it works for literally any quadratic.


What does the discriminant tell you before you even solve?

Look closely at the formula and one piece stands out: the stuff under the square root, b24acb^2 - 4ac. We call it the discriminant.

Here's the thing... you don't need to finish solving to know what kind of answer you're going to get. The sign of the discriminant tells you in advance.

Positive, and you get two distinct real roots. Zero, and the two roots collide into one repeated root. Negative, and there's no real square root to take, so the roots become a pair of complex numbers instead.

Hit play and watch b sweep back and forth. When the discriminant crosses zero, the two roots collide, then fly off into the complex plane.

-6-4-20246real rootscomplex planeReIm
Discriminant-8.00
Roots-1.00 ± 1.41i

Hit play and watch bb sweep back and forth. Right as the discriminant crosses zero, the two roots merge, then peel off the real number line entirely and reappear as mirror-image points in the complex plane. The discriminant is a preview of the answer, before you've done any of the work.


Do you always need the formula?

Not always. And here's the interesting part: if you already know (or can guess) the roots of a parabola, you can build the whole equation backward, no formula involved.

If r1r_1 and r2r_2 are the roots, then y=(xr1)(xr2)y = (x - r_1)(x - r_2) is the parabola. Expand it and you get b=(r1+r2)b = -(r_1 + r_2) and c=r1r2c = r_1 r_2, a pair of relationships called Vieta's formulas.

Drag either root along the x-axis. The parabola, and its a, b, c, rebuild themselves instantly, no formula required when you already know the roots.

Roots-2.00, 3.00
b = −(sum)-1.00
c = product-6.00
y = 1.00x 6.00

Drag either root and watch bb and cc update instantly, just sum and multiply. If a quadratic factors nicely into small whole numbers, spotting those roots by eye is faster than grinding through the formula. The quadratic formula is for when factoring fails, not a replacement for it.


The short version

The quadratic formula comes from completing the square, done once, symbolically, so you never have to redo the geometry by hand. The discriminant, b24acb^2 - 4ac, tells you upfront whether you're getting two real roots, one repeated root, or a complex pair. And when the roots are easy to spot by factoring, skip the formula altogether, since Vieta's formulas turn root-guessing into a shortcut of its own.

Use the formula when factoring isn't obvious. Use the discriminant when you just need to know what kind of answer to expect. That's the whole toolkit.


All visualizations are interactive React components running entirely in your browser. The discriminant animation uses requestAnimationFrame with a bouncing sweep of b. No libraries beyond React.