Solving Equations With Variables on Both Sides
Gather variable terms on one side, constants on the other, and solve with confidence, including the cases where the variable vanishes.
Key takeaways
- Remove one side's variable term by adding its opposite to both sides.
- Then move constants to the other side and divide by the remaining coefficient.
- Moving the smaller coefficient usually leaves a positive coefficient and fewer sign errors.
- Simplify each side separately before you start moving terms across.
- If the variable cancels completely, the equation is either always true or never true.
When the unknown appears on both sides of a linear equation, subtract one of the variable terms from both sides so that the unknown remains on one side only. Then finish as a two-step equation. For 7x + 4 = 3x + 24, subtracting 3x gives 4x + 4 = 24, so 4x = 20 and x = 5.
Check it: 7(5) + 4 is 39, and 3(5) + 24 is 39. The rest of this page explains why the move is allowed, which side to choose and what to do when the variable disappears.
Why you may subtract a variable term
It can feel odd to subtract 3x when you do not know what x is. But 3x is just a number, even if you cannot name it yet. If two quantities are equal and you take the same number from each, the results are equal.
A balance picture helps. Say each unmarked bag holds the same unknown number of marbles. One pan has 7 bags and 4 loose marbles. The other has 3 bags and 24 loose marbles, and the pans are level. Lift 3 bags from each side. The scale stays level with 4 bags and 4 marbles against 24 marbles.
You never needed to open a bag. The same reasoning underlies the formal properties of equality.
A reliable procedure
- Simplify each side on its own: clear parentheses and combine like terms.
- Add or subtract a variable term so that the variable is on one side only.
- Add or subtract a constant so that the plain numbers are on the other side.
- Divide by the coefficient, as long as it is not zero.
- Substitute into the original equation and compare the two sides.
Steps 3 and 4 are exactly the two-step method. Only step 2 is new.
Which side should keep the variable
Either side works. Compare two routes through 2x + 15 = 6x − 9.
Route A: keep x on the right
2x + 15 = 6x − 9
15 = 4x − 9 (subtract 2x)
24 = 4x (add 9)
6 = x (divide by 4)
Route B: keep x on the left
2x + 15 = 6x − 9
−4x + 15 = −9 (subtract 6x)
−4x = −24 (subtract 15)
x = 6 (divide by −4) Both give 6, and the check agrees: 2(6) + 15 = 27 and 6(6) − 9 = 27. Route A never produced a negative coefficient, because it removed the smaller variable term, 2x. That is a good habit, though not a requirement.
Having the answer on the right, as in 6 = x, is completely fine. Equality reads in both directions.
Negative coefficients
Be careful when a variable term carries a minus sign. To remove −5x from a side, add 5x.
4 − 5x = 2x − 17
4 = 7x − 17 (add 5x to both sides)
21 = 7x (add 17)
x = 3 (divide by 7)
Check: 4 − 15 = −11 and 6 − 17 = −11 Adding the opposite is the whole rule. The sign in front of a term belongs to that term and travels with it.
Simplify before you move anything
Consider 5(x − 1) + 2 = 2x + 3x + x − 8. Trying to move terms right away invites confusion, so tidy each side first.
5x − 5 + 2 = 6x − 8 (distribute; combine 2x + 3x + x)
5x − 3 = 6x − 8
−3 = x − 8 (subtract 5x)
5 = x (add 8)
Check left: 5(4) + 2 = 22
Check right: 10 + 15 + 5 − 8 = 22 Like terms may be combined only within a side. A term on the left and a term on the right cannot be added together; one of them has to be removed from its side by doing the same thing to both. For more layered cases, see multi-step equations with parentheses.
When the variable disappears
Sometimes subtracting a variable term removes the unknown from both sides at once.
3(x + 2) = 3x + 6 3(x + 2) = 3x + 11
3x + 6 = 3x + 6 3x + 6 = 3x + 11
6 = 6 (true) 6 = 11 (false) On the left, a true statement remains, so every real number solves the original equation. On the right, a false statement remains, so no number does. Neither result means you made a mistake. The article on equations with no solution or infinitely many looks at both outcomes closely.
Do not confuse these with the answer x = 0. In 5x = 2x, subtracting 2x gives 3x = 0, so x = 0 is the single solution. The variable did not vanish.
Dividing both sides of 5x = 2x by x would produce the false statement 5 = 2 and hide that solution. Subtracting is safe; dividing by an unknown quantity that might be zero is not.
Fractions and decimals on both sides
The method is unchanged when the coefficients are not whole numbers, though it often pays to get rid of the fractions first.
Take (1/2)x + 3 = (1/5)x + 9. Multiply every term on both sides by 10, the least common multiple of 2 and 5.
5x + 30 = 2x + 90 (multiply both sides by 10)
3x + 30 = 90 (subtract 2x)
3x = 60 (subtract 30)
x = 20
Check: 10 + 3 = 13 and 4 + 9 = 13 The constants 3 and 9 must be multiplied by 10 as well, even though they have no fraction in them. This technique has its own page on clearing fractions from an equation.
For decimals such as 0.7x − 2 = 0.4x + 1, subtract 0.4x to get 0.3x − 2 = 1. Then 0.3x = 3 and x = 10. The left side is 7 − 2 = 5, and the right side is 4 + 1 = 5.
Seeing both sides as growth
Each side of a linear equation can be read as a quantity that changes at a steady rate. In 7x + 4 = 3x + 24, the left side starts at 4 and rises 7 for each unit of x. The right side starts at 24 and rises only 3.
At x = 0 the right side leads by 20. Every step of 1 in x lets the left side close the gap by 4. After 20 ÷ 4 = 5 steps the two are level, which is the solution.
| x | 7x + 4 | 3x + 24 | Right minus left |
|---|---|---|---|
| 0 | 4 | 24 | 20 |
| 1 | 11 | 27 | 16 |
| 3 | 25 | 33 | 8 |
| 5 | 39 | 39 | 0 |
| 6 | 46 | 42 | −4 |
This picture also explains the odd cases. If both sides grow at the same rate, the gap never changes. A gap of zero means they are always equal, and any other gap means they never meet. Drawing the two sides as lines is the idea behind solving by graphing both sides.
A worked word problem
Say you are comparing two hypothetical streaming plans. Plan A costs 30 dollars to join and 8 dollars a month. Plan B costs nothing to join and 13 dollars a month. After how many months have you paid the same total?
Let m be the number of months.
30 + 8m = 13m
30 = 5m (subtract 8m)
m = 6 At 6 months, Plan A totals 30 + 48 = 78 dollars, and Plan B totals 13 × 6 = 78 dollars. Before that point B is cheaper, since it has no joining fee. After it A is cheaper, since it grows more slowly.
This kind of question, where two quantities catch up with each other, is a natural source of equations with the unknown on both sides. The same idea appears in graphs as the point where two lines cross.
When the answer needs interpreting
The solution of the equation is not always the final word on a situation. Suppose a hypothetical tank holds 50 liters and drains 3 liters a minute, while another holds 20 liters and fills 2 liters a minute. They hold equal amounts when 50 − 3t = 20 + 2t.
Adding 3t gives 50 = 20 + 5t, so t = 6. At that moment each tank holds 32 liters. Because both amounts are still positive at 6 minutes, the answer makes sense.
Change the story so the second tank starts with more water than the first and also fills while the first drains. The equation might be 20 − 3t = 50 + 2t, with solution t = −6. The algebra is correct, but a negative time falls before the process began. Within the story, the tanks never match after the start.
Always ask what values the letter is allowed to take. Counts of people must be whole numbers, lengths cannot be negative, and times may be limited to the period in which the description holds.
Common mistakes
| Mistake | Example | Correction |
|---|---|---|
| Adding unlike sides | 7x = 3x + 8 becomes 10x = 8 | Subtract 3x: 4x = 8, so x = 2 |
| Moving a term without changing both sides | 5x − 4 = 2x becomes 5x − 2x = −4 | The result is 3x = 4 |
| Combining a constant with a variable term | 4 + 3x written as 7x | Leave it as 4 + 3x |
| Distributing to the first term only | 2(x + 5) becomes 2x + 5 | It equals 2x + 10 |
The phrase "move it across and change the sign" is a shortcut for adding the opposite to both sides. It works when you remember what it stands for. If a sign ever seems uncertain, write the operation on both sides in full.
Common questions
Do I have to move the variable to the left?
No. The habit of ending with x on the left is only a convention. Choosing the side that keeps the coefficient positive is usually more helpful, and the statements 6 = x and x = 6 are identical in meaning.
Should I move constants or variables first?
Either order gives the same result, since you are only adding quantities to both sides. Some solvers even do both moves on one line. While you are learning, one move per line makes it much easier to find a slip.
What if I get a fraction as the answer?
Keep it exact. The equation 5x + 1 = 2x + 3 gives 3x = 2, so x = 2/3. Substituting, the left side is 10/3 + 1 = 13/3 and the right side is 4/3 + 3 = 13/3.
Can the same method handle x² terms?
If the squared terms are identical on both sides, they cancel and a linear equation remains. For instance, x² + 3x = x² + 12 reduces to 3x = 12, so x = 4. If an x² term survives, the equation is quadratic and needs different tools.
Practice problems
- 9a − 2 = 4a + 18
- 3b + 20 = 8b
- 7 − c = 3c − 13
- 2(d + 4) = 5d − 7
1. 5a = 20, a = 4
2. 20 = 5b, b = 4
3. 20 = 4c, c = 5
4. 2d + 8 = 5d − 7, 15 = 3d, d = 5 Substitute each value back before you accept it. In problem 4, the left side is 2(9) = 18 and the right side is 25 − 7 = 18.