Equation Solver

Solve linear, quadratic and cubic equations and 2 or 3 simultaneous equations, with steps

One letter as the variable. Brackets, fractions (x/3) and decimals work. 3x means 3 × x.
Try an example
Solution
x = 5
3x + 5 = 20
Step-by-step solution
  1. Move x terms to the left and numbers to the right (change the sign when a term crosses =)
    3x = 20 − 5
    (5 moves to the right as −5)
  2. Combine like terms
    3x = 15
  3. Divide both sides by 3
    x = 15 ÷ 3 = 5
  4. Check by putting the answer back
    Left side = 20, right side = 20. They match.

Runs entirely in your browser. Nothing you type or upload is sent to us or stored.

Results are for general guidance. Please check anything important before relying on it. Terms of use

How to Use

  1. Pick the kind of equation from the tabs at the top: Linear, Quadratic, Cubic or System.
  2. For a linear equation, type it as you would write it, for example 3x + 5 = 20 or 2(x − 3) = x + 4. For a quadratic or cubic, enter the coefficients a, b, c (and d), or type the whole equation in "Or type the equation" and tap Fill.
  3. For simultaneous equations, choose 2 or 3 equations, then type them (2x + 3y = 7) or switch to Coefficient grid and fill in the numbers.
  4. The answer appears as you type, in exact form (fractions and surds) with decimals where useful. Scroll down for the step-by-step solution. Use copy result for just the answer, copy with steps to paste the full working into your notes, and clear to empty the boxes and start again.

One equation solver for linear, quadratic, cubic and simultaneous equations

This equation solver handles the four kinds of equations you meet from Class 8 to Class 12 and in JEE practice: a linear equation in one variable, a quadratic, a cubic, and a system of two or three linear equations. You can type the equation the way it appears in your book. The answer comes out exact (7/3, not 2.3333), and every step is shown so you can check your own working rather than just copy an answer.

Linear equations: move, combine, divide

A linear equation has the variable only to the first power. The method is always the same: bring the x terms to one side and the numbers to the other (a term changes its sign when it crosses the = sign), combine like terms, then divide by the coefficient of x.

2(x − 3) = x + 4
2x − 6 = x + 4
2x − x = 4 + 6
x = 10

If the x terms cancel, you get either a false statement like 0 = 2 (no solution) or a true one like 0 = 0 (every value of x works). The solver tells you which.

Quadratic equations

For ax² + bx + c = 0 the solver finds the discriminant D = b² − 4ac, states the nature of the roots, and uses x = (−b ± √D) / 2a. Roots stay exact: x² + 2x − 7 = 0 gives x = −1 ± 2√2. When D is negative the roots are shown as complex numbers in the form a ± bi, which is how you write them from Class 11 onwards.

Cubic equations and the rational root test

For ax³ + bx² + cx + d = 0 with whole-number coefficients, any rational root must be ±(a factor of d) ÷ (a factor of a). The solver lists these candidates and tries each one. Once a root r is found, synthetic division leaves a quadratic, which is then solved exactly.

Example: x³ − 6x² + 11x − 6 = 0. The candidates are ±1, ±2, ±3, ±6. Putting x = 1 gives 1 − 6 + 11 − 6 = 0, so (x − 1) is a factor and the equation becomes (x − 1)(x² − 5x + 6) = 0. The roots are 3, 2 and 1.

When there is no rational root, as with x³ − 2x − 5 = 0, the roots are found numerically (Cardano's formula or the trigonometric method) and shown to six decimal places: here x ≈ 2.094551, plus a pair of complex roots. The cubic discriminant Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d² tells you in advance what to expect:

DiscriminantRoots
Δ > 0Three different real roots
Δ = 0All roots real, at least two equal
Δ < 0One real root and two complex roots

Systems of linear equations

For two equations a₁x + b₁y = c₁ and a₂x + b₂y = c₂, the solver works out D = a₁b₂ − a₂b₁ and, when D ≠ 0, uses Cramer's rule: x = Dx/D and y = Dy/D. For 2x + 3y = 7 and x − y = 1, D = −5, Dx = −10 and Dy = −5, so x = 2 and y = 1.

When D = 0 there is no single answer. The Class 10 ratio test explains why:

  • a₁/a₂ ≠ b₁/b₂: the lines cross at one point (a unique solution).
  • a₁/a₂ = b₁/b₂ ≠ c₁/c₂: the lines are parallel, so there is no solution.
  • a₁/a₂ = b₁/b₂ = c₁/c₂: both equations describe the same line, so there are infinitely many solutions. The solver writes them in general form, such as x = 2 − y.

Three equations in x, y and z work the same way with 3×3 determinants. Behind the scenes the solver row-reduces the equations with exact fractions, so it can also tell a system with no solution from one with infinitely many when the determinant is 0. This is the "consistency of a system" question that comes up in Class 12 matrices and in JEE Main.

Tips

  • 3x means 3 × x, and 2(x + 1) means 2 × (x + 1). Use ^ or ² for powers: x^2 or x².
  • Fractions are fine: x/3 + x/4 = 7 gives x = 12. You can't divide by an expression containing x, so multiply both sides by it first.
  • Always substitute the answer back into the original equation. The solver does this check for you in the last step.

Frequently Asked Questions

Subtract 5 from both sides to get 3x = 15, then divide by 3 to get x = 5. In general, move the x terms to one side and the numbers to the other, combine them, and divide by the number in front of x.

Compare the ratios of the coefficients. If a₁/a₂ = b₁/b₂ but this is not equal to c₁/c₂, the lines are parallel and there is no solution. For x + y = 2 and 2x + 2y = 5, the ratios are 1/2, 1/2 and 2/5, so there is no solution.

It says any rational root p/q of a polynomial with whole-number coefficients has p dividing the constant term and q dividing the leading coefficient. For 2x³ − 3x² − 3x + 2 = 0, the candidates are ±1, ±2 and ±1/2, and testing them gives the roots 2, 1/2 and −1.

No. A cubic with real coefficients always has at least one real root, because its graph goes from very negative to very positive values and must cross the x-axis. It can have one real root and two complex roots, as x³ − 1 = 0 does: x = 1 and x = (−1 ± √3 i)/2.

For a system with determinant D ≠ 0, each unknown equals its own determinant divided by D: x = Dx/D, y = Dy/D (and z = Dz/D for three equations). Dx is D with the x column replaced by the right-hand sides. If D = 0, Cramer's rule can't be used and the system has either no solution or infinitely many.

Yes. Coefficients like 0.5 or 1/3 and equations like x/3 + x/4 = 7 all work. The solver keeps fractions exact, so answers come out as 7/3 rather than 2.333333, with the decimal shown alongside.