Solve any quadratic equation \(ax^2 + bx + c = 0\). Compute discriminant, real or complex roots, vertex coordinates, and visualize the parabola with interactive graph.
The quadratic formula provides the roots of any quadratic equation \(ax^2 + bx + c = 0\) (with \(a \neq 0\)):
\[ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \]
The expression under the square root, \(\Delta = b^2 - 4ac\), is called the discriminant. It determines the nature of the roots:
The vertex of the parabola is at \(\left(-\frac{b}{2a}, f\left(-\frac{b}{2a}\right)\right)\), and the axis of symmetry is the vertical line \(x = -\frac{b}{2a}\).
Our tool reads coefficients a, b, c as floating-point numbers. It first validates that a ≠ 0. Then it computes the discriminant using high-precision JavaScript numbers. If Δ ≥ 0, real roots are computed directly; if Δ < 0, the complex roots are expressed as \(p \pm qi\) where \(p = -\frac{b}{2a}\) and \(q = \frac{\sqrt{|\Delta|}}{2a}\). The vertex and axis of symmetry are derived from the standard form.
The interactive graph draws the parabola over a suitable x-range (automatically adjusted to show vertex and roots). The canvas uses a coordinate transformation that maps mathematical coordinates to pixel space. For complex-root cases, the graph still shows the parabola (which does not intersect the x-axis), and the vertex is highlighted.
The quadratic formula has been known for millennia. Babylonian mathematicians (c. 2000 BCE) solved quadratic equations geometrically. The modern algebraic form was developed by Persian mathematician Muhammad ibn Musa al-Khwarizmi (c. 780–850 CE) in his book "The Compendious Book on Calculation by Completion and Balancing" — the source of the word "algebra". The symbol \(\pm\) was introduced by Albert Girard in 1631, and the familiar formula using a, b, c became standard in the 17th century.
| Discriminant (Δ) | Nature of Roots | Example | Graph Intersection |
|---|---|---|---|
| Δ > 0 | Two distinct real roots | x² - 5x + 6 = 0 → roots 2, 3 | Crosses x-axis at two points |
| Δ = 0 | One real double root | x² - 4x + 4 = 0 → root 2 (double) | Tangent to x-axis at vertex |
| Δ < 0 | Two complex conjugate roots | x² + 2x + 5 = 0 → -1 ± 2i | No x-axis intersection |
A ball is thrown upward from height 1.5 m with initial velocity 15 m/s. Its height \(h(t) = -4.9t^2 + 15t + 1.5\). Using the quadratic formula, we find when it hits the ground (\(h=0\)): \(t \approx 3.21\) seconds (positive root). This real-time solver helps physics students verify kinematic problems instantly. The vertex gives the maximum height at \(t = -b/(2a) \approx 1.53\) seconds, height ≈ 13.0 m.