How-to guides · 6 min read
How to Solve Linear Equations Step by Step (With Examples)

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 x | Undo it by | Example |
|---|---|---|
| Add 5 | Subtract 5 from both sides | x + 5 = 9 → x = 4 |
| Subtract 5 | Add 5 to both sides | x − 5 = 9 → x = 14 |
| Multiply by 3 | Divide both sides by 3 | 3x = 12 → x = 4 |
| Divide by 3 | Multiply both sides by 3 | x ÷ 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
Step-by-step working 4 steps
- 1Write the equation
3x + 5 = 20
- 2Collect 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.
- 3Divide by the coefficient of x
x = 15 ÷ 3 = 5
- 4Check 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.
| Step | Working |
|---|---|
| 1. Expand the bracket | 2x − 8 + 3 = 3x − 7 |
| 2. Combine like terms | 2x − 5 = 3x − 7 |
| 3. Subtract 2x from both sides | −5 = x − 7 |
| 4. Add 7 to both sides | 2 = x |
| 5. Check | Left: 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
| Equation | After simplifying | Result |
|---|---|---|
| 2x + 3 = 2x + 5 | 3 = 5 | No solution (never true) |
| 2(x + 1) = 2x + 2 | 2 = 2 | Infinitely many solutions (always true) |
| 2x + 3 = 5x − 6 | x = 3 | One 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
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.
Keep reading
10 Common Algebra Mistakes (With Numbers That Prove They’re Wrong)
The ten algebra errors students make most often, each disproved with a quick numerical check — (a+b)² ≠ a²+b², √(a+b) ≠ √a+√b, and more.
Study tipsHow to Solve Math Word Problems: A Four-Step Method
A repeatable four-step method for math word problems — read, define, calculate, check — with percentage and speed examples.
Charts & referencesAlgebra Formulas Cheat Sheet: Identities, Exponents, Quadratics
The algebra formulas you need most: special products, exponent and log rules, the quadratic formula, slope and distance, with a worked check.
How-to guidesHow to Solve Inequalities Step by Step (With Examples)
Solve inequalities like 3x + 5 > 20 using the same steps as equations, plus one new rule: flip the sign when you multiply or divide by a negative.