Equation solver

Linear, quadratic, cubic and 2–3 equation systems, with exact roots and steps.

ax² + bx + c = 0

Whole numbers, decimals or fractions such as 3/4. An empty box counts as 0.

Solution

x² + 2x − 2 = 0

x = −1 ± √3

  • x₁ = −1 + √3 ≈ 0.7320508076
  • x₂ = −1 − √3 ≈ −2.732050808

Step by step

  1. Discriminant: Δ = b² − 4ac = 2² − 4·1·(−2) = 12.
  2. Δ > 0: two different real roots.
  3. Simplify the square root: √12 = 2√3.
  4. Quadratic formula: x = (−b ± √Δ) / (2a) = (−2 ± 2√3) / 2.
  5. Vertex of the parabola: (−b/(2a), c − b²/(4a)) = (−1, −3).
  6. Check (Vieta): the roots add up to −b/a = −2 and multiply to c/a = −2.

What this tool does

It solves four kinds of equation and shows how: a linear equation ax + b = 0, a quadratic ax² + bx + c = 0, a cubic ax³ + bx² + cx + d = 0, and a system of two or three linear equations in x, y and z. You type the coefficients; the answer and the working update as you type.

Coefficients are read as exact fractions, not as floating-point numbers. Type 0.1 and the solver works with 1/10; type 2/3 and it works with two thirds. That is why the answers come out the way a textbook writes them: x = −1 ± √3 rather than 0.7320508076 and −2.732050808 (both decimals are shown as well), x = −1/2 rather than −0.5000000001, and a system answer of x = 5/7 rather than a rounded decimal.

How to use it

  1. Pick the tab: Linear, Quadratic, Cubic or System.
  2. Type the coefficients. A missing term is 0, so for 2x² − 3 = 0 type a = 2, leave b empty, and c = −3. Decimals use a dot; fractions use a slash.
  3. Read the roots in the result box, then the step by step list under it. Copy puts the roots on the clipboard as plain text.
  4. For a system, choose 2 or 3 equations and fill one row per equation: the coefficients of x, y (and z), then the right-hand side.

How each kind is solved

Quadratic. The discriminant Δ = b² − 4ac decides everything. For x² + 2x − 2 = 0, Δ = 4 + 8 = 12. Twelve is 4 × 3, so √12 = 2√3, and the formula x = (−b ± √Δ)/(2a) gives (−2 ± 2√3)/2 = −1 ± √3. When Δ is a perfect square the roots are fractions and the tool also writes the factored form: x² − 5x + 6 = (x − 3)(x − 2). When Δ = 0 there is one double root (4x² + 4x + 1 = 0 gives x = −1/2). When Δ is negative the roots are complex: x² + 2x + 5 = 0 has Δ = −16 and roots −1 ± 2i. You also get the vertex of the parabola and a check that the roots add up to −b/a and multiply to c/a. The article what the discriminant tells you works through more examples.

Cubic. First the rational root test: any fraction that solves a cubic with whole coefficients must be ±p/q, with p dividing the constant and q dividing the leading coefficient. For x³ − 6x² + 11x − 6 the candidates are ±1, ±2, ±3, ±6; x = 1 works, dividing it out leaves x² − 5x + 6, and the roots are 1, 2 and 3. When no candidate works the roots are irrational and are found numerically: the trigonometric method when the cubic discriminant is positive (three real roots), Cardano's formula when it is negative (one real root and a complex pair). x³ − 2 = 0 gives ∛2 ≈ 1.25992105 and −0.6299605249 ± 1.091123636i. Every numerical answer is substituted back into the equation and the largest leftover is shown, so you can see the roots really work.

Systems. The equations become an augmented matrix and the tool runs Gauss–Jordan elimination with exact fractions, listing every row operation and the matrix after it. It reports one solution, no solution (a row that says 0 = 1) or infinitely many, written with a parameter: x + 2y = 4 and 2x + 4y = 8 give x = 4 − 2t, y = t.

Limits worth knowing

Roots are exact whenever the algebra allows: fractions, square roots and cube roots of a single number. A cubic like x³ − 3x + 1 = 0 has three real roots that cannot be written with real square and cube roots alone (the "casus irreducibilis"), so they are shown as decimals to ten significant digits. Square roots are simplified by pulling out square factors below 100 000, which covers anything typed by hand. Quartic and higher equations are not solved here; to see where any function crosses zero, plot it with the function grapher. For larger linear systems, determinants and inverses, use the matrix calculator, and for plain arithmetic the scientific calculator.

Frequently asked questions

What does the discriminant tell me?

For ax² + bx + c = 0 it is Δ = b² − 4ac. Positive: two different real roots. Zero: one repeated root, where the parabola just touches the x-axis. Negative: no real roots, but two complex roots that are conjugates of each other. If Δ is a perfect square and the coefficients are whole numbers, the roots are fractions and the quadratic factors neatly.

Why does it show −1 ± √3 instead of a decimal?

Because that is the exact answer. The solver works with fractions, so it can keep √3 as √3 instead of rounding it. The decimals (0.7320508076 and −2.732050808) are shown next to it for when you need a number.

Can I type fractions or decimals as coefficients?

Yes. 3/4, −2.5 and 1e-3 all work and are converted to exact fractions. A comma is also read as a decimal point in a single number, so 2,5 means 2.5. An empty box counts as 0.

What happens if the leading coefficient is 0?

The equation drops a degree and the tool says so: a quadratic with a = 0 is solved as the linear equation bx + c = 0, and a cubic with a = 0 as a quadratic. A linear equation with a = 0 has either no solution (b ≠ 0) or every x as a solution (b = 0).

How accurate are the cubic roots that are not exact?

They are computed in double precision, refined with Newton's method and shown to ten significant digits. The last step substitutes every root back into the equation and shows the largest remaining error, typically around 10⁻¹⁵.

Does it say when a system has no solution or infinitely many?

Yes. Elimination either finds a pivot for every variable (one solution), produces a row reading 0 = c with c not zero (no solution), or leaves variables without a pivot. Those become parameters t and s, and every other variable is written in terms of them.