Khayyam Math

The quadratic formula: x = (−b ± √(b² − 4ac)) / 2a

Where the formula comes from, what its three pieces mean, and when each gives you two real roots, one repeated root, or none.

012345-1123456x = 2x = 3vertex (2.5, −0.25)y = x² − 5x + 6

Try this live →

What this shows

A quadratic equation is any equation of the form

    ax² + bx + c = 0,

where a, b, c are real numbers and a is not zero. The quadratic formula gives the two roots — the x-values that satisfy the equation — directly from a, b, and c:

    x = (−b ± √(b² − 4ac)) / 2a

The ± means there are usually two solutions: one for the plus and one for the minus. The piece under the square root, called the discriminant, controls how many real solutions you actually get:

    b² − 4ac  >  0   →  two distinct real roots
    b² − 4ac  =  0   →  one repeated real root (the
                        parabola just touches the x-axis)
    b² − 4ac  <  0   →  no real roots (the parabola sits
                        entirely above or below the x-axis;
                        the roots are complex)

The figure plots y = x² − 5x + 6, where a = 1, b = −5, c = 6. The discriminant is 25 − 24 = 1, so two distinct real roots, which the formula gives as x = (5 ± 1) / 2 = 2 or 3 — exactly where the parabola crosses the x-axis on the figure.

Where it shows up

Quadratics show up wherever a quantity grows or shrinks in proportion to the square of something else: projectile motion (height as a function of time), area-to-side relationships, the shape of a hanging cable to a first approximation, the Lagrangian of a harmonic oscillator.

The formula also lets you reverse-engineer quadratics from roots: if you know a parabola has roots at r₁ and r₂, then it must be a·(x − r₁)·(x − r₂) for some a. This is how you fit a quadratic curve to two known zeros, useful in physics (a projectile's launch and landing points fix the parabola up to height scaling) and in finance (break-even analysis on cost-vs-revenue curves).

Frequently asked questions

Where does the formula come from?

Completing the square on the general form. Start with ax² + bx + c = 0, divide by a, move c/a to the right, add (b/2a)² to both sides to make the left side (x + b/2a)², take the square root, and rearrange. Every quadratic-formula derivation is one of those manipulations.

What if a = 0?

Then the equation isn't quadratic — it's linear, bx + c = 0, with the single solution x = −c/b (assuming b is also non-zero). The formula has a in the denominator, so it explicitly excludes this case.

Why ±?

Because (something)² gives the same value as (−something)². When you take √(b² − 4ac) you don't know whether the original term was the positive or negative root, so both are valid solutions.

What's the discriminant good for?

Just looking at b² − 4ac tells you how many real roots there are without actually solving the equation. Useful when you only care about existence (e.g., 'will this projectile ever hit the wall?' or 'does this curve cross zero?').

Related topics