Skip to content

Equation Solver: Solve for x Online

Solve any equation in x, with steps for linear and quadratic ones.

Your details

Angle unit

Results update as you type

Solutions

x = 5

Real solutions
1
Type
Linear equation

Step-by-step solution
  1. 3x + 5 = 20
  2. 3x = 20 − 5
  3. 3x = 15
  4. x = 15 ÷ 3 = 5
  5. Check: 20 = 20

Type an equation the way you would write it on paper — 3x + 5 = 20, x^2 - 5x + 6 = 0, 2^x = 10, sin(x) = 0.5 — and this equation solver finds the values of x that make both sides equal.

How it solves depends on the equation:

  • Linear equations (first degree) are solved exactly, with the classic steps: move the x terms to one side, the numbers to the other, then divide.
  • Quadratic equations are solved with the discriminant and the quadratic formula, including exact answers with square roots such as 5±132\frac{5 \pm \sqrt{13}}{2}.
  • Everything else — cubic and higher polynomials, exponential, logarithmic, trigonometric or absolute-value equations — is solved numerically: the solver scans an interval you choose (−100 to 100 by default), catches every sign change and every point where the curve just touches zero, and refines each root to about 15 significant digits.

When a numerical root is a simple fraction or a multiple of π, the exact form is shown too. Each answer is checked by substituting it back into both sides.

How to use this calculator

  1. Type the equation with x as the unknown. Use ^ for powers, * or nothing for multiplication (2x, 3(x+1)), and / for division. Without an "=" sign the expression is set equal to 0.
  2. Available functions: sqrt, ln (natural log), log (base 10), exp, sin, cos, tan, their inverses asin, acos, atan, and abs. Constants: pi, e.
  3. For trigonometric equations, choose radians or degrees.
  4. For equations solved numerically, adjust the search interval if you expect solutions beyond −100…100.
  5. Read the solutions, the exact form when there is one, and open the steps.

The formula

Linear equation. Any first-degree equation can be rearranged to ax+b=0ax + b = 0 with a≠0a \neq 0, so

x=−bax = -\frac{b}{a}

If a=0a = 0, there is either no solution (b≠0b \neq 0) or every xx is a solution (b=0b = 0).

Quadratic equation. For ax2+bx+c=0ax^2 + bx + c = 0, the discriminant Δ=b2−4ac\Delta = b^2 - 4ac decides the number of real roots, and

x=−b±Δ2ax = \frac{-b \pm \sqrt{\Delta}}{2a}

Other equations. Write f(x)=left−rightf(x) = \text{left} - \text{right}. If ff is continuous on [xi,xi+1][x_i, x_{i+1}] and f(xi)f(x_i) and f(xi+1)f(x_{i+1}) have opposite signs, the intermediate value theorem guarantees a root between them. Bisection halves that interval about 50 times, until it is as narrow as floating-point numbers allow.

Worked example

Linear: 3x+5=203x + 5 = 20. Subtract 5: 3x=153x = 15. Divide by 3: x=5x = 5. Check: 3×5+5=203 \times 5 + 5 = 20.

Quadratic: x2−5x+6=0x^2 - 5x + 6 = 0 gives Δ=25−24=1\Delta = 25 - 24 = 1, so x=5±12x = \frac{5 \pm 1}{2}: x1=2x_1 = 2 and x2=3x_2 = 3.

Exponential: 2x=102^x = 10. Taking logarithms, x=ln⁡10ln⁡2x = \frac{\ln 10}{\ln 2}, and the solver returns x=3.3219280949x = 3.3219280949.

Trigonometric: sin⁡(x)=0.5\sin(x) = 0.5 in degrees between −100 and 100 gives x=30x = 30. In radians the same interval holds 63 solutions, from x=−97.9129710369x = -97.9129710369 upwards; the two closest to 0 are π6≈0.5235987756\frac{\pi}{6} \approx 0.5235987756 and 5π6≈2.617993878\frac{5\pi}{6} \approx 2.617993878, and the solver shows these exact forms with π.

Limits of numerical solving

A numerical solver only sees what happens at the points it samples. With 20,000 points, two roots closer together than the grid step can be missed, and a function that oscillates extremely fast (such as sin⁡(1/x)\sin(1/x) near 0) cannot be resolved completely. Roots exactly at the edge of the domain (for example x−2=0\sqrt{x - 2} = 0) may also be missed. Narrow the interval around a suspected root to get a finer grid. Complex roots are not searched, except for quadratics, where they are given in a note.

Frequently asked questions

How do I solve for x?

Isolate x by doing the same operation to both sides: add or subtract to move terms, then multiply or divide to remove the coefficient. For 3x + 5 = 20, subtract 5 (3x = 15), then divide by 3 (x = 5). The solver shows these steps for every linear equation.

How do I solve an exponential equation like 2^x = 10?

Take the logarithm of both sides: x · ln 2 = ln 10, so x = ln 10 ÷ ln 2 ≈ 3.3219. Type 2^x = 10 and the solver finds the same value numerically.

Why do I get several solutions for sin(x) = 0.5?

Trigonometric functions repeat, so the equation has infinitely many solutions. The solver lists those inside the search interval. Choose degrees and the interval 0 to 360 to get the two classic answers, 30 and 150.

What does "every real number is a solution" mean?

After simplifying, both sides are identical, for example 2(x + 1) = 2x + 2. Such an equation is an identity: any x makes it true. The opposite case, such as x + 1 = x + 2, has no solution at all.

Can it solve systems of equations or equations with two unknowns?

No. This solver handles one equation in one unknown, x. For a straight line through two points use the line equation calculator, and for quadratics with full detail use the quadratic formula calculator.

Last updated:

More Math calculators

People also use