What This Calculator Does
The Quadratic Formula Calculator solves any quadratic equation written in the standard form \(ax^2 + bx + c = 0\). You enter the three coefficients and the tool returns the roots (solutions) of the equation. Crucially, it handles all three possible cases automatically: two distinct real roots, one repeated real root, or two complex (imaginary) roots. You never have to decide in advance which case applies — the calculator checks the discriminant for you.
The Inputs You Provide
- Coefficient a — the number multiplying \(x^2\) (must not be 0, or the equation is not quadratic).
- Coefficient b — the number multiplying \(x\).
- Coefficient c — the constant term.
All three can be positive, negative, whole numbers, or decimals. The calculator tidies the output so whole-number answers display without a trailing ".0".
The Formula Explained
The result comes from the classic quadratic formula:
$$x = \frac{-b \pm \sqrt{b^{2} - 4ac}}{2a}$$
The expression under the square root, \(b^2 - 4ac\), is called the discriminant, and it decides the type of answer:
- Discriminant > 0: two distinct real roots.
- Discriminant = 0: one real root, equal to \(-b / 2a\).
- Discriminant < 0: two complex roots, written as a real part \((-b / 2a)\) plus or minus an imaginary part \((\sqrt{-\text{discriminant}} / 2a)\) followed by "i".
Worked Example
Suppose \(a = 1\), \(b = -3\), \(c = 2\). The discriminant is $$(-3)^2 - 4(1)(2) = 9 - 8 = 1,$$ which is positive, so there are two real roots:
- $$x = \frac{3 + \sqrt{1}}{2} = \frac{3 + 1}{2} = \mathbf{2}$$
- $$x = \frac{3 - \sqrt{1}}{2} = \frac{3 - 1}{2} = \mathbf{1}$$
For \(a = 1\), \(b = 0\), \(c = 1\), the discriminant is \(0 - 4 = -4\) (negative), giving the complex roots \(0 + 1i\) and \(0 - 1i\).
Frequently Asked Questions
What if I enter 0 for coefficient a? The equation is no longer quadratic, and dividing by \(2a\) (which becomes 0) produces an undefined result. Always use a non-zero value for a.
Why do I sometimes get complex roots? When the discriminant is negative, the parabola never crosses the x-axis, so there are no real solutions — only complex ones expressed with the imaginary unit "i".
Can I use decimal coefficients? Yes. The calculator accepts decimals and negative numbers, and it displays exact whole numbers cleanly while keeping decimal precision where needed.