Linear Equation Solver

Enter the coefficients a, b, c, and d of ax + b = cx + d to solve for x.

a·x + b = c·x + d

x + = x +
x = 4

How this linear equation is solved

To solve ax + b = cx + d for x, first move all the x terms to one side and the constants to the other: ax − cx = d − b, which simplifies to (a − c)x = d − b. Dividing both sides by (a − c) gives x = (d − b) / (a − c).

This only works when a and c are different — if a equals c, the x terms cancel out entirely, leaving either a true statement (b equals d, so every x works) or a false one (b doesn't equal d, so no x works).

Frequently asked questions

What does it mean when there's no solution?

It means the equation simplifies to a false statement, like 5 = 8 — no value of x can make both sides equal, because the equation describes two parallel lines that never intersect.

What does it mean when there are infinite solutions?

It means both sides of the equation are actually the same line, so every value of x satisfies the equation equally.

How do I solve a simpler equation like ax + b = 0?

That's the same equation with c = 0 and d = 0, so you can use this calculator directly with those values.

Also try:

Back to category →