Math notes
How to Solve Linear Equations With Variables on Both Sides
An x on each side can make a familiar equation feel harder. Start by subtracting one variable term from both sides.

To solve a linear equation with variables on both sides, simplify each side and subtract one x term from both sides. Then collect the constants, divide to isolate x, and check your answer in the original equation. If the x terms cancel, read the remaining statement: it may mean no solution or all real numbers.
In 5x - 7 = 2x + 8, you might be tempted to say “move the 2x across.” That shorthand hides the operation. Subtract 2x from both sides and write what remains. Once you can see the change, the signs are easier to keep track of.
Choose which variable term to remove
Start with:
5x - 7 = 2x + 8
Subtract 2x from both sides. On the left, 5x - 2x becomes 3x. On the right, 2x - 2x becomes zero:
5x - 7 - 2x = 2x + 8 - 2x
3x - 7 = 8
Now there is only one variable term. Add 7 to both sides, then divide both sides by 3:
3x - 7 + 7 = 8 + 7
3x = 15
x = 5
You could subtract 5x instead. That gives -7 = -3x + 8, and you would still reach x = 5. Removing the term with the smaller coefficient keeps the remaining coefficient positive in this example. It gives you fewer negative signs to handle, but either route works.
The rule behind both routes is the same: adding or subtracting an equal quantity on each side keeps the same solutions. OpenStax explains these properties of equality for variables on both sides.
Check the answer where you started
Put 5 into the original equation, 5x - 7 = 2x + 8:
Left: 5(5) - 7 = 25 - 7 = 18
Right: 2(5) + 8 = 10 + 8 = 18
Both sides equal 18, so 5 satisfies the equation. Use the original equation for this check. A later line may contain the same mistake that produced a wrong answer.
If you want more practice with this last step, the substitution-checking guide includes a negative-value example and explains what a successful check proves.
Expand the brackets before collecting x terms
Try an equation that needs a little tidying before you collect the variable terms:
2(x - 3) + 4 = 5x + 7
Multiply both terms inside the brackets by 2. The -3 becomes -6, so the left side simplifies to 2x - 2:
2x - 6 + 4 = 5x + 7
2x - 2 = 5x + 7
Here the larger variable coefficient is on the right. Subtract 2x from both sides to leave it there:
-2 = 3x + 7
-9 = 3x
-3 = x
The second line subtracts 7 from both sides. The third divides both sides by 3. You can write that final line as x = -3.
Check x = -3 in the equation with brackets:
Left: 2(-3 - 3) + 4 = 2(-6) + 4 = -8
Right: 5(-3) + 7 = -15 + 7 = -8
A negative answer is worth checking carefully, but it isn’t a sign that something went wrong. Here it makes both sides equal -8.
When the variable disappears
Sometimes subtracting the variable terms removes them altogether. Stop and read what is left.
For 3x + 5 = 3x + 8, subtracting 3x gives:
5 = 8
That statement is false for every value of x. The equation has no solution. It does not mean x = 0.
Now compare 3(x + 2) = 3x + 6. Expanding the brackets and subtracting 3x gives:
3x + 6 = 3x + 6
6 = 6
This statement stays true regardless of x, so every real number is a solution. You have reduced the equation to an identity. You do not need to divide by anything to finish.
The linear equation calculator can show the steps for both outcomes. OpenStax’s general strategy for linear equations covers this classification alongside equations with one solution.
The line where a sign error can hide
Return to the first example. Suppose your work says:
5x - 7 = 2x + 8
3x - 7 = 8
3x = 1
x = 1/3
The first change is valid: subtracting 2x from both sides leaves 3x - 7 = 8. The next change breaks the equation. To remove -7, add 7 to both sides. The right side should be 8 + 7 = 15.
Dividing 1 by 3 correctly on the final line cannot repair that earlier error. When an answer fails its check, compare neighboring lines until you find the first change that doesn’t preserve the solutions. The first-wrong-step guide shows that process in more detail.
Try two before looking at the answers
For each equation, choose a variable term to subtract, solve, and substitute your answer into the original equation:
7x + 2 = 4x + 204x + 1 = x - 8
Check your answers
For the first equation, subtract 4x to get 3x + 2 = 20, then subtract 2 and divide by 3. The answer is x = 6. In the original equation, both sides equal 44.
For the second, subtract x to get 3x + 1 = -8, then subtract 1 and divide by 3. The answer is x = -3. In the original equation, both sides equal -11.
Use the solver to compare your work
For a second check, compare your lines with the verified transformations in the solve-for-x calculator. Confirm how the solver read your equation before solving. It may choose a different valid order of operations.
If you have already written a solution, choose Check my work and enter 2–12 supported typed lines. An inconclusive result means the checker could not establish whether a change was valid; keep reviewing that step.
This guide covers one-variable linear equations over the real numbers, without variables in denominators. For a variable in a denominator, use the separate rational-expression calculator, which has its own limits. For other equation types, choose a tool from the calculator directory. The methodology page explains how Math Solver verifies supported results.
Last updated .