How to solve linear equations

By Math Questions Hub Team Updated September 7, 2026

Written for middle school and high school students learning algebra, and for parents or tutors who need a clear refresher on the method.

Quick answer

To solve a linear equation like 3x + 7 = 22, move every constant to the opposite side of the equals sign, then divide by the coefficient of the variable. For this example: subtract 7 from both sides to get 3x = 15, then divide by 3 to get x = 5.

A linear equation has one variable, and that variable is never raised to a power, never inside a square root, and never in a denominator. That's what makes it "linear": if you graphed the two sides as functions, they'd be straight lines. Examples include3x + 7 = 22, 5 - 2x = -1, and 4(x + 3) = 20. The goal is always the same regardless of how the equation is dressed up: get x alone on one side of the equals sign, with a coefficient of 1.

This guide walks through the balance principle that every method below relies on, then works through nine solved examples covering integers, negatives, variables on both sides, distributed terms, fractions, decimals, and equations with no solution or infinite solutions. By the end, you'll be able to recognize which situation you're in and know exactly which move to make first.

The core idea: balance

An equation is a statement that two things are equal. As long as you do the exact same operation to both sides, that statement stays true. Add 5 to the left side, add 5 to the right side, and the equation still balances. This is the only rule you actually need. Every method below is just this rule applied in a sensible order.

Think of the equals sign as the center of a scale. Whatever weight you add or remove from one pan, you have to add or remove from the other pan too, or the scale tips. Addition and subtraction, multiplication and division, even squaring both sides in more advanced work, all follow this same requirement. Miss it on even one step and the two sides stop representing the same value, which is why "operating on only one side" is the single most common way students go wrong on linear equations.

The standard two-step form

Most linear equations you'll meet look like ax + b = c, where a, b, and c are numbers. Solving one always takes the same two moves, in this order:

  1. Move the constant term (b) to the other side, by adding or subtracting it from both sides.
  2. Divide both sides by the coefficient (a) to leave x by itself.

The order matters. Dividing before you've isolated the variable term forces you to divide every term in the equation, including ones you haven't finished combining yet, which is where extra mistakes creep in. Clear the constant first, then divide, and the arithmetic stays simple at every step.

Worked example 1: a simple two-step equation

Solve 3x + 7 = 22.

  1. Subtract 7 from both sides: 3x + 7 - 7 = 22 - 7, which simplifies to 3x = 15.
  2. Divide both sides by 3: 3x / 3 = 15 / 3, which gives x = 5.
  3. Check by substituting back into the original equation: 3(5) + 7 = 15 + 7 = 22. It matches, so x = 5 is correct.

That check step matters more than it looks. It costs ten seconds and it catches almost every arithmetic slip you're likely to make. Get in the habit of doing it every time, not just when you're unsure.

Worked example 2: a negative coefficient

Solve -2x + 4 = 10.

  1. Subtract 4 from both sides: -2x = 6.
  2. Divide both sides by -2: x = -3.
  3. Check: -2(-3) + 4 = 6 + 4 = 10. Correct.

Dividing by a negative number doesn't change the steps, it just means the sign of the answer flips along with everything else in that division. A common instinct is to divide by 2 instead of -2 and then "fix" the sign at the end by guessing. Don't do that. Divide by the actual coefficient, negative sign included, and the correct sign comes out on its own.

When the variable appears on both sides

Some equations have x on both sides, like 5x - 3 = 2x + 9. The extra step is to gather every x-term onto one side before doing anything else.

  1. Subtract 2x from both sides: 5x - 2x - 3 = 9, which becomes 3x - 3 = 9.
  2. Add 3 to both sides: 3x = 12.
  3. Divide by 3: x = 4.
  4. Check: left side is 5(4) - 3 = 17, right side is 2(4) + 9 = 17. They match.

It doesn't matter which side you clear the x-terms from, as long as you're consistent. Clearing them from whichever side has the smaller coefficient usually avoids extra negative signs, which is a small convenience, not a rule.

When there's a distributed term

An equation like 4(x + 3) = 20 has a set of parentheses multiplying an entire expression. Expand that first, before doing anything else.

  1. Distribute the 4: 4x + 12 = 20.
  2. Subtract 12 from both sides: 4x = 8.
  3. Divide by 4: x = 2.
  4. Check: 4(2 + 3) = 4(5) = 20. Correct.

Once the parentheses are gone, this is exactly the same two-step process as the first example. Distributing correctly just means multiplying the outside number by every single term inside the parentheses, not just the first one. 4(x + 3) is4x + 12, not 4x + 3.

Worked example: distribution on both sides

Solve 2(x - 1) = 3(x - 4).

  1. Distribute both sides: 2x - 2 = 3x - 12.
  2. Subtract 2x from both sides: -2 = x - 12.
  3. Add 12 to both sides: 10 = x, so x = 10.
  4. Check: left side is 2(10 - 1) = 2(9) = 18, right side is 3(10 - 4) = 3(6) = 18. Correct.

Equations with fractions

An equation like x/3 + 2 = 7 can be solved the same two-step way, treatingx/3 as the variable term:

  1. Subtract 2 from both sides: x/3 = 5.
  2. Multiply both sides by 3 to undo the division: x = 15.
  3. Check: 15/3 + 2 = 5 + 2 = 7. Correct.

Multiplying to undo a division works exactly like dividing to undo a multiplication. It's the same balance principle from the top of this guide, just running in the other direction.

