Worked example
Example: x² - 3x + 2 = 0. The inputs, in the units selected above:
| Input | Value |
|---|---|
| Coefficient a (of x²) | 1.0000 - |
| Coefficient b (of x) | -3.0000 - |
| Constant c | 2.0000 - |
Applying the formula below gives:
| Result | Value |
|---|---|
| Discriminant b² − 4ac | 1.0000 |
| First root (real part when complex) | 1.0000 |
| Second root (real part when complex) | 2.0000 |
| Imaginary part (0 for real roots) | 0 |
| Vertex x = −b / 2a | 1.5000 |
| Vertex value c − b² / 4a | -0.25000 |
Open this example in the calculator and change any input.
Formula
\(D = b^2 - 4ac, \quad q = -\tfrac{1}{2}\left(b + \operatorname{sign}(b)\sqrt{D}\right), \quad x_1 = \frac{q}{a},\ x_2 = \frac{c}{q}\)
\(x = -\frac{b}{2a} \pm i\,\frac{\sqrt{-D}}{2a}\ (D < 0)\)
Variables
| Symbol | Meaning | SI unit |
|---|---|---|
| \(a\) | Coefficient a (of x²) | - |
| \(b\) | Coefficient b (of x) | - |
| \(c\) | Constant c | - |
| \(D\) | Discriminant b² − 4ac | - |
| \(x_1\) | First root (real part when complex) | - |
| \(x_2\) | Second root (real part when complex) | - |
| \(\pm i\,y\) | Imaginary part (0 for real roots) | - |
| \(x_v\) | Vertex x = −b / 2a | - |
| \(y_v\) | Vertex value c − b² / 4a | - |
Method and standards
Quadratic formula in the cancellation-free form.
Where it is used
- Engineering equations of second order (projectile, quadratic losses).
- Teaching.
Common mistakes
- Sign errors in b.
- Losing precision with the textbook form.
Assumptions and limits
- a must not be zero.
References
- Quadratic formula; numerically stable form (Press et al., Numerical Recipes §5.6)
Questions and answers
What are the roots of x² − 3x + 2 = 0?
1 and 2.
And 2x² + 4x + 10 = 0?
The discriminant is −64, so the roots are complex: −1 ± 2i.
Why a 'stable' form?
When b² is much larger than 4ac, the textbook formula loses digits; q = −(b + sign(b)√D)/2 avoids it.
Method and article reviewed by FireCAD engineering on 12 November 2026. Every result is checked against an independent calculation on each release: how we verify our calculators.