Equations & Inequalities

Equations with Variables on Both Sides

To solve an equation with variables on both sides, subtract the smaller variable term from both sides so the variable sits on one side only, then finish as you would a two-step equation. For 5x+4=2x+195x+4=2x+19, subtracting 2x2x gives 3x+4=193x+4=19, so 3x=153x=15 and x=5x=5.

ax+b=cx+d  ⇒  x=d−ba−cax + b = cx + d \;\Rightarrow\; x = \frac{d-b}{a-c}

Try it with your numbers

Show every step

Everything on this page grows from one idea: an equation is a balance, and the same operation to both sides keeps it level. Parentheses, fractions and the strange cases with no answer are all variations on that move. If single steps still feel shaky, a quick look at solving two-step equations will make this page much easier.

How do you solve equations with variables on both sides?

The target is always the shape ax=bax=b, where one variable term sits alone on one side and a number sits on the other. The only new decision, compared with simpler equations, is which variable term to remove. Here is the full routine:

  1. Simplify each side (distribute, then combine like terms).
  2. Subtract one variable term from both sides so xx appears once.
  3. Add or subtract the constant so numbers sit on the other side.
  4. Divide by the coefficient.
  5. Substitute back into the original equation.

Example 1. Solve 7x−5=3x+117x-5=3x+11.

7x−5−3x=3x+11−3x  ⇒  4x−5=117x-5-3x=3x+11-3x \;\Rightarrow\; 4x-5=11

4x−5+5=11+5  ⇒  4x=164x-5+5=11+5 \;\Rightarrow\; 4x=16

4x4=164  ⇒  x=4\frac{4x}{4}=\frac{16}{4} \;\Rightarrow\; x=4

Check: the left side is 7(4)−5=237(4)-5=23 and the right side is 3(4)+11=233(4)+11=23.

Steps 3 and 4 are the same moves from solving one-step equations, applied twice. You will often hear that a term “moves across the equals sign and changes sign”. That phrase is shorthand. What actually happens is that you subtract (or add) the term on both sides, and the sign change is a side effect of cancelling. Students who think of it as teleporting tend to forget the term on the other side.

Quick check

Solve 9x+2=4x+279x+2=4x+27.

Is there a shortcut formula for variables on both sides?

Yes, and it comes from doing the routine once with letters. Start with ax+b=cx+dax+b=cx+d. Subtract cxcx and bb from both sides to get (a−c)x=d−b(a-c)x=d-b. Divide by a−ca-c:

x=d−ba−c(a≠c)x=\frac{d-b}{a-c}\qquad (a\neq c)

In words: the difference of the constants divided by the difference of the coefficients, both taken in the same direction (right minus left in the numerator, left minus right in the denominator). Solving an equation for a letter in terms of other letters is exactly the skill behind solving literal equations.

For 2x+3=5x−92x+3=5x-9 we have a=2a=2, b=3b=3, c=5c=5, d=−9d=-9:

x=−9−32−5=−12−3=4x=\frac{-9-3}{2-5}=\frac{-12}{-3}=4

Why the formula can fail

If a=ca=c, the denominator a−ca-c is 00 and the variable terms cancel. That is the no-solution and all-numbers situation covered below.

The formula is best used as a second opinion, not a replacement for the steps. It also explains the usual advice to move the smaller variable term. On 2x+3=5x−92x+3=5x-9, subtracting 2x2x gives 3=3x−93=3x-9, then 12=3x12=3x, so x=4x=4 with no negatives anywhere. Subtracting 5x5x instead gives −3x+3=−9-3x+3=-9, then −3x=−12-3x=-12, and you must divide by a negative. Same answer, more chances to slip.

Variables on both sides with parentheses and negatives

Distribute first, combine second, collect third. Doing the steps out of order is the most common reason a correct idea produces a wrong answer.

Example 2. Solve 5−2(x+1)=3x−125-2(x+1)=3x-12.

5−2x−2=3x−125-2x-2=3x-12

3−2x=3x−123-2x=3x-12

3=5x−12(add 2x)3=5x-12 \quad (\text{add } 2x)

15=5x(add 12)15=5x \quad (\text{add } 12)

x=3x=3

Check: the left side is 5−2(4)=−35-2(4)=-3 and the right side is 3(3)−12=−33(3)-12=-3.

The negative-sign trap