Clearing fractions before you start

When more than one fraction is involved, it's usually faster to clear every fraction at once by multiplying every term in the equation by the least common denominator. Solvex/2 + 1/3 = x/6 + 2:

  1. The denominators are 2, 3, and 6. Their least common denominator is 6.
  2. Multiply every term by 6: 6(x/2) + 6(1/3) = 6(x/6) + 6(2), which simplifies to3x + 2 = x + 12.
  3. Subtract x from both sides: 2x + 2 = 12.
  4. Subtract 2: 2x = 10.
  5. Divide by 2: x = 5.

From here the equation is entirely made of whole numbers, which is usually less error-prone than juggling fractions through several more steps.

Equations with decimals

Decimals follow the identical two-step process. Solve 0.5x + 1.2 = 3.7:

  1. Subtract 1.2 from both sides: 0.5x = 2.5.
  2. Divide both sides by 0.5: x = 5.

If the decimals feel awkward, you can multiply every term by 10 (or 100, depending on how many decimal places you have) to convert to whole numbers first, the same way you'd clear fractions. Multiplying the equation above by 10 turns it into 5x + 12 = 37, which some people find easier to work with mentally.

No solution and infinite solutions

Not every linear equation has exactly one answer. When you finish combining like terms and the variable disappears entirely, you're left with one of two outcomes.

Solve 2x + 3 = 2x + 7. Subtracting 2x from both sides leaves 3 = 7, which is false no matter what x is. This equation has no solution: no value of x will ever make the two sides equal.

Now solve 2x + 3 = 2x + 3. Subtracting 2x from both sides leaves3 = 3, which is always true. This equation has infinitely many solutions: any value of x you plug in will work, because both sides were the same expression to begin with.

Recognizing these two cases matters, because trying to keep "solving" past this point just leads to confusion. Once the variable cancels out, look at what's left and stop.

Common mistakes

A few errors show up far more often than the rest:

  • Operating on only one side. Whatever you do to isolate the variable, do it to both sides at the same time. Subtracting 7 from the left side only breaks the equation.
  • Stopping one step early. After moving the constant, it's easy to forget the division step and leave an answer like 3x = 15 instead of x = 5.
  • Distributing to only the first term. In 4(x + 3), both x and 3 need to be multiplied by 4.
  • Mixing up the sign when moving a term. Moving -3 to the other side means adding 3, not subtracting it. Track the sign that's attached to the term, not just the number.
  • Dividing by the wrong number. When variable terms sit on both sides, divide by the coefficient that remains after combining, not the original coefficient from either side.
  • Skipping the check. Substituting the answer back into the original equation takes seconds and catches sign errors, arithmetic slips, and mis-copied numbers before they become a wrong final answer.

Why this skill matters beyond the classroom

Linear equations aren't just a textbook exercise. Figuring out how many hours of work at a fixed rate cover a bill, converting a temperature from Fahrenheit to Celsius, splitting a shared cost so everyone pays their fair share, or working out how much a price has to drop to hit a target, all reduce to the same "isolate the unknown" process covered here. Once the method is automatic, you stop seeing "algebra" and start seeing a quick way to answer an everyday question with a number instead of a guess.

Practice it yourself

Try the math solver with your own equation to see every step laid out, or head to linear equation practice for an unlimited set of fresh problems with instant feedback and a running accuracy score by topic. If you have a photo of a homework problem, the solver can also read it from an image and fill in the text automatically before solving.

Key takeaways

  • A linear equation always reduces to the same two moves: isolate the variable term, then divide by its coefficient.
  • Whatever you do to one side of an equation, you must do to the other side too.
  • Distribute parentheses before combining like terms, and move all variable terms to one side before isolating.
  • Checking your answer by substitution takes seconds and catches almost every arithmetic mistake.
  • The same balance rule handles integers, negatives, fractions, and equations with x on both sides.

Frequently asked questions

What makes an equation linear instead of some other type?

An equation is linear when its variable is raised only to the first power. No squares, no square roots of the variable, and no variable in a denominator. 3x + 7 = 22 is linear. x² + 7 = 22 is not, because x is squared.

What if there's no number written in front of x?

A variable with no visible number in front of it has a coefficient of 1. x + 5 = 12 is the same as 1x + 5 = 12, and it solves the same way: subtract 5, then divide by 1, leaving x = 7.

Can a linear equation have more than one solution?

A normal linear equation with one variable has exactly one solution. The exceptions are equations that simplify to something always true, like 3 = 3, which has infinitely many solutions, and equations that simplify to something false, like 5 = 7, which has no solution at all.

Do I always need to find a common denominator to solve equations with fractions?

Not always. You can clear fractions early by multiplying every term in the equation by the least common denominator, which turns the whole equation into integers before you isolate the variable. Both approaches give the same answer; clearing fractions first is usually faster once more than one fraction is involved.

Why does the check step matter if I already followed the steps correctly?

Following the right steps doesn't guarantee accurate arithmetic along the way. Substituting your answer back into the original equation confirms both sides actually match, which catches sign flips, mis-copied numbers, and small slips before they turn into a wrong final answer.

What's the fastest way to solve 3x + 7 = 22 without a calculator?

Subtract 7 from both sides to get 3x = 15, then divide both sides by 3 to get x = 5. Two steps, no shortcuts needed.