Algebra & Functions

Linear Equation Solver

Enter the four numbers in ax + b = cx + d. The solver moves the x terms to one side, isolates x, and substitutes back to prove the result — including the special cases with no solution or infinitely many.

Try an example:
Answerx = −12
Step-by-step working 4 steps
  1. 1
    Write the equation
    3x + 5 = 2x − 7
  2. 2
    Collect the x terms on the left
    3x − 2x = −7 − 5
    x = −12

    Subtract the smaller x term and the constant from both sides, so x is alone on the left and numbers are on the right.

  3. 3
    Divide by the coefficient of x
    x = −12 ÷ 1 = −12
  4. 4
    Check by substituting back
    Left: 3(−12) + 5 = −31
    Right: 2(−12) − 7 = −31

    Both sides match, so the solution is correct.

How to use the linear equation solver

  1. Write your equation in the form ax + b = cx + d.
  2. Enter a, b, c, d. Use 0 for a missing term.
  3. Read x and the check at the end.
  4. If the solver reports no solution, the two sides are parallel lines.

Solving ax + b = cx + d

(a − c)x = d − b
x = (d − b) / (a − c)
If a = c and b ≠ d → no solution;  if a = c and b = d → every x works

Whatever you do to one side of an equation you must do to the other.

Worked examples

Each example below is generated by the same calculator you used above, so the working always matches the answer.

3x + 5 = 2x − 7
Answerx = −12
Step-by-step working 4 steps
  1. 1
    Write the equation
    3x + 5 = 2x − 7
  2. 2
    Collect the x terms on the left
    3x − 2x = −7 − 5
    x = −12

    Subtract the smaller x term and the constant from both sides, so x is alone on the left and numbers are on the right.

  3. 3
    Divide by the coefficient of x
    x = −12 ÷ 1 = −12
  4. 4
    Check by substituting back
    Left: 3(−12) + 5 = −31
    Right: 2(−12) − 7 = −31

    Both sides match, so the solution is correct.

4x = 10
Answerx = 2.5
Step-by-step working 4 steps
  1. 1
    Write the equation
    4x = 10
  2. 2
    Collect the x terms on the left
    4x − 0 = 10 − 0
    4x = 10

    Subtract the smaller x term and the constant from both sides, so x is alone on the left and numbers are on the right.

  3. 3
    Divide by the coefficient of x
    x = 10 ÷ 4 = 2.5
  4. 4
    Check by substituting back
    Left: 4(2.5) + 0 = 10
    Right: 0(2.5) + 10 = 10

    Both sides match, so the solution is correct.

2x + 3 = 2x + 5
AnswerNo solution
  • The sides can never be equal.
Step-by-step working 3 steps
  1. 1
    Write the equation
    2x + 3 = 2x + 5
  2. 2
    Collect the x terms on the left
    2x − 2x = 5 − 3
    0x = 2

    Subtract the smaller x term and the constant from both sides, so x is alone on the left and numbers are on the right.

  3. 3
    Result

    0 = 2 is never true, so there is no solution.

2x + 3 = 2x + 3
AnswerInfinitely many solutions
  • The two sides are identical, so every x works.
Step-by-step working 3 steps
  1. 1
    Write the equation
    2x + 3 = 2x + 3
  2. 2
    Collect the x terms on the left
    2x − 2x = 3 − 3
    0x = 0

    Subtract the smaller x term and the constant from both sides, so x is alone on the left and numbers are on the right.

  3. 3
    Result

    0 = 0 is always true: every real number is a solution.

Common mistakes to avoid

Moving a term without changing its sign

When a term crosses the equals sign, it changes sign — or, equivalently, you subtract it from both sides.

Dividing only one side

Divide both sides by the coefficient of x. Dividing just the right-hand number leaves the equation unbalanced.

Skipping the check

Substituting your answer back takes ten seconds and catches nearly every slip.

Frequently asked questions

What does “no solution” mean?

After simplifying you reach a false statement such as 0 = 2. The two sides are never equal for any x.

What does “infinitely many solutions” mean?

The two sides are the same expression, so every x makes the equation true.