A linear equation with x on both sides is solved by collecting the x terms on one side and the constants on the other. From ax + b = cx + d you get (a − c)x = d − b, so x = (d − b) ÷ (a − c). The whole method rests on doing the same thing to both sides, which keeps the equality intact.
The interesting cases are the ones where that division fails. If a equals c the two sides have the same gradient, so they are parallel lines. Should the constants also match, every value of x works and the equation is an identity; if they differ, no value works at all. Read graphically, solving the equation means finding where two straight lines cross, and parallel lines either coincide everywhere or nowhere. This page names which case you are in rather than returning a meaningless number.
The formula
a- Coefficient of x on the left
b- Constant on the left
c- Coefficient of x on the right
d- Constant on the right
a − c- Difference in gradient; zero means the lines are parallel
How it works, step by step
- Enter the coefficient and constant for the left-hand side.
- Enter the coefficient and constant for the right-hand side.
- The gauge shows the solution for x.
- The value both sides take at that x is shown below as a check.
Worked examples
3x + 7 = −2x + 22
Collecting terms gives (3 − (−2))x = 22 − 7, so 5x = 15 and x = 3. Both sides then equal 16, which is the check worth doing every time.
When there is no solution
For 4x + 1 = 4x + 9 the gradients match, so subtracting 4x from both sides leaves 1 = 9, which is false. The two lines are parallel and never meet. Had the constants agreed, every x would have worked instead.
How to read your score
Frequently asked questions
Why does a − c matter so much?
It is the gradient difference, and it is the denominator. When it is zero the two sides change at the same rate, so they either agree everywhere or nowhere — there is no single crossing point to find.
What does it mean for an equation to have infinitely many solutions?
That the two sides are the same expression written differently, so the statement is true for every x. It is called an identity rather than an equation to solve.
How do I check my answer?
Substitute it back into both sides separately. They must give the same number. This page does that automatically and shows both evaluations.
Can I use this for equations with brackets?
Expand the brackets first, then collect the x terms and the constants on each side. Once it is in the form ax + b = cx + d the four coefficients go straight in.
Linear equations and their solutions
| Equation | a − c | d − b | Solution | Both sides equal |
|---|---|---|---|---|
| 3x + 7 = -2x + 22 | 5 | 15 | 3.0000 | 16.0000 |
| 2x + 5 = 1x + 9 | 1 | 4 | 4.0000 | 13.0000 |
| 5x + -3 = 2x + 6 | 3 | 9 | 3.0000 | 12.0000 |
| 4x + 1 = 4x + 9 | 0 | 8 | none — parallel | n/a |
| 4x + 1 = 4x + 1 | 0 | 0 | any x | n/a |
| 1x + 0 = -1x + 8 | 2 | 8 | 4.0000 | 4.0000 |
Rows four and five share a gradient, so one has no solution and the other has infinitely many.