A minus in front of parentheses flips every term inside: −2(x+1)=−2x−2-2(x+1)=-2x-2, not −2x+2-2x+2 and not −2x+1-2x+1.

Notice that the variable ended up on the right in 15=5x15=5x. That is fine. The equals sign works in both directions, so 15=5x15=5x and 5x=155x=15 say the same thing. When equations grow longer, the habit of simplifying each side completely before moving anything is the core of solving multi-step equations.

Variables on both sides with fractions and decimals

Fractions look harder but cost only one extra step: clear them first. Multiply every term on both sides by the least common denominator, and the equation becomes whole numbers.

Example 3. Solve x2+3=x3+5\dfrac{x}{2}+3=\dfrac{x}{3}+5.

The least common denominator of 2 and 3 is 6.

6(x2+3)=6(x3+5)6\left(\frac{x}{2}+3\right)=6\left(\frac{x}{3}+5\right)

3x+18=2x+303x+18=2x+30

x+18=30  ⇒  x=12x+18=30 \;\Rightarrow\; x=12

Check: the left side is 6+3=96+3=9 and the right side is 4+5=94+5=9.

The trap here is multiplying the fractions but forgetting the plain numbers. The 3 and the 5 must be multiplied by 6 as well, giving 18 and 30. Decimals work the same way with powers of ten. For 0.3x+1.2=0.5x−0.40.3x+1.2=0.5x-0.4, multiply everything by 10 to get 3x+12=5x−43x+12=5x-4. Then 16=2x16=2x, so x=8x=8. Check: 0.3(8)+1.2=3.60.3(8)+1.2=3.6 and 0.5(8)−0.4=3.60.5(8)-0.4=3.6.

This only applies when xx is in the numerator. If xx sits in a denominator, the equation is a different type and needs extra care, covered in solving rational equations.

What if the variables cancel? No solution or all numbers

Three graphs showing parallel lines, identical lines and crossing lines for linear equations with variables on both sides
If x cancels, each side is a line: parallel lines never meet, identical lines always meet, and crossing lines meet once.

Sometimes the variable terms vanish together. What remains is a statement with no xx at all, and that statement is either true or false.

Take 4x+7=4x+94x+7=4x+9. Subtracting 4x4x leaves 7=97=9, which is false for every xx, so the equation has no solution. Now take 3(x+2)=3x+63(x+2)=3x+6. Distributing gives 3x+6=3x+63x+6=3x+6, and subtracting 3x3x leaves 6=66=6, which is always true, so every real number works. This is called an identity.

Last line Meaning Solution set
−6=−6-6=-6 always true all real numbers
7=97=9 never true no solution
x=4x=4 true for one value one solution

The costly mistake is reading 0=00=0 as x=0x=0. A true statement without xx says nothing about xx being zero. Both cases happen exactly when the coefficients match (a=ca=c in the shortcut formula): equal constants give an identity, unequal constants give no solution.

The same idea carries into inequalities. For 4x+7<4x+94x+7<4x+9 the last line 7<97<9 is true, so every real number works, written (−∞,∞)(-\infty,\infty) in interval notation. The rules for solving linear inequalities add one more twist: dividing by a negative flips the inequality sign.

Quick check

Solve 6(x−1)=6x−66(x-1)=6x-6.

How do you check an answer with variables on both sides?

Substitute your answer into the original equation, not into a later line, and evaluate each side separately. If the two numbers match, the answer is right. If they differ, an error happened somewhere, and the size of the gap often hints where.

Checking against the original catches mistakes in your own steps. For example, if a solver reports x=−4x=-4 for 2x+3=5x−92x+3=5x-9, the left side is 2(−4)+3=−52(-4)+3=-5 and the right side is 5(−4)−9=−295(-4)-9=-29. They do not match, so the answer is wrong, and the sign was probably lost when dividing −12-12 by −3-3.

Try this: Pick a secret answer, say x=6x=6. Write 4x+24x+2 on the left and x+20x+20 on the right, and confirm both equal 26 when x=6x=6. Then solve 4x+2=x+204x+2=x+20 without looking and see whether you land back on 6.

Three independent checks are worth building into your routine:

  • Substitute into the original equation.
  • Solve again by moving the other variable term and compare.
  • Run the shortcut formula d−ba−c\frac{d-b}{a-c} as a third opinion.

If you want more repetitions with answers to compare against, the multi-step equations practice problems are a good next stop.

