๐ Quadratic Equation Solver
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
- Enter the coefficients a, b, and c (a must not be 0).
- 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).