Math Solver – Solve Equations Step by Step

· How we calculate · Free, no sign-up

Quick answer

Get x alone by doing the same operation to both sides: 2x + 3 = 11 → 2x = 8 → x = 4. For ax² + bx + c = 0 use x = (−b ± √(b² − 4ac)) / 2a, so x² − 5x + 6 = 0 gives x = 2 or x = 3.

Type any equation in x to get exact answers with every step shown. It handles linear equations, quadratics (including complex roots), cubics and higher polynomials, and even trig or exponential equations solved numerically. Separate tabs solve 2×2 and 3×3 systems and analyse a quadratic’s vertex and discriminant.

Use ^ for powers, / for fractions, brackets for grouping, e.g. 3(x-2) = 2x + 4. Functions: sqrt, abs, ln, log, sin, cos, tan, exp; constants pi, e.

How to use the math solver

  1. Equation solver: type one equation in x, such as 3(x-2) = 2x + 4, or tap an example. The answer updates as you type. If you leave out “=”, the expression is set equal to 0.
  2. System of equations: choose 2 or 3 equations, type the coefficients and pick Cramer’s rule or Gaussian elimination.
  3. Quadratic formula: enter a, b and c to get the roots, discriminant, vertex, axis of symmetry and vertex form.

Answers are exact whenever possible, as integers, fractions, simplified square roots such as 1 + √2, and complex numbers in a + bi form. A decimal is shown alongside. Each real answer is substituted back into your original equation as a check.

Solving linear equations

A linear equation has x only to the first power. Expand any brackets and collect the x terms on one side and the numbers on the other. Then divide by the coefficient of x.

3(x − 2) = 2x + 4 3x − 6 = 2x + 4 expand the bracket x − 6 = 4 subtract 2x from both sides x = 10 add 6 to both sides

Check: 3(10 − 2) = 24 and 2(10) + 4 = 24 ✓. If the x terms cancel completely, you get either a true statement such as 6 = 6, which holds for every x, or a false one such as 0 = 1, which has no solution.

Solving quadratic equations

Write the equation as ax² + bx + c = 0 and compute the discriminant D = b² − 4ac. Then apply the quadratic formula:

x = (−b ± √(b² − 4ac)) / 2a

Example: x² − 5x + 6 = 0 has a = 1, b = −5, c = 6, so D = 25 − 24 = 1. Then x = (5 ± 1) / 2, giving x = 2 or x = 3, and the quadratic factors as (x − 2)(x − 3). For x² + 2x + 5 = 0, D = 4 − 20 = −16, so the roots are complex: x = −1 ± 2i. The vertex of y = ax² + bx + c is at x = −b/2a. For 2x² − 4x − 6 that is (1, −8), and the roots are −1 and 3.

DiscriminantRoots
D > 0, perfect squareTwo rational roots; the quadratic factors
D > 0, not a perfect squareTwo irrational roots, e.g. 1 ± √2
D = 0One repeated real root, x = −b/2a
D < 0Two complex conjugate roots p ± qi

Solving cubic and higher polynomials

For x³ − 6x² + 11x − 6 = 0, the rational root theorem says any rational root divides 6. Testing ±1, ±2, ±3, ±6 shows x = 1 works. Synthetic division by (x − 1) leaves x² − 5x + 6, which factors as (x − 2)(x − 3). The solutions are x = 1, 2, 3. When no rational root exists, as in x³ − 2x − 5 = 0, the solver uses Cardano’s formula and reports x ≈ 2.094551482 plus a complex pair. There is no general formula in radicals for degree 5 and above, so those roots are found numerically.

Systems of linear equations

Cramer’s rule divides determinants. For 2x + 3y = 8 and x − y = −1, D = 2(−1) − 3(1) = −5, Dx = 8(−1) − 3(−1) = −5 and Dy = 2(−1) − 8(1) = −10. So x = −5/−5 = 1 and y = −10/−5 = 2. Gaussian elimination uses row operations to reduce the augmented matrix to reduced row-echelon form. It also handles a zero determinant. A row reading 0 = k means no solution, and a zero row means infinitely many.

Non-polynomial equations

Equations such as 2^x = 10, cos(x) = x or ln(x) = 1 have no algebraic steps in general. The solver scans x from −1000 to 1000, finds every sign change and refines it by bisection. For 2^x = 10 it returns x ≈ 3.321928095, which is log₂ 10. Periodic equations such as sin(x) = 0.5 have infinitely many solutions, so the 12 closest to zero are shown.

Sources

Embed this calculator on your website — free

Copy this code into your page. The calculator stays up to date automatically and resizes to fit.

Frequently asked questions

What kinds of equations can this math solver handle?

It handles any single equation in x. Linear, quadratic and cubic equations, and polynomials up to degree 8, are solved exactly where possible, with fractions, simplified square roots and complex roots in a + bi form. Equations with sin, cos, logs, roots or exponentials are solved numerically between −1000 and 1000. The other tabs solve systems of 2 or 3 linear equations and analyse quadratics.

How do I type powers, fractions and brackets?

Use ^ for powers (x^2), / for division (x/3 or 1/2), and brackets for grouping, as in 3(x − 2). Multiplication can be implied: 2x, 3(x+1) and (x+1)(x−2) all work. Functions are written sqrt(x), abs(x), ln(x), log(x), sin(x) and exp(x). Use pi for π.

How does the solver find roots of a cubic?

It first uses the rational root theorem. Every rational root p/q has p dividing the constant term and q dividing the leading coefficient, so it tests each candidate. When one works, synthetic division reduces the cubic to a quadratic, which the quadratic formula finishes. If no rational root exists, it uses Cardano’s method.

What does the discriminant tell me?

For ax² + bx + c = 0 the discriminant is D = b² − 4ac. If D > 0 there are two different real roots, and if D is also a perfect square they are rational, so the quadratic factors. If D = 0 there is one repeated root. If D < 0 the roots are a complex-conjugate pair.

What if a system has no solution or infinitely many?

When the coefficient determinant is 0, elimination decides. A row reading 0 = k (with k ≠ 0) means the equations contradict each other and there is no solution. A row of all zeros means one equation repeats another, giving infinitely many solutions, written in terms of a parameter t.

Are the answers checked?

Yes. Every real solution is substituted back into the left and right sides of your original equation, and both values are shown. Complex roots are checked by evaluating the polynomial at that complex number.