A quadratic equation solver that takes the three coefficients of
ax² + bx + c = 0 and returns everything you need: the two roots (real or
complex), the discriminant, the vertex and axis of symmetry of the
parabola, and a numbered, copyable derivation that shows exactly how the answer
was reached. It is built for students checking homework, teachers preparing
worked examples, and anyone who needs a fast, reliable solution without
installing software or sending data anywhere.
The quadratic formula, and why the discriminant decides everything
A quadratic is any equation that can be written in the standard form
ax² + bx + c = 0, where a is not zero. The solver applies the quadratic
formula:
x = (−b ± √(b² − 4ac)) ⁄ 2a
The quantity under the square root, b² − 4ac, is the discriminant and it
controls the whole result. When the discriminant is positive the square root is
a real number and the ± produces two distinct real roots. When it is
exactly zero the ± collapses to a single value, giving one repeated real
root that sits right on the vertex. When the discriminant is negative the
square root is imaginary, so the solver writes the two roots as a complex
conjugate pair p ± qi.
Alongside the roots, the tool computes the axis of symmetry at
x = −b ⁄ 2a and substitutes that value back into the function to find the
vertex — the turning point of the parabola. If you set a to zero the
equation degenerates to a linear one, bx + c = 0, and the solver handles that
case too, reporting the single root x = −c ⁄ b (or flagging an identity or
no-solution when b is also zero).
Worked example
Take x² − 3x + 2 = 0, so a = 1, b = −3, c = 2. The discriminant is
Δ = (−3)² − 4(1)(2) = 9 − 8 = 1, which is positive, so expect two real roots.
The square root of 1 is 1, and the formula gives
x = (3 ± 1) ⁄ 2, that is x = 2 and x = 1. The axis of symmetry is
x = 3 ⁄ 2 = 1.5, and the vertex is (1.5, −0.25) — the lowest point of an
upward-opening parabola. You can verify the roots by factoring:
(x − 1)(x − 2) = 0.
Now try x² + 1 = 0, where a = 1, b = 0, c = 1. The discriminant is
0 − 4 = −4, which is negative, so the roots are complex: x = ±i. The solver
reports them as 0 + 1i and 0 − 1i, a perfect conjugate pair.
| Equation | Discriminant | Roots |
|---|---|---|
| x² − 3x + 2 = 0 | 1 | 2 and 1 |
| x² − 4x + 4 = 0 | 0 | 2 (double root) |
| x² + 1 = 0 | −4 | 0 ± 1i |
| 2x² + 4x − 6 = 0 | 64 | 1 and −3 |
Vieta’s formulas: a fast way to check any answer
For any quadratic ax² + bx + c = 0 with roots x₁ and x₂, Vieta’s
formulas state that the roots always satisfy:
- Sum:
x₁ + x₂ = −b ⁄ a - Product:
x₁ · x₂ = c ⁄ a
They work for complex roots too. In the first example above, the roots 2 and 1
sum to 3 (matching −b/a = 3/1) and multiply to 2 (matching c/a = 2/1) — a
ten-second sanity check that catches most sign mistakes. Teachers often use
Vieta’s relations in reverse: to build a quadratic with chosen roots r and
s, expand (x − r)(x − s) = x² − (r + s)x + rs.
Completing the square, and where the formula comes from
The quadratic formula is not a magic recipe — it is the result of completing
the square on the general equation. Divide through by a, move the constant
across, and add (b/2a)² to both sides:
x² + (b/a)x = −c/a → (x + b/2a)² = (b² − 4ac) / 4a²
Taking the square root of both sides and isolating x produces exactly the
formula the solver uses. Completing the square is also how the vertex form
f(x) = a(x − h)² + k is derived, with h = −b/2a and k = f(h) — the same
vertex coordinates this tool reports.
Where quadratics show up in real problems
- Projectile motion. Height as a function of time is quadratic:
h(t) = h₀ + v₀t − ½gt². Solvingh(t) = 0(a quadratic int) gives the time an object hits the ground; the vertex gives the peak height. - Profit and pricing. Revenue models of the form
price × quantitywhere demand falls linearly with price produce a quadratic in price; the vertex is the revenue-maximising price. - Geometry. Fixing the perimeter of a rectangle and asking for a target area leads directly to a quadratic in one side length.
- Physics and engineering. Uniform acceleration (
s = ut + ½at²), resonance calculations, and lens equations all reduce to quadratics.
Common mistakes the step-by-step working helps you catch
- Dropping the sign of b. With
b = −3, the formula’s−bterm is+3. Writing−3there flips both roots. - Dividing only part of the numerator by 2a. The entire expression
−b ± √Δis divided by2a, not just the square-root term. - Declaring “no solution” for negative discriminants. There is no real solution, but there are always two complex roots — which matter in electronics, control theory and signal processing.
- Forgetting to rearrange into standard form first. An equation like
3x² = 5x − 1must become3x² − 5x + 1 = 0before reading offa,b,c.
For deeper treatment of the formula’s derivation and history, Wolfram MathWorld’s Quadratic Equation entry covers the algebra rigorously, and Britannica’s quadratic equation article traces the methods back to Babylonian mathematics — the problem is four thousand years old; only the notation is new.
Every figure is computed in your browser — no numbers are uploaded or stored.