Quadratic equation solver

Free quadratic equation solver: discriminant, exact and decimal roots, factored and vertex forms, sign table and a graph of the parabola.

Your equation

x² − 2x − 2 = 0

a, b and c between −1 billion and 1 billion: whole numbers, decimals (point or comma) or fractions (3/4); a must not be 0. Exact roots with simplified radicals and decimals rounded to 4 places, from a numerically stable formula.

CALCULATION RECEIPT- / - / -
Solutionsx₁ = 1 − √3x₂ = 1 + √3

Δ = 12 > 0: two solutions, x₁ = 1 − √3 and x₂ = 1 + √3.

Sign of the trinomial
x−∞x₁ ≈ −0.73x₂ ≈ 2.73+∞
f(x)+0−0+
Your equationx² − 2x − 2 = 0
Discriminant ΔΔ = 12
Rootsx₁ ≈ −0.7321 ; x₂ ≈ 2.7321
Factored form(x − (1 − √3))(x − (1 + √3))
Canonical (vertex) form(x − 1)² − 3
VertexS(1, −3)
Sum of the roots2
Product of the roots−2
Sign of the trinomialthe sign of a (positive) outside the roots, the opposite sign between x₁ and x₂
PDF: receipt, chart and detailed table.

Step-by-step solution

  1. Identify the coefficients:

    a = 1, b = −2, c = −2
  2. Work out the discriminant Δ = b² − 4ac:

    Δ = (−2)² − 4 × 1 × (−2) = 4 + 8 = 12
  3. Δ > 0: the equation has two real solutions, x = (−b ± √Δ) / 2a. Simplify √Δ:

    √12 = 2√3
  4. First solution:

    x₁ = (2 − 2√3) / 2 = 1 − √3 ≈ −0.7321
  5. Second solution:

    x₂ = (2 + 2√3) / 2 = 1 + √3 ≈ 2.7321
  6. Factored form a(x − x₁)(x − x₂):

    (x − (1 − √3))(x − (1 + √3))
  7. Canonical form a(x − α)² + β, with α = −b / 2a and β = −Δ / 4a:

    α = 1, β = −3 → (x − 1)² − 3
  8. Sum and product of the roots:

    x₁ + x₂ = −b/a = 2 ; x₁ × x₂ = c/a = −2
  9. Sign of the trinomial: the sign of a (positive) outside the roots, the opposite sign between x₁ and x₂.

What does this tool do?

This solver handles any quadratic equation ax² + bx + c = 0. It works out the discriminant Δ, tells you whether there are two solutions, one double solution or none in the real numbers, and gives each solution in exact form, with simplified square roots such as 1 + √3, and as a decimal.

It also shows everything a teacher may ask next: the factored form, the vertex (canonical) form a(x − α)² + β, the vertex S, the sum and product of the roots, the sign of the quadratic in a table, and a graph of the parabola with its roots and vertex. When Δ is negative you can display the two complex solutions.

It is written for students in Morocco and elsewhere, from the first year of lycée to the baccalauréat. If a is 0, the equation is of the first degree: use the linear equation solver instead.

How to use it

  1. Enter a, b and c of ax² + bx + c = 0 (a must not be 0). A missing term counts as 0.
  2. Read Δ, then the solutions: two, one double or no real solution depending on the sign of Δ.
  3. See the step-by-step working, the factored and vertex forms, the sign table and the parabola.

Coefficients can be whole numbers, negative numbers, decimals with a point or a comma, or fractions such as 3/4. With whole numbers or fractions, the results are written as fractions, as in textbooks. The result updates as you type, and Share copies a link to the same equation.

Calculation method

Δ = b² − 4ac
Δ > 0: x₁ = (−b − √Δ) / 2a, x₂ = (−b + √Δ) / 2a  ·  Δ = 0: x₀ = −b / 2a  ·  Δ < 0: S = ∅ in ℝ
ax² + bx + c = a(x − α)² + β, α = −b / 2a, β = −Δ / 4a  ·  x₁ + x₂ = −b / a, x₁ × x₂ = c / a

Everything starts from the discriminant Δ = b² − 4ac. If Δ is positive, its square root exists and the formula x = (−b ± √Δ) / 2a gives two different solutions. If Δ is zero, both are the same number, −b / 2a. If Δ is negative, there is no real square root, so there is no real solution.

