Calcamaze

Quadratic Formula Calculator

Solve ax² + bx + c = 0 for real or complex roots, with the discriminant, vertex and axis of symmetry.

Result

Roots
x = 2, x = 3
Equation
x² − 5x + 6 = 0
Discriminant (b² − 4ac)
1
Positive: two real roots
Vertex
(2.5, -0.25)
Minimum point — the parabola opens upward
Axis of symmetry
x = 2.5
y-intercept
(0, 6)

Enter the coefficients a, b and c of a quadratic equation ax² + bx + c = 0 to find its roots — the values of x that make it true. The calculator also gives the discriminant, which tells you how many real solutions there are, and the vertex of the parabola y = ax² + bx + c.

Any equation of the form ax² + bx + c = 0 can be solved with the quadratic formula, even when it won’t factor neatly. The discriminant, b² − 4ac, tells you before you finish whether there are two real answers, one or none.

What is the quadratic formula?

A quadratic equation is one where the highest power of the unknown is 2: ax² + bx + c = 0 with a ≠ 0. Its graph, y = ax² + bx + c, is a U-shaped curve called a parabola, and the solutions of the equation — the roots — are where the parabola crosses the x-axis.

The quadratic formula, x = (−b ± √(b² − 4ac)) ÷ 2a, solves every quadratic equation, including ones that cannot be factorised neatly. It comes from completing the square on the general equation. The ± gives the two roots, one on either side of the axis of symmetry x = −b ÷ 2a.

Quadratics turn up wherever something grows with a square: the path of a thrown ball, the area of a shape with an unknown side, profit that rises then falls with price, and stopping distances.

How to use the quadratic formula calculator

  1. Rearrange your equation so that one side is 0.
  2. Enter a, b and c, including any minus signs.
  3. Read the roots, the discriminant and the vertex.

Formula

x = (−b ± √(b² − 4ac)) ÷ 2a

The discriminant D = b² − 4ac decides the type of answer: D > 0 gives two different real roots, D = 0 gives one repeated root, and D < 0 gives a pair of complex roots p ± qi.

The vertex is at x = −b ÷ 2a, which is also the axis of symmetry; substitute it back in to get the y-value.

Worked examples

Two real roots

a (x² coefficient)
2
b (x coefficient)
-4
c (constant)
-6
Roots
x = -1, x = 3
Equation
2x² − 4x − 6 = 0
Discriminant (b² − 4ac)
64

D = (−4)² − 4 × 2 × (−6) = 16 + 48 = 64, and √64 = 8. So x = (4 ± 8) ÷ 4, giving -1 and 3.

A ball thrown upward

a (x² coefficient)
-4.9
b (x coefficient)
20
c (constant)
1.5
Roots
x = -0.07367, x = 4.155303
Equation
−4.9x² + 20x + 1.5 = 0
Discriminant (b² − 4ac)
429.4

Height h = −4.9t² + 20t + 1.5 metres. Setting h = 0 gives t = -0.0737 and 4.1553; only the positive time makes physical sense, so the ball lands after about 4.16 seconds.

Complex roots

a (x² coefficient)
1
b (x coefficient)
2
c (constant)
5
Roots
x = -1 ± 2i
Equation
x² + 2x + 5 = 0
Discriminant (b² − 4ac)
-16

D = 2² − 4 × 1 × 5 = −16, which is negative, so there are no real roots. √−16 = 4i, giving x = (−2 ± 4i) ÷ 2 = -1 ± 2i.

What the discriminant tells you

EquationDiscriminant b² − 4acRoots
x² − 5x + 6 = 012 and 3
x² − 6x + 9 = 003 (double)
x² + 0x − 2 = 08-1.4142 and 1.4142
x² + 2x + 5 = 0-16-1 ± 2i
3x² + 2x − 1 = 016-1 and 0.3333

Where quadratics come from

Anything thrown upwards follows a quadratic path. A ball thrown up at 20 m/s from 1.5 m has height h = −4.9t² + 20t + 1.5. Setting h = 0 and solving gives t ≈ 4.16 s for when it lands; the other root is negative and has no physical meaning here. Areas, profit curves and braking distances also lead to quadratics.

Common mistakes

  • Dropping the sign of b. If b = −5, then −b = +5 and b² = 25 — put negative coefficients in brackets when substituting.
  • Dividing only the square root by 2a. The whole numerator, −b ± √D, is divided by 2a.
  • Forgetting to move everything to one side first. The formula only works when the equation is in the form ax² + bx + c = 0.
  • Stopping at a negative discriminant and writing “no solution” when complex roots are expected.
  • Dropping the minus sign in −b. For x² − 5x + 6, b is −5, so −b is +5.

Frequently asked questions

What if a is 0?

Then there is no x² term and the equation bx + c = 0 is linear, with the single solution x = −c ÷ b. The quadratic formula would divide by zero, so the calculator asks for a non-zero a.

What does a negative discriminant mean?

The parabola never crosses the x-axis, so there are no real solutions. The two roots are complex numbers of the form p ± qi, where i = √−1.

How do I put an equation into standard form?

Move every term to one side so the other side is 0, then collect like terms. For 2x² = 3x + 5, subtract 3x and 5 to get 2x² − 3x − 5 = 0, so a = 2, b = −3 and c = −5.

Should I factor or use the formula?

Factor when the numbers make it easy, as with x² − 5x + 6 = (x − 2)(x − 3). The formula always works, including for decimals and equations that don’t factor.

Sources

  1. Quadratic Equation, Wolfram MathWorld
  2. Intermediate Algebra 2e, 9.3: Solve Quadratic Equations Using the Quadratic Formula, OpenStax, Rice University

Last updated · Calculations checked by automated tests· Editorial policy