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.
Live preview
Exactly what your visitors will seeUnder the widget on your page: Powered by A2Z Tools
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.
<div data-a2z-widget="quadratic-equation-solver" data-height="590"></div> <script async src="https://a2z.tools/embed.js"></script>
Adds a small script (what it does) that sizes the widget to fit its content, loads it lazily and keeps it isolated from your page's CSS.
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
<a href="https://a2z.tools/quadratic-equation-solver">A2Z Tools Quadratic Equation Solver</a>
[A2Z Tools Quadratic Equation Solver](https://a2z.tools/quadratic-equation-solver)
Quadratic Equation Solver by A2Z Tools - https://a2z.tools/quadratic-equation-solver
Related widgets
-
Trig in degrees or radians, logs, roots, powers, factorials, pi, e and Ans - typed or tapped.
-
Add, subtract, multiply and divide fractions and mixed numbers, with the simplified answer.
-
Mean, median, mode, range, variance, standard deviation and quartiles of any list of numbers.
-
X% of Y, X as a percent of Y, and the percentage change between two values.
-
A clean on-screen calculator with keyboard support, correct operator precedence and percent.
-
Credit-weighted GPA for a term, plus the new cumulative GPA when you add prior results.