Linear, quadratic, cubic and higher equations and systems, with exact rational coefficients, numerically stable roots and each root substituted back to show its residual.
Initializing in your browser…
Plot functions with a real expression parser, poles drawn as gaps, and roots, turning points and integrals found by bracketing with the check printed.
Exact arithmetic on rationals, with both evaluation conventions named and the precedence table the parser runs on printed on the page.
Plot 3D surfaces from z = f(x, y), polar z = f(r, theta), or fully parametric equations. Exact evaluation via mathjs, real holes where a function is undefined, and OBJ or STL export for 3D printing.
You need the roots of x² + 200x + 0.000015 = 0, which is exactly the case a textbook formula gets wrong.
Equation
a = 1 b = 200 c = 0.000015
Solutions
x₁ = -199.999999925 x₂ = -7.50000000281e-8 textbook formula would give -7.500000265281e-8
The small root comes from c / (a × x_large) rather than from (-b + √D) / 2a, because -b and √D nearly cancel when 4ac is tiny beside b². The page prints both, says how many of the sixteen significant figures the textbook arrangement lost, and substitutes each root back so you can see the residual is zero.
Solve a linear, quadratic or cubic equation, a polynomial of any degree up to twelve, or a system of up to six linear equations. Coefficients are read as exact rational numbers, so 1/3 is a third rather than 0.333333, and every answer carries the check that decides it: each root is substituted back into the polynomial and the residual is printed.
Two things go wrong in an equation solver and both are fixed here. The first is that the textbook quadratic formula is not the definition: (-b + sqrt(b^2 - 4ac)) / 2a subtracts two nearly equal numbers whenever 4ac is small beside b squared, and the small root is destroyed. On x^2 + 200x + 0.000015 that arrangement gives -7.500000265281e-8 where the answer is -7.5000000028125e-8, eight of sixteen significant figures gone. This tool uses Forsythe's stable arrangement (the large root from the formula, the small one from the product of the roots) and prints both side by side so the difference is visible. The second is that a tolerance is not a decision: an exact float comparison against zero essentially never finds a repeated root, and an absolute singularity test calls a perfectly good system singular when its coefficients are small. Here the discriminant is an exact rational and so is the determinant of a system, so both questions are decided rather than guessed. Rational roots of any polynomial are found exactly by the rational root theorem and divided out before anything numerical runs, which is why an integer cubic gives 3 rather than 2.9999999999999996; the remaining roots come from Durand-Kerner, which iterates all of them at once, and each is checked by substitution.
Roots given exactly where they are rational, with the working shown as fractions rather than as rounded decimals.
The residual beside each root says how right it is, which is the check that needs nothing external.
Coefficients where the discriminant nearly cancels are exactly the case a textbook formula gets wrong, and the page shows both answers.
A system scaled by a thousandth is solved just as one scaled by a thousand, because the arithmetic is exact.
Up to degree twelve, with the complex roots listed alongside the real ones.
One is what the textbook quadratic formula produces and the other is what a numerically stable arrangement produces. When 4ac is small beside b squared they disagree, sometimes in the eighth significant figure, and the page says how many figures the textbook form lost.
Because the coefficients are held as exact rational numbers rather than as floating-point ones. b^2 - 4ac for 1, -1.4, 0.49 is exactly zero as a rational and is -2.220446049250313e-16 as a double, which is why an exact float comparison never finds a repeated root.
The polynomial evaluated at that root. If the root is right it is zero, and for a root found exactly it is exactly zero. Nothing external is needed to make that check, so the page makes it.
Twelve. Rational roots are found exactly at any degree; the rest come from the Durand-Kerner iteration, which finds all the roots including the complex ones.
Yes: 3/4, -1 1/2, 25% and repeating decimals written 0.(3) are all read exactly. A value it cannot read, such as 1e3, is refused with the reason rather than silently truncated to 1.
Six, in up to six unknowns, and they need not be square. When there are infinitely many solutions the free variables are named and a particular solution is given.
Every calculation runs locally in your browser. Your numbers and expressions are not transmitted or stored.