One equation solver for algebra homework, engineering checks and quick roots
This equation solver takes an equation as you would write it on paper — x^3 + x − 2 = 0, 3(x − 2) = 2x + 1, cos(x) = x — and returns every solution with the working shown. Polynomial equations are solved exactly: linear and quadratic equations always, cubic and quartic (and higher) equations whenever they have rational roots, with surds such as (−1 ± i√7)/2 for the remaining quadratic factor. When no short exact form exists, the roots are computed numerically to about 15 significant digits and clearly labelled as numeric.
Switch to System of linear equations to solve two to six unknowns by Gauss–Jordan elimination. The augmented matrix is shown after every pivot, the solution is checked by substitution, and for square systems up to 4×4 Cramer’s rule is worked as a cross-check. Systems with no solution or infinitely many solutions are recognised and described, free variables included.
Everything runs in your browser. Only non-polynomial equations load math.js (Apache-2.0) from a CDN, to parse functions such as sin, exp and log for the numeric root search.
How to use the Equation Solver
- Choose “Single equation” or “System of linear equations”.
- Type the equation. Use ^ for powers (or ², ³), * or simple juxtaposition for multiplication (2x, 3(x − 1)), / for division and brackets freely. If there is no “=”, the expression is set equal to 0.
- For trig, exponential or logarithmic equations, set the search range — the solver finds every real root between “from” and “to”. Name the variable if the equation contains other letters.
- For a system, write one equation per line using letters or names such as x, y, z or x1, x2.
- Read the solutions in the result panel, then follow the numbered steps, check the graph of f(x) with its roots marked, and use “Copy LaTeX” or “Copy solution” to take the working with you.
Equation Solver features
Exact algebra
Coefficients are handled as exact fractions, so roots of 2x² − x − 1 appear as 1 and −1/2, not 0.49999.
Rational root theorem, shown
For cubics and quartics the candidate roots p/q are listed, tested exactly and divided out by synthetic division, just as the method is taught.
Numeric fallback for everything else
Sign-change scanning, bisection and Newton polishing find the real roots of equations like e^x = 3x or sin(x) = x/2 in a range you choose, with residuals reported.
Systems with full working
Augmented matrix, every row operation, rank, unique / infinite / no solution verdicts and Cramer’s rule for square systems.
Graph near the roots
An SVG plot of f(x) with each real root marked lets you see multiplicity and near-misses at a glance.
LaTeX and plain-text export
Equations and solutions copy as LaTeX; the steps copy as numbered plain text.
How the solver decides what to do
The input is first read as a polynomial with exact rational coefficients. If that succeeds, the degree determines the method; if it fails because the equation contains a function, a variable in a denominator or a non-integer power, the numeric solver takes over.
| Degree / type | Method | Result |
|---|---|---|
| 1 (linear) | Isolate x | Exact fraction |
| 2 (quadratic) | Discriminant and quadratic formula | Exact: rational, surd or complex |
| 3, 4 and higher | Rational root theorem + synthetic division, then the quadratic formula on the last factor | Exact when enough rational roots exist; otherwise numeric (Durand–Kerner + Newton) |
| Non-polynomial | Scan for sign changes, bisection, Newton | Numeric real roots in the search range |
| Linear system | Gauss–Jordan elimination (+ Cramer’s rule check) | Exact unique, parametric or “no solution” |
Worked example: x³ + x − 2 = 0
The constant term is −2 and the leading coefficient is 1, so by the rational root theorem any rational root must be one of ±1, ±2. Substituting x = 1 gives 1 + 1 − 2 = 0, so x = 1 is a root. Synthetic division by (x − 1) leaves x² + x + 2. Its discriminant is 1 − 8 = −7, so the quadratic formula gives x = (−1 ± i√7)/2. The equation therefore has one real solution, x = 1, and two complex conjugate solutions, as the graph crossing the axis exactly once confirms.
Had there been no rational root — for example x³ − 2 = 0 — the solver reports the real root numerically (1.259921…, which is ∛2) and the complex pair, and says so.
Tips and limits
- For quadratics on their own, the quadratic equation solver also gives the vertex, axis of symmetry and a parabola plot.
- Numeric mode only finds real roots inside the search range, and only where f changes sign or touches zero; widen the range if a root is missing. Jumps such as those of tan(x) or 1/x are detected and ignored.
- A system is “linear” when each unknown appears to the first power and is not multiplied by another unknown. Products like xy or x² are refused with a clear message.
- The matrix calculator performs the same elimination on any matrix you type, and the determinant calculator expands the determinants that Cramer’s rule uses.
Equation Solver FAQ
How do I solve a cubic equation with this equation solver?
Type it as written, for example x^3 − 6x^2 + 11x − 6 = 0. The solver lists the rational-root candidates, tests them, divides out each root and solves the remaining quadratic exactly, giving x = 1, 2, 3 here.
Can it solve equations with sin, cos, e or log?
Yes. Equations that are not polynomials are solved numerically. Set the search range (default −10 to 10) and the solver returns every real root in it with the residual |f(x)| for each.
Does it solve simultaneous equations with three unknowns?
Yes — up to six unknowns and eight equations. Switch to system mode, enter one equation per line, and you get the augmented-matrix elimination, the solution and a Cramer’s-rule cross-check for square systems.
What does “Infinitely many solutions” mean?
The equations are consistent but not independent, so one or more unknowns are free. The solver expresses the others in terms of the free variables, for example x = 3 − y − z.
Why is a root shown as numeric instead of exact?
An exact closed form only exists in a readable way when the polynomial factors over the rationals down to quadratic pieces. If it does not — such as x³ − 2 = 0 or most quartics — the roots are irrational numbers that are best given numerically.
Is anything sent to a server?
No. Parsing and solving happen in your browser.