Where do variables on both sides show up in real life?

Whenever two things change at different rates and you want the moment they match. Each side of the equation is a cost, a distance or an amount that depends on the same unknown, and solving finds the break-even point.

Example 4. Rental A charges a flat fee of 40 dollars plus 0.250.25 dollars per mile. Rental B charges 25 dollars plus 0.400.40 dollars per mile. For how many miles mm do they cost the same?

40+0.25m=25+0.40m40+0.25m=25+0.40m

40=25+0.15m(subtract 0.25m)40=25+0.15m \quad (\text{subtract } 0.25m)

15=0.15m(subtract 25)15=0.15m \quad (\text{subtract } 25)

m=100m=100

Check: both cost 6565 dollars at 100 miles. Rental B is cheaper for short trips because its fee is lower, and Rental A wins past 100 miles because its per-mile rate is lower.

Graphically, each side is a line written in slope-intercept form, and the solution is the xx-coordinate where the lines cross. Here they cross at (100, 65)(100,\,65). Parallel lines never cross, which is the no-solution case, and two copies of the same line overlap everywhere, which is the identity case. Turning sentences into equations like these is the focus of linear equation word problems.

Quick check

Gym A charges a joining fee of 20 dollars plus 10 dollars per month. Gym B has no joining fee and charges 15 dollars per month. After how many months do the total costs match?

When variables on both sides are not a linear equation

Once xx is squared or sits inside an absolute value, the “collect and divide” routine is no longer enough. Linear equations have one, none, or infinitely many solutions. Other types can have two.

For x2=3x+10x^2=3x+10, move everything to one side and factor:

x2−3x−10=0  ⇒  (x−5)(x+2)=0  ⇒  x=5 or x=−2x^2-3x-10=0 \;\Rightarrow\; (x-5)(x+2)=0 \;\Rightarrow\; x=5 \text{ or } x=-2

Check: 25=15+1025=15+10 and 4=−6+104=-6+10. Both work. The trap is dividing both sides by xx. For x2=3xx^2=3x, dividing by xx gives x=3x=3 and silently loses the solution x=0x=0. Moving the terms first gives x(x−3)=0x(x-3)=0, which keeps both answers. When factoring is awkward, the quadratic formula practice problems cover the general method.

Absolute values need a different habit: split into cases and check each. For ∣x+1∣=2x−5|x+1|=2x-5, the case x+1=2x−5x+1=2x-5 gives x=6x=6, which checks since ∣7∣=7|7|=7. The case x+1=−(2x−5)x+1=-(2x-5) gives x=43x=\tfrac{4}{3}, but then 2x−5=−732x-5=-\tfrac{7}{3}, and an absolute value cannot equal a negative number. That answer is extraneous. The full method is in solving absolute value equations.

Practice problems

0 of 5 solved

  1. Solve 6x+5=2x+216x+5=2x+21.

  2. Solve 8−3x=5x−168-3x=5x-16.

  3. Solve 4(x−2)=2x+104(x-2)=2x+10.

  4. Solve 3x4−2=x2+12\frac{3x}{4}-2=\frac{x}{2}+\frac{1}{2}.

  5. Solve 2(3x−4)−5=3(x+1)+2x−62(3x-4)-5=3(x+1)+2x-6.

Common questions

Does it matter which side you move the variable to?

No. Both choices give the same answer. Moving the smaller variable term keeps the remaining coefficient positive, which avoids dividing by a negative and prevents sign slips.

What does it mean when you get 0 = 0 while solving?

The two sides are the same expression, so every real number is a solution. It does not mean x=0x=0. A false statement such as 7=97=9 means the opposite: no solution exists.

How do you solve variables on both sides when there are parentheses?

Distribute first, then combine like terms on each side, and only then collect the variable terms. Watch negative signs in front of parentheses, since they change every term inside.

How do you solve equations with variables on both sides and fractions?

Multiply every term on both sides by the least common denominator. That turns the equation into whole numbers, and you then solve it the usual way.

What is the first step when the variable is on both sides?

Simplify each side by distributing and combining like terms. After that, subtract one variable term from both sides so the variable appears on only one side.

Can an equation with variables on both sides have two answers?

A linear one cannot: it has one solution, none, or infinitely many. Two answers can appear when the variable is squared or inside an absolute value, because then the equation is no longer linear.

Up next