Equation Solver
Solve linear, quadratic and cubic equations in x, with real and complex roots, or systems of two or three linear equations, right in your browser.
This tool processes all data locally on your device.
Input
Output
Type an equation in one variable, like 2x^2 - 3x - 2 = 0, up to cubic. Write powers with ^. Without an equals sign, the expression is set equal to 0.
Readme
What equations can it solve?
- One equation in one variable that is linear, quadratic or cubic once both sides are multiplied out, like 2x + 4 = 10, 2x^2 - 3x - 2 = 0 or x^3 - 6x^2 + 11x - 6 = 0. Brackets and products such as (x - 1)(x + 2) = 4 are multiplied out for you.
- A system of 2 or 3 linear equations in as many variables, like 2x + 3y = 12 and x - y = 1.
The variable may also sit in a denominator, as in 1/x = 2. The solver then leaves out any value that would divide by zero, so (x^2 - 1)/(x - 1) = 0 has the single solution x = -1.
Writing equations
- Write powers with ^, as in x^2. A number right before a variable multiplies it, so 2x is 2 times x; * works too.
- Use brackets, decimals with a point and fractions with /. The constants pi and e are known.
- Any single letter can be the variable: 3t + 2 = 11 is solved for t.
- An expression without an equals sign is set equal to 0, so x^2 - 9 solves x^2 - 9 = 0.
- In a system, write each equation on its own line, or separate them with semicolons. The terms can be on either side of the equals sign, in any order.
Reading the results
- Roots are named x₁, x₂ and x₃, real roots first from smallest to largest, then complex ones.
- A quadratic or cubic can have complex roots, written as a + bi, where i is the square root of -1. They come in pairs like -1 - 2i and -1 + 2i.
- A root that counts twice, like the root of x^2 - 2x + 1 = 0, shows once as x₁ = x₂.
- Results are rounded to 12 significant digits, which hides the tiny rounding errors of computer arithmetic, and each has a copy button.
- When the variable cancels out, the solver tells you whether every value solves the equation (x + 1 = x + 1) or none does (x + 1 = x).
- A system gets the value of each variable in alphabetical order. When its equations contradict each other or say the same thing twice, it has no single solution, and the solver says so.
How it works
The solver uses the math.js library. For one equation it subtracts the right side from the left, multiplies the result out into a polynomial and finds its roots with the closed formulas for linear, quadratic and cubic equations. For a system it reads the number in front of each variable in every equation and solves the equations together by LU decomposition.
Examples
- 2x + 4 = 10: x = 3
- 2x^2 - 3x - 2 = 0: x₁ = -0.5, x₂ = 2
- x^2 - 2x + 1 = 0: x₁ = x₂ = 1
- x^2 + 2x + 5 = 0: x₁ = -1 - 2i, x₂ = -1 + 2i
- x^3 = 8: x₁ = 2, and the complex roots -1 - 1.73205080757i and -1 + 1.73205080757i
- 2x + 3y = 12 and x - y = 1: x = 3, y = 2
- x + y + z = 6, 2y + 5z = -4 and 2x + 5y - z = 27: x = 5, y = 3, z = -2
Features
- Linear, quadratic and cubic equations
- Real and complex roots, with double and triple roots marked
- Systems of 2 or 3 linear equations
- Any letter as the variable, brackets and fractions
- Copy any result
- Runs in your browser
Comments
Tool info
Created
Last updated
Tags
equation solverlinear equationquadratic equationcubic equationsystem of equationssimultaneous equationsrootscomplex rootsalgebrasolve for x
Similar Tools
Enter a birth date to find your age on Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune and Pluto, and the date of your next birthday on each of them.
Calculate with trigonometric functions in degrees or radians, logarithms, powers, roots, factorials, π and e, using the keypad or your keyboard. Runs in your browser.
Add, subtract, multiply and divide fractions and mixed numbers, and get the answer in lowest terms, as a mixed number and as a decimal.
Powered By
Embed
Embed this tool anywhere for free. Need help? Check out our guide.
Disclaimer
The tools provided on this website are designed to assist users in solving various problems. While we strive to ensure that the tools are accurate and effective, we do not guarantee or warrant that the output of any tool will be 100% accurate or error-free. The results generated by these tools are provided as-is and should be used with caution. We recommend that users verify any important information or results with additional resources or professional advice, as we cannot be held responsible for any consequences arising from the use of these tools. By using this website, you agree to assume all risks associated with the accuracy and use of the results provided.