Quadratic Equation Solver Widget

Add a quadratic equation solver to your algebra lessons. Students enter a, b and c and see the roots - real, repeated or complex - together with the discriminant, the vertex of the parabola and its axis of symmetry.

Education & Math Calculator Runs in your browser Free · no ads

Customize your widget

Theme
Auto follows the visitor's light/dark setting.
Style
Attribution on your page
Optional and entirely your choice. The exact line is shown in the code below; it links to the tool with rel="nofollow".
More options
Starting values
Leave blank to use the widget's defaults. Visitors can still change every value.

Live preview

Exactly what your visitors will see

Embed code

<iframe src="https://a2z.tools/embed/w/quadratic-equation-solver" title="Quadratic Equation Solver by A2Z Tools" width="100%" height="590" style="border:0;width:100%" loading="lazy" allow="clipboard-write"></iframe>

A plain iframe. Works everywhere, including site builders that strip scripts. Adjust height if your content needs more room.

Works with

How it works

The discriminant decides the case: positive gives two real roots, zero one repeated root, negative a complex-conjugate pair written p +/- qi. Real roots are computed with the numerically stable form of the quadratic formula, which avoids the loss of digits the textbook form suffers when b is large compared with a and c. If a is 0 the equation is linear and the widget solves bx + c = 0 and says so, including the cases of no solution and every x.

Calculation method

  • Discriminant D = b^2 - 4ac
  • Roots x = (-b +/- sqrt(D)) / 2a, computed as q = -(b + sign(b) sqrt(D)) / 2, x1 = q / a, x2 = c / q
  • D < 0: x = -b / 2a +/- (sqrt(-D) / 2|a|) i
  • Vertex = (-b / 2a, c - b^2 / 4a); axis of symmetry x = -b / 2a
  • a = 0: x = -c / b

Worked examples

Two real roots

Inputs: a = 1, b = -3, c = 2

Result: D = 1; x = 2 and x = 1; vertex (1.5, -0.25)

x^2 - 3x + 2 factorises as (x - 1)(x - 2).

Limitations

  • Real coefficients only, and roots are decimals - exact surd forms such as 1 + sqrt(2) are not written out.
  • Quadratics only: cubic and higher-degree equations, and systems of equations, are not solved.
  • No graph of the parabola is drawn.

Where publishers use it

  • Algebra and pre-calculus lesson pages
  • Homework-help sites where students verify their factorising
  • Physics pages on projectile motion that reduce to a quadratic
  • Revision guides that explain what the discriminant tells you

Questions

What does a negative discriminant mean?

The parabola never crosses the x-axis, so there are no real roots. The equation still has two complex roots, which the widget shows as p + qi and p - qi.

Why use a different form of the quadratic formula?

When b^2 is much larger than 4ac, subtracting two nearly equal numbers in (-b + sqrt(D)) loses precision. The stable form gives the same roots without that error - for x^2 + 10^8 x + 1 = 0 it returns -1e-8 correctly.

What if a is 0?

Then it is a linear equation, bx + c = 0, and the widget solves that instead of dividing by zero.

How many digits are shown?

Up to 10 significant digits, with very large or small roots in exponent form.

Cite or recommend this tool

If you reference this tool in an article, course or documentation, these formats are ready to copy. They are optional - nothing is added to your site unless you paste it.

A2Z Tools Quadratic Equation Solver
https://a2z.tools/quadratic-equation-solver

Preview