How-to guides · 6 min read

How to Solve Linear Equations Step by Step (With Examples)

How to Solve Linear Equations Step by Step (With Examples) — illustration
In short: To solve a linear equation, do the same thing to both sides until x is alone. For 3x + 5 = 20, subtract 5 to get 3x = 15, then divide by 3 to get x = 5. Every linear equation, however long, follows that same pattern.

What a linear equation is

A linear equation in one variable is an equation where the unknown, usually x, appears only to the first power. It has no x², no square roots of x and no x in a denominator. Examples include x + 7 = 12, 3x + 5 = 20 and 2(x − 4) + 3 = 3x − 7. The word "linear" comes from the fact that if you graph the two sides as functions of x, you get straight lines.

Solving means finding the value of x that makes both sides equal. A linear equation in one variable has exactly one solution, unless it is one of two special cases covered near the end: no solution, or every number is a solution.

The one rule: keep the equation balanced

An equation is like a balanced scale. Whatever you do to one side you must also do to the other, or the balance breaks. To isolate x you undo the operations that have been applied to it, working in the reverse order of the order of operations: undo addition and subtraction first, then multiplication and division.

Operation on xUndo it byExample
Add 5Subtract 5 from both sidesx + 5 = 9 → x = 4
Subtract 5Add 5 to both sidesx − 5 = 9 → x = 14
Multiply by 3Divide both sides by 33x = 12 → x = 4
Divide by 3Multiply both sides by 3x ÷ 3 = 4 → x = 12

Method: a two-step equation

Solve 3x + 5 = 20. The variable has been multiplied by 3 and then had 5 added. Undo in reverse: subtract 5, then divide by 3.

  • Start: 3x + 5 = 20
  • Subtract 5 from both sides: 3x = 15
  • Divide both sides by 3: x = 5
Live solver: 3x + 5 = 20, with a check by substitution
Answer x = 5
Step-by-step working 4 steps
  1. 1
    Write the equation
    3x + 5 = 20
  2. 2
    Collect the x terms on the left
    3x − 0 = 20 − 5
    3x = 15

    Subtract the smaller x term and the constant from both sides, so x is alone on the left and numbers are on the right.

  3. 3
    Divide by the coefficient of x
    x = 15 ÷ 3 = 5
  4. 4
    Check by substituting back
    Left: 3(5) + 5 = 20
    Right: 0(5) + 20 = 20

    Both sides match, so the solution is correct.

The last line of the solver is the check: put x = 5 back into the original equation and confirm both sides match. 3(5) + 5 = 20. Making that check a habit catches nearly all arithmetic slips.

Variables on both sides

When x appears on both sides, first gather the x terms on one side and the plain numbers on the other. Subtract the smaller x term from both sides so you do not create negative coefficients unless you want to. Take 2(x − 4) + 3 = 3x − 7.

StepWorking
1. Expand the bracket2x − 8 + 3 = 3x − 7
2. Combine like terms2x − 5 = 3x − 7
3. Subtract 2x from both sides−5 = x − 7
4. Add 7 to both sides2 = x
5. CheckLeft: 2(2 − 4) + 3 = -1. Right: 3(2) − 7 = -1. Equal.

You can write the answer as x = 2. Whether the x ends up on the left or right does not matter; just state x = number at the end. Type your own into the linear equation solver to compare each line with yours.

Equations with fractions

Fractions make people nervous, but there is a clean trick: multiply every term by the least common denominator (LCD) to clear them. Solve x/3 + x/4 = 7. The LCD of 3 and 4 is 12 (see LCM and GCF if that is rusty).

  • Multiply every term by 12: 4x + 3x = 84
  • Combine like terms: 7x = 84
  • Divide by 7: x = 12
  • Check: 12/3 + 12/4 = 4 + 3 = 7

Multiplying through by the LCD turns the equation into one with whole numbers only, which is much easier to manage.

A word problem

A phone plan costs 25 a month plus 0.10 per text. For what number of texts does the bill reach 40? Let x be the number of texts. The equation is 25 + 0.10x = 40.

  • Subtract 25 from both sides: 0.10x = 15
  • Divide by 0.10: x = 150

So 150 texts cost 40.00, which matches. Turning words into an equation is usually the hardest part. Define the variable first, say what each phrase means, and only then solve. More tips are in how to solve word problems.

Two special cases

EquationAfter simplifyingResult
2x + 3 = 2x + 53 = 5No solution (never true)
2(x + 1) = 2x + 22 = 2Infinitely many solutions (always true)
2x + 3 = 5x − 6x = 3One solution

If the x terms disappear and you are left with a false statement like 3 = 5, the equation has no solution. If you are left with a true statement like 2 = 2, every number works. Neither is a mistake; they are legitimate answers.

Graph of a linear equation

0132538500123456y = 3x + 5y = 20x
The solution of 3x + 5 = 20 is where the line y = 3x + 5 meets y = 20: at x = 5.

Graphing is a good way to see why a linear equation has one solution: two straight lines cross at most once. You can plot both sides with the function grapher.

The most common mistakes

  • Changing only one side. Whatever you add, subtract, multiply or divide by must be applied to the whole of both sides.
  • Sign errors when moving terms. Moving +5 across the equals sign makes it −5. Subtracting 5 from both sides is the safer way to think of it.
  • Forgetting to distribute. 2(x − 4) is 2x − 8, not 2x − 4.
  • Dividing only one term. In 3x + 5 = 20, divide the whole of each side by 3 after you subtract 5, not before.
  • Skipping the check. Substituting back takes ten seconds and confirms your answer.

If a step trips you up, see common algebra mistakes, and keep the algebra formulas cheat sheet nearby. Once you are comfortable, move on to systems of equations, where two equations share two unknowns.

Frequently asked questions

What is the first step in solving a linear equation?

Simplify each side by expanding brackets and combining like terms. Then collect the x terms on one side and the numbers on the other.

How do I solve a linear equation with fractions?

Multiply every term by the least common denominator to clear the fractions, then solve the resulting whole-number equation.

Can a linear equation have no solution?

Yes. If the x terms cancel and you are left with a false statement, such as 3 = 5, there is no solution.

How do I check my answer?

Substitute the value back into the original equation and confirm that both sides give the same number.

Written and reviewed by Mateuss M.

Mateuss M. writes and reviews mathematical content for CalcSolver, focusing on online calculators, formulas, equations, and practical math tools. He reviews calculator functionality, calculation methods, formulas, examples, and explanations to help ensure that each tool is clear, useful, and easy to understand.

Keep reading