# What is x by the quadratic formula?

Solves ax² + bx + c = 0 with the quadratic formula: real or complex roots, the discriminant, and the vertex, with a graph of the parabola.

- Page: https://www.acalculator.org/math/quadratic-formula-calculator
- JSON spec: https://www.acalculator.org/math/quadratic-formula-calculator.json
- Version: 080522d19d87

## Default answer

Example with the default inputs (a 1, b -3, c 2, x value 0): For a = 1, b = -3 and c = 2, the roots are x = 1 or x = 2.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| a | a | The coefficient of x². Not 0. |
| b | b | The coefficient of x. |
| c | c | The constant term. |
| x | x value | A value of x at which to evaluate ax² + bx + c; the graph marks this point. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| roots | Roots | The solutions of ax² + bx + c = 0, such as x = 1 or x = 2, or x = −0.5 ± 1.322876i. |
| x1 | First real root (x₁) | The smaller real root. |
| x2 | Second real root (x₂) | The larger real root. |
| re | Real part | For complex roots: −b ÷ 2a. |
| im | Imaginary part | For complex roots: √(4ac − b²) ÷ 2\|a\|. |
| discriminant | Discriminant (b² − 4ac) | Positive for two real roots, 0 for one repeated root, negative for two complex roots. |
| kind | Type of roots | Two real, one repeated real, or two complex roots. |
| vertexX | Vertex x (axis of symmetry) | The x of the parabola’s turning point: −b ÷ 2a. |
| vertexY | Vertex y | The value at the turning point: c − b² ÷ 4a, the minimum (a > 0) or maximum (a < 0). |
| y | y value | ax² + bx + c at the x value. |

## Method

x = (−b ± √(b² − 4ac)) ÷ 2a, the roots of ax² + bx + c = 0 with a ≠ 0.

## Assumptions

- a must not be 0; b and c can be any real numbers, including 0.
- A negative discriminant gives two complex roots, re ± im·i, shown as text and as their real and imaginary parts.
- Real roots are listed smallest first. Roots and the vertex are shown to 6 decimal places.

## Worked examples

1. a = 1, b = -3, c = 2, x = 0 gives roots = x = 1 or x = 2, x1 = 1, x2 = 2, discriminant = 1, kind = Two real roots, vertexX = 1.5, vertexY = -0.25, y = 2. Source: hand calculation in content.mdx: D = 9 − 8 = 1, x = (3 ± 1) ÷ 2.
2. a = 2, b = 4, c = 5, x = 1 gives roots = x = -1 ± 1.224745i, re = -1, im = 1.224745, discriminant = -24, kind = Two complex roots, vertexY = 3, y = 11. Source: hand calculation in content.mdx: D = 16 − 40 = −24, x = (−4 ± √24 i) ÷ 4; Python 3: math.sqrt(24) / 4 = 1.224744871391589.
3. a = 1, b = -6, c = 9, x = 0 gives roots = x = 3, x1 = 3, x2 = 3, discriminant = 0, kind = One repeated real root, vertexY = 0. Source: hand calculation in content.mdx: D = 36 − 36 = 0, x = 6 ÷ 2 = 3.
4. a = 1, b = 0, c = -2, x = 0 gives x1 = -1.414214, x2 = 1.414214, discriminant = 8. Source: hand calculation in content.mdx: x² = 2, x = ±√2; Python 3: math.sqrt(2) = 1.4142135623730951.
5. a = -4.9, b = 20, c = 1.5, x = 2 gives x1 = -0.07367, x2 = 4.155303, vertexX = 2.040816, vertexY = 21.908163, y = 21.9. Source: hand calculation in content.mdx (a ball thrown up at 20 m/s from 1.5 m); Python 3: (-20 - math.sqrt(429.4)) / -9.8 = 4.155302961062383, (-20 + math.sqrt(429.4)) / -9.8 = -0.07367030800115855.
6. a = 1, b = 0, c = 4, x = 0 gives roots = x = ±2i, re = 0, im = 2. Source: hand calculation in content.mdx: x² = −4, x = ±2i.

## FAQ

### What is the quadratic formula?

For ax² + bx + c = 0 with a not 0, the solutions are x = (−b ± √(b² − 4ac)) ÷ 2a. The ± gives two roots: one with + and one with −. For x² − 3x + 2 = 0, x = (3 ± √1) ÷ 2, so x = 2 or x = 1.

### What does the discriminant tell me?

The discriminant D = b² − 4ac says what kind of roots there are. If D is positive there are two different real roots, and the parabola crosses the x-axis twice. If D is 0 there is one repeated root, and the parabola touches the axis at its vertex. If D is negative there are two complex roots, and the parabola does not reach the axis.

### What are complex roots?

When b² − 4ac is negative, its square root is imaginary: √−24 = √24 × i, where i = √−1. The roots then come as a pair re ± im·i. For 2x² + 4x + 5 = 0 they are x = −1 ± 1.224745i. Both parts are shown separately too.

### What is the vertex of a parabola?

The turning point of the graph of y = ax² + bx + c. Its x is −b ÷ 2a, which is also the axis of symmetry, and its y is c − b² ÷ 4a. If a is positive the parabola opens upward and the vertex is its lowest point; if a is negative it is the highest point.

### Why can a not be 0?

With a = 0 there is no x² term, so the equation bx + c = 0 is linear, not quadratic, and the formula would divide by 0. A linear equation has one root, x = −c ÷ b (when b is not 0).

### When should I factor instead of using the formula?

Factoring is quicker when the roots are small whole numbers or simple fractions: x² − 3x + 2 = (x − 1)(x − 2). The quadratic formula always works, including for roots like √2 or complex roots that do not factor over whole numbers.

## Sources

- NIST Digital Library of Mathematical Functions, section 1.11(iii) Polynomials, Quadratic Equations: https://dlmf.nist.gov/1.11
- OpenStax, Elementary Algebra 2e, section 10.3 Solve Quadratic Equations Using the Quadratic Formula: https://openstax.org/books/elementary-algebra-2e/pages/10-3-solve-quadratic-equations-using-the-quadratic-formula
