๐Ÿ“ˆ Quadratic Equation Solver

xยฒ +x += 0
xโ‚ =2
xโ‚‚ =1
Discriminant (bยฒ โˆ’ 4ac)1

Enter the coefficients of a quadratic equation in the form axยฒ + bx + c = 0, and this tool automatically solves for its roots using the quadratic formula. If the discriminant is negative, complex roots are shown too. Useful for checking math homework.

How to use

  1. Enter the coefficients a, b, and c (a must not be 0).
  2. Depending on the sign of the discriminant, real roots, a repeated root, or complex roots are shown automatically.

How the calculation works

This tool solves the quadratic equation axยฒ + bx + c = 0 (a โ‰  0). It first computes the discriminant D = bยฒ โˆ’ 4ac to determine the kind of solutions: โ€ข D > 0: two distinct real roots โ€ข D = 0: one repeated real root โ€ข D < 0: two complex roots The real roots equal (โˆ’b ยฑ โˆšD) รท 2a, but the tool computes them in a numerically stable way. When bยฒ is much larger than 4ac, the textbook formula subtracts two nearly equal numbers and loses most of the digits of the smaller root. Instead it computes q = โˆ’(b + sign(b) ร— โˆšD) รท 2, then xโ‚ = q รท a and xโ‚‚ = c รท q.

Worked example

xยฒ โˆ’ 3x + 2 = 0 D = 9 โˆ’ 8 = 1 Roots: x = 2, x = 1 xยฒ + 2x + 5 = 0 D = 4 โˆ’ 20 = โˆ’16 Roots: x = โˆ’1 + 2i, x = โˆ’1 โˆ’ 2i xยฒ + 100000000x + 1 = 0 Roots: about โˆ’0.00000001 and โˆ’100000000 (the textbook formula gives โˆ’0.00000000745 for the smaller one)

Things to be aware of

  • If a is 0 the equation is not quadratic, so it cannot be solved here.
  • The roots add up to โˆ’b รท a and multiply to c รท a (Vieta's formulas), which is handy for checking answers.
  • Calculations use floating-point numbers, so irrational roots such as โˆš2 are shown as approximations.

FAQ

What is the discriminant?

It's the value bยฒ โˆ’ 4ac. A positive value means two distinct real roots, zero means a repeated root, and a negative value means complex roots.

What happens if I enter 0 for a?

If a is 0 the equation is no longer quadratic, so no result is shown. Solve it as a linear equation instead.

How do I read a complex root result?

It's shown in the form "real part ยฑ imaginary part ร— i", where i is the imaginary unit (โˆš-1).