Linear Equation Solver

A linear equation has x only to the first power, such as 3x + 5 = x + 13. This linear equation solver collects the x terms on one side and the numbers on the other, then divides to find x. It handles fractions exactly and detects equations with no solution or infinitely many solutions.

Try:

How to use the linear equation solver

  1. Write your equation in the form ax + b = cx + d.
  2. Enter a, b, c and d (use 0 for any missing term).
  3. Press Calculate to see x, every step and the substitution check.

Formula

ax+b=cx+d⇒x=d−ba−cax + b = cx + d \Rightarrow x = \frac{d - b}{a - c}

Worked example: 3x + 5 = x + 13

  • a (x on the left): 3
  • b (number on the left): 5
  • c (x on the right): 1
  • d (number on the right): 13

✓ Answer checked

x=4x = 4
Step-by-step working (4 steps)
  1. Start with the equation

    Write the equation in the form ax + b = cx + d.

    3x+5=x+133x + 5 = x + 13
  2. Collect x terms on the left Do the same to both sides

    Subtract x from both sides.

    2x+5=132x + 5 = 13
  3. Move the number to the right Do the same to both sides

    Subtract 5 from both sides.

    2x=82x = 8
  4. Divide by the coefficient Do the same to both sides

    Divide both sides by 2.

    x=82=4x = \frac{8}{2} = 4
Formulas used
ax+b=cx+d⇒x=d−ba−cax + b = cx + d \Rightarrow x = \frac{d - b}{a - c}
How this was checked
  • ✓ Putting x = 4 into the original equation: left side = 17, right side = 17.

Frequently asked questions

How do I solve a linear equation?

Do the same thing to both sides until x is on its own. Collect x terms on one side, move the numbers to the other, then divide by the number in front of x.

What if there is no x on the right-hand side?

Enter 0 for c. For example, 2x − 7 = 11 is a = 2, b = −7, c = 0, d = 11.

Can a linear equation have no solution?

Yes. If the x terms cancel and leave a false statement like 2 = 5, there is no solution. If they leave a true statement like 0 = 0, every x works.

Related calculators

Related guides