Algebra formulas

Quadratic equation

Enter the coefficients a, b, and c to calculate the discriminant and all real or complex roots of ax² + bx + c = 0.

Formula

x=−b±b2−4ac2a x = (-b ± √(b² - 4ac)) / 2a

For a non-zero leading coefficient a, the discriminant Δ = b² - 4ac determines the number and form of the roots.

Quadratic equation calculator

Equation coefficients

Equation

1x² + -3x + 2 = 0

The result updates automatically. You may use a decimal point.

Solution

Two real roots

Discriminant Δ
1
Roots
x₁ = 2
x₂ = 1

Δ = b² − 4ac = 1

x = (−b ± √Δ) / (2a)

Symbols and units

SymbolQuantitySISupported units
aquadratic coefficientCoefficient of x²; it must not equal zero.11
blinear coefficientCoefficient of x.11
cconstant termConstant term independent of x.11

Formula rearrangements

Calculate the discriminant

Δ = b² - 4ac

Two real roots when Δ > 0

x₁,₂ = (-b ± √Δ) / 2a

One repeated root when Δ = 0

x₀ = -b / 2a

Worked examples

Equation with two real roots

Solve x² - 5x + 6 = 0.

  1. 1Step 1: Identify a = 1, b = -5, and c = 6.
  2. 2Step 2: Calculate Δ = (-5)² - 4 × 1 × 6 = 1.
  3. 3Step 3: Substitute into the quadratic formula to obtain roots 2 and 3.

Result: Δ = 1; x₁ = 2, x₂ = 3

Equation with one repeated root

Solve x² + 2x + 1 = 0.

  1. 1Step 1: Identify a = 1, b = 2, and c = 1.
  2. 2Step 2: Calculate Δ = 2² - 4 × 1 × 1 = 0.
  3. 3Step 3: Use x₀ = -b / 2a to obtain the repeated root -1.

Result: Δ = 0; x₀ = -1

Sources and review