MathIt Blog

How to solve for x: one-step, two-step and both-sides equations

By Laura Bennett, MathIt · Published · 11 min read
An old-fashioned balance scale on a light wooden desk with small wooden blocks on both pans, a cup of coffee, a notebook and a pencil.

How do you solve for x?

To solve for x, get x alone on one side of the equals sign by undoing each operation in reverse order and doing the same thing to both sides. Simplify each side, collect the x terms on one side, undo addition and subtraction, then undo multiplication and division. Check by substituting: in 3x + 5 = 41, x = 12 because 3 × 12 + 5 = 41.

Key takeaways

  • Solving for x means finding the number that makes both sides of an equation equal, such as x = 12 in 3x + 5 = 41.
  • An equation stays true only when you do the same operation to both sides, like a balance scale that stays level.
  • Inverse operations undo the equation in reverse order: first undo addition or subtraction, then undo multiplication or division.
  • Substituting the answer into the original equation is the check: 5 × 6 − 2 = 28 and 3 × 6 + 10 = 28, so x = 6 solves 5x − 2 = 3x + 10.
  • An equation where x disappears has no solution when the result is false, such as 1 = 3, and infinitely many when it is true, such as 2 = 2.

Three concert tickets plus a $5 booking fee came to $41, and you want to know what one ticket cost. That sentence is the equation 3x + 5 = 41, and learning how to solve for x turns it into a two-line calculation: take off the fee, then split what is left three ways, so one ticket was $12. The same moves solve every linear equation a sixth or seventh grader brings home, from one-step and two-step equations to equations with variables on both sides.

What does "solve for x" mean?

To solve for x means to find the number that makes both sides of an equation equal. In x + 7 = 15, the answer is 8, because 8 + 7 is 15 and no other number gives 15. OpenStax Prealgebra defines a solution as "a value of a variable that makes a true statement when substituted into the equation."

A balance scale is the clearest picture of an equation. The left pan holds 3x + 2, the right pan holds 14, and the scale is level because the two sides weigh the same. Each box marked x hides the same unknown number of blocks.

A level balance scale with three boxes marked x and 2 unit blocks on the left pan and 14 unit blocks on the right pan, showing 3x + 2 = 14
A level balance scale with three boxes marked x and 2 unit blocks on the left pan and 14 unit blocks on the right pan, showing 3x + 2 = 14

Take 2 blocks off each pan and the scale stays level: three boxes balance 12 blocks. Split both pans into three equal groups and one box balances 4 blocks, so x = 4. Check it: 3 × 4 + 2 = 14.

The two jobs: undo and keep the balance

Solving an equation comes down to two jobs. The first job is to undo what was done to x, in reverse order. In 3x + 5, x was multiplied by 3 and then 5 was added, so you remove the 5 first and the 3 second, which is the order of operations run backwards.

The second job is to keep the balance. OpenStax states it as the Subtraction Property of Equality: "For any numbers a, b, and c, if a = b then a − c = b − c." The same holds for adding, multiplying and dividing by a number other than zero, so whatever you do to one side, you do to the other.

How to solve for x, step by step

Five steps solve any linear equation in one variable. Short equations skip some of them, but the order never changes.

  1. Simplify each side. Expand brackets and combine like terms on each side separately, so 2(x − 4) becomes 2x − 8.
  2. Collect the x terms on one side. Add or subtract an x term on both sides until x appears on one side only. OpenStax suggests keeping x on the side with the larger coefficient, which usually makes the arithmetic easier.
  3. Undo addition and subtraction. Subtract any number added to the x term, or add any number subtracted, on both sides.
  4. Undo multiplication and division. Divide both sides by the number in front of x, or multiply both sides if x is divided by something.
  5. Check by substituting. Put your answer back into the original equation and work out each side. If they match, you are done.

Here is the ticket problem with the steps marked:

  • 3x + 5 = 41 (nothing to simplify, and x is on one side already)
  • 3x = 36 (step 3: subtract 5 from both sides)
  • x = 12 (step 4: divide both sides by 3)
  • Check: 3 × 12 + 5 = 36 + 5 = 41

A bracketed equation uses step 1. For 2(x − 4) = 10, expand to 2x − 8 = 10, add 8 to both sides to get 2x = 18, and divide by 2 to get x = 9. Check: 2 × (9 − 4) = 2 × 5 = 10.