The calculator keeps the coefficients as exact fractions and simplifies the square root: √12 = √(4 × 3) = 2√3, so (2 ± 2√3) / 2 becomes 1 ± √3. For the decimals it uses a numerically stable formula, which finds the root of larger size first and the other one from x₁ × x₂ = c / a, so tiny roots stay accurate.

The vertex form comes from α = −b / 2a and β = −Δ / 4a. The vertex S(α ; β) is the lowest point of the parabola when a is positive and the highest when a is negative.

Worked example

Example 1: solve 2x² − 3x − 2 = 0

  1. Coefficients: a = 2, b = −3, c = −2.
  2. Discriminant: Δ = (−3)² − 4 × 2 × (−2) = 9 + 16 = 25, and √25 = 5.
  3. Δ > 0, so two solutions: x₁ = (3 − 5) / 4 = −1/2 and x₂ = (3 + 5) / 4 = 2.
  4. Factored form: 2(x + 1/2)(x − 2), which is also (2x + 1)(x − 2).

S = {−1/2 ; 2}. Check: the sum is 3/2 = −b/a and the product is −1 = c/a.

Another scenario: a garden of 40 m²

  1. A rectangular garden is 3 m longer than it is wide and covers 40 m². With width x: x(x + 3) = 40, so x² + 3x − 40 = 0.
  2. Δ = 3² − 4 × 1 × (−40) = 9 + 160 = 169, and √169 = 13.
  3. x₁ = (−3 − 13) / 2 = −8 and x₂ = (−3 + 13) / 2 = 5. A width cannot be negative, so x = 5.

The garden is 5 m wide and 8 m long: 5 × 8 = 40 m².

Understanding the results

The sign of Δ

Δ > 0: two solutions, the parabola crosses the x axis twice. Δ = 0: one double solution, it touches the axis at its vertex. Δ < 0: no real solution, the parabola stays above the axis when a > 0 and below when a < 0.

Exact roots and radicals

For x² − 2x − 2 = 0, Δ = 12 is not a perfect square. The calculator writes √12 = 2√3 and gives x = 1 − √3 and x = 1 + √3, about −0.7321 and 2.7321. Keep the exact form in an exercise.

Vertex form and vertex

The same example can be written (x − 1)² − 3. Its vertex is S(1, −3), and since a = 1 is positive, −3 is the smallest value the expression can take.

Sign of the quadratic

The quadratic has the sign of a outside its roots and the opposite sign between them. The sign table on the receipt shows it with the values of x₁ and x₂, ready for an inequality such as x² − 2x − 2 < 0.

Tips and limitations

  • Put the equation in the form ax² + bx + c = 0 first: move every term to one side.
  • Write brackets around negative numbers when you replace them: (−3)², not −3².
  • Check your roots with the sum −b/a and the product c/a.
  • For a pure number check, the scientific calculator evaluates expressions such as (3 + sqrt(17)) / 4.

Mistakes to avoid

  • Forgetting that b² is always positive or zero: (−3)² = 9.
  • Dividing only √Δ by 2a instead of the whole numerator −b ± √Δ.
  • Keeping a negative length or price in a word problem without checking it makes sense.
  • Writing “no solution” for Δ < 0 in a course on complex numbers, where there are two.

Frequently asked questions

How do I calculate the discriminant?

Δ = b² − 4ac. For 2x² − 3x − 2 = 0: Δ = (−3)² − 4 × 2 × (−2) = 9 + 16 = 25. The sign of Δ tells you how many solutions the equation has.

What if the discriminant is negative?

The equation has no real solution and the quadratic keeps the sign of a. With complex numbers, the two solutions are z = (−b ± i√(−Δ)) / 2a: tick the box to show them.

What is a double root?

When Δ = 0, the two solutions are the same: x₀ = −b / 2a. The parabola touches the x axis at a single point, its vertex.

What if a = 0?

Then there is no x² term and the equation is of the first degree. The calculator says so and links to the linear equation solver.

Why not use the usual formula for the decimals?

When b² is much larger than 4ac, as in x² + 100000000x + 1 = 0, subtracting two almost equal numbers loses the small root. The stable formula avoids that subtraction.