You can also divide both sides by 2 first, which gives x − 4 = 5 and the same x = 9. The IES practice guide for algebra teachers recommends teaching students to "intentionally choose from alternative algebraic strategies", and comparing these two routes is a small example of that choice.

Play free in your browserSolve for XGrade 6+

The part people get wrong

Most wrong answers come from doing a step to one side only. If you subtract 5 from the left of 3x + 5 = 41 and leave 41 alone, you get 3x = 41 and x = 41 ÷ 3, an answer that fails the check. Write the operation under both sides every time until the habit sticks.

Sign errors are the second trap. In 5x − 2 = 3x + 10, the −2 belongs to the left side, so you add 2 to both sides; subtracting it instead gives 2x = 8 and x = 4, and the check shows 18 on the left against 22 on the right.

One-step vs two-step equations vs variables on both sides

Linear equations come in three common shapes, and the shape tells you the first move. The answer in every row of the comparison table was checked by substitution.

TypeExampleFirst moveAnswer
One-step, addingx + 7 = 15Subtract 7 from both sidesx = 8
One-step, multiplying4x = 28Divide both sides by 4x = 7
Two-step3x + 5 = 41Subtract 5, then divide by 3x = 12
Two-step, with brackets2(x − 4) = 10Expand, or divide both sides by 2x = 9
Variables on both sides5x − 2 = 3x + 10Subtract 3x from both sidesx = 6

The both-sides row in full: 5x − 2 = 3x + 10 becomes 2x − 2 = 10, then 2x = 12, then x = 6. The check gives 5 × 6 − 2 = 28 and 3 × 6 + 10 = 28.

Which type comes in which grade

One-step equations come in grade 6, two-step equations in grade 7 and variables on both sides in grade 8 under the US Common Core standards. Grade 6 standard 6.EE.B.7 asks students to solve problems "by writing and solving equations of the form x + p = q and px = q" (Common Core State Standards for Mathematics).

Grade 7 standard 7.EE.B.4a moves to two-step equations of the form "px + q = r and p(x + q) = r". Grade 8 standard 8.EE.C.7 covers linear equations in one variable, including those that need "expanding expressions using the distributive property and collecting like terms", which is where variables on both sides appear.

Practical tips for solving equations

Writing each step on its own line is the most useful habit. Keep the equals signs lined up, and write the operation you apply beside both sides, so a mistake is visible at the line where it happened.

The solution ladder 3x + 5 = 41, then 3x = 36 after subtracting 5 from both sides, then x = 12 after dividing both sides by 3
The solution ladder 3x + 5 = 41, then 3x = 36 after subtracting 5 from both sides, then x = 12 after dividing both sides by 3
  • Inverse pairs: addition undoes subtraction, multiplication undoes division, and each pair works in both directions.
  • Negative coefficients: in 7 − 2x = 13, subtract 7 to get −2x = 6, then divide by −2 to get x = −3. Check: 7 − 2 × (−3) = 7 + 6 = 13. The rules for dividing by a negative are in the guide to negative numbers.
  • One answer: an equation with one x term on one side has exactly one answer, so a second "answer" means a slip somewhere.

Fractions and everyday problems

An equation with x divided by a number is solved by multiplying. If four friends split a bill and each pays $9, the bill is x/4 = 9, and multiplying both sides by 4 gives x = $36. Equations like this sit close to proportions, covered in the guide to ratios.

Adults meet two-step equations in daily life more often than they notice. A taxi charges $3 plus $2 per mile and the ride cost $19: 2m + 3 = 19, so 2m = 16 and m = 8 miles.

A phone plan costs $25 a month plus a $40 setup fee and you have paid $190 in total: 25m + 40 = 190, so 25m = 150 and m = 6 months. Turning a sentence into the equation is its own skill, and the guide to math word problems shows how.

How to check your progress with equations

Progress with equations shows up in five signals you can test in a few minutes, whether you are a parent checking homework or an adult relearning algebra.

  • Substitution: Does the learner check every answer without being told? Common Core standard 6.EE.B.5 asks students to "use substitution to determine whether a given number in a specified set makes an equation or inequality true."
  • First move: Given 6x + 4 = 40, can they say "subtract 4" before writing anything? The answer is x = 6.
  • Both sides: Does every line show the same operation applied on both sides?
  • Brackets: Can they solve 3(x + 2) = 21 two ways? Dividing first gives x + 2 = 7, expanding gives 3x + 6 = 21, and both end at x = 5.
  • Words to equation: Can they write and solve "5 notebooks and a $4 pen cost $29"? The equation is 5n + 4 = 29, so n = $5.

A five-minute test

A five-minute test of one equation from each row of the comparison table tells you which type to practice. A learner who solves the one-step rows but misses 5x − 2 = 3x + 10 needs step 2, collecting x on one side. A learner who gets stuck at 4x = 28 needs division facts, and the missing-factor game drills those quickly.

Play free in your browserMissing FactorGrade 3–4

Common mistakes and edge cases

Four mistakes cause most wrong answers when you solve for x, and each one has a quick fix.

  • Distributing to the first term only: 2(x − 4) is 2x − 8, not 2x − 4. Draw an arrow from the 2 to each term inside the brackets.
  • Dividing before subtracting: in 3x + 5 = 41, dividing first means dividing every term, 5 included, which gives fractions. Undo addition and subtraction first.
  • Dropping a negative answer: 4x + 20 = 8 gives 4x = −12 and x = −3. A negative answer is fine, and the check 4 × (−3) + 20 = 8 confirms it.
  • Flipping a sign when dividing: −3x = 15 gives x = −5, because 15 ÷ (−3) = −5. The sign flip you may remember belongs to inequalities, not equations.

When x disappears: no solution or infinitely many

Some equations lose their x entirely, and the line that remains tells you the answer. Common Core standard 8.EE.C.7a asks students to show which case applies "by successively transforming the given equation into simpler forms, until an equivalent equation of the form x = a, a = a, or a = b results."

In 2x + 1 = 2x + 3, subtracting 2x from both sides leaves 1 = 3, which is false, so the equation has no solution. In 2(x + 1) = 2x + 2, expanding gives 2x + 2 = 2x + 2, and subtracting 2x leaves 2 = 2, which is always true, so every number is a solution.

Your solve-for-x checklist and next steps

  • Simplify: expand brackets and combine like terms on each side.
  • Collect: move every x term to one side, ideally the side with the larger coefficient.
  • Undo + and −: add or subtract the same number on both sides.
  • Undo × and ÷: divide or multiply both sides by the number attached to x.
  • Check: substitute into the original equation and compare both sides.
  • Edge cases: a false line such as 1 = 3 means no solution, and a true line such as 2 = 2 means infinitely many.

The free solve for x game serves one-step equations such as x + 7 = 15 in the browser with no sign-up, and you type the value of x. Adults rebuilding their math can follow the plan in how to get better at math as an adult or try the math game for adults.

MathIt is a free app for iOS and Android with about 90 game types, adaptive difficulty, daily practice and 2–5 player real-time battles, in 33 languages.

Practise it in the MathIt app

About 90 math games with adaptive difficulty, daily practice and 2–5 player battles — free on iOS and Android.

Download on the App StoreGet it on Google Play

Frequently asked questions

How do you solve two-step equations?

A two-step equation such as 3x + 5 = 41 is solved by undoing the two operations in reverse order. First subtract 5 from both sides to get 3x = 36, then divide both sides by 3 to get x = 12. Check by substituting: 3 × 12 + 5 = 36 + 5 = 41.

How do you solve equations with variables on both sides?

An equation with variables on both sides is solved by moving all the x terms to one side first. In 5x − 2 = 3x + 10, subtract 3x from both sides to get 2x − 2 = 10, add 2 to get 2x = 12, then divide by 2 to get x = 6. Both sides then equal 28.

How do you solve for x with fractions?

An equation with x divided by a number is solved by multiplying both sides by that number. In x/4 = 9, multiply both sides by 4 to get x = 36. For (2/3)x = 10, multiply both sides by 3/2, the reciprocal, to get x = 15, and check that two thirds of 15 is 10.

How do you check your answer when you solve for x?

An answer for x is checked by substituting it into the original equation and working out each side separately. If both sides give the same number, the answer is right. For 2(x − 4) = 10 and x = 9, the left side is 2 × 5 = 10, which matches the right side.

What does it mean when x disappears from an equation?

An equation where x disappears has either no solution or infinitely many. If what is left is false, such as 1 = 3 from 2x + 1 = 2x + 3, no number works. If what is left is true, such as 2 = 2 from 2(x + 1) = 2x + 2, every number works.

Similar topics

All articles →