How-to guide

How to solve linear equations step by step

How to solve linear equations step by step: clear fractions, expand brackets, collect x and divide. 5 worked examples, a graph and practice with answers.

7 minutesBy Hira Noor, mathematicianUpdated
Short answerTo solve a linear equation, clear any fractions, expand the brackets and combine like terms on each side. Then move the x terms to one side and the numbers to the other, divide both sides by the coefficient of x, and check the answer in the original equation. For 4x−7=134x - 7 = 13: add 7 to both sides to get 4x=204x = 20, then divide by 4 to get x=5x = 5. Check: 4(5)−7=134(5) - 7 = 13.

Just need the answer?

Type the equation into the math solver to get the exact answer with numbered steps you can compare with your own working. The rest of this guide shows how to solve linear equations by hand, with five worked examples and practice problems.

What is a linear equation?

A linear equation in one variable is an equation that can be rearranged to the form ax+b=0ax + b = 0, where a and b are numbers and a≠0a \ne 0. The variable appears only to the first power: no x2x^2, no x\sqrt{x}, no x in a denominator and no x multiplied by itself. Its graph is a straight line, and it has exactly one solution, x=−bax = -\frac{b}{a}, unless the x terms cancel, in which case it has no solution or every number is a solution.

  • Linear: 4x−7=134x - 7 = 13, 5(x−1)=2(x+4)+35(x - 1) = 2(x + 4) + 3, x+13−x4=1\frac{x + 1}{3} - \frac{x}{4} = 1 and 0.25x+1.5=0.75x−2.50.25x + 1.5 = 0.75x - 2.5.
  • Not linear: x2−5x+6=0x^2 - 5x + 6 = 0 (a quadratic), 2x=3x2^x = 3x (an equation with no formula) and 3x=6\frac{3}{x} = 6 (x in a denominator).

How to solve linear equations step by step

Every linear equation in one variable can be solved with the same general strategy. Skip any step that does not apply: 4x−7=134x - 7 = 13 has no fractions, brackets or like terms, so it starts at step 5.

  1. Clear fractions or decimals

    If any term has a denominator, multiply every term on both sides by the lowest common denominator. For decimals, multiply every term by 10, 100 or 1000 so all coefficients become whole numbers.

  2. Expand brackets

    Multiply out each bracket with the distributive property. Watch the sign: −2(x−4)=−2x+8-2(x - 4) = -2x + 8.

  3. Combine like terms

    On each side separately, add the x terms together and the plain numbers together.

  4. Collect x on one side

    Add or subtract an x term on both sides so x appears on one side only.

  5. Collect numbers on the other side

    Add or subtract the same number on both sides.

  6. Divide by the coefficient

    Divide both sides by the number in front of x. Leave the answer as a fraction if it does not divide exactly.

  7. Check

    Substitute the answer into the original equation, not a rewritten line. Both sides must be equal.

Each step uses a property of equality: adding, subtracting, multiplying or dividing both sides by the same number (other than dividing by zero) keeps the equation balanced, so the solution does not change.

Example 1: a two-step equation

Solve 4x−7=134x - 7 = 13. Undo the subtraction first, then the multiplication:

4x−7+7=13+7⇒4x=20⇒x=204=54x - 7 + 7 = 13 + 7 \quad\Rightarrow\quad 4x = 20 \quad\Rightarrow\quad x = \frac{20}{4} = 5

Check: 4(5)−7=20−7=134(5) - 7 = 20 - 7 = 13. Correct.

The lines y = 4x − 7 and y = 13 meet at x = 5
01020012345678xyy = 4x − 7 (left side)y = 13 (right side)Solution (5, 13)
Graph each side of the equation as its own line. The x-coordinate where they cross is the solution, x = 5.

Example 2: brackets and variables on both sides

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

Solving 5(x − 1) = 2(x + 4) + 3
WorkingWhat was done
5x−5=2x+8+35x - 5 = 2x + 8 + 3Expanded both brackets
5x−5=2x+115x - 5 = 2x + 11Combined 8 + 3
3x−5=113x - 5 = 11Subtracted 2x from both sides
3x=163x = 16Added 5 to both sides
x=163x = \frac{16}{3}Divided both sides by 3

The answer is x=163x = \frac{16}{3}, about 5.3333. Keep it as a fraction for the check: the left side is 5(163−1)=5⋅133=6535(\frac{16}{3} - 1) = 5 \cdot \frac{13}{3} = \frac{65}{3}, and the right side is 2(163+4)+3=563+93=6532(\frac{16}{3} + 4) + 3 = \frac{56}{3} + \frac{9}{3} = \frac{65}{3}. Both sides agree.

Example 3: a linear equation with fractions

Solve x+13−x4=1\frac{x + 1}{3} - \frac{x}{4} = 1. The denominators are 3 and 4, so the lowest common denominator is 12. Multiply every term, including the 1 on the right, by 12:

4(x+1)−3x=12⇒4x+4−3x=12⇒x+4=12⇒x=84(x + 1) - 3x = 12 \quad\Rightarrow\quad 4x + 4 - 3x = 12 \quad\Rightarrow\quad x + 4 = 12 \quad\Rightarrow\quad x = 8

Check: 8+13−84=3−2=1\frac{8 + 1}{3} - \frac{8}{4} = 3 - 2 = 1. Correct.

Example 4: a linear equation with decimals

Solve 0.25x+1.5=0.75x−2.50.25x + 1.5 = 0.75x - 2.5. The longest decimal has two places, so multiply every term by 100 to work with whole numbers:

25x+150=75x−250⇒400=50x⇒x=825x + 150 = 75x - 250 \quad\Rightarrow\quad 400 = 50x \quad\Rightarrow\quad x = 8

Here x was collected on the right, where its coefficient is larger, so the coefficient stays positive. Check: 0.25(8)+1.5=3.50.25(8) + 1.5 = 3.5 and 0.75(8)−2.5=3.50.75(8) - 2.5 = 3.5. Both sides agree.

Example 5: a word problem

A candle is 30 cm tall and burns down 1.5 cm every hour. After how many hours is it 12 cm tall? Let h be the number of hours. The height is the starting height minus 1.5 cm for each hour, so:

30−1.5h=12⇒−1.5h=−18⇒h=−18−1.5=1230 - 1.5h = 12 \quad\Rightarrow\quad -1.5h = -18 \quad\Rightarrow\quad h = \frac{-18}{-1.5} = 12

The candle is 12 cm tall after 12 hours. Check: 30−1.5×12=30−18=1230 - 1.5 \times 12 = 30 - 18 = 12. To set up a word problem, name the unknown with a letter, write each quantity in terms of it, and set the two expressions that must be equal on either side of the equals sign.

When there is no solution, or every number works

Sometimes the x terms cancel completely. What is left tells you the answer. 2(x+3)=2x+52(x + 3) = 2x + 5 becomes 2x+6=2x+52x + 6 = 2x + 5, then 6=56 = 5, which is false, so the equation has no solution (a contradiction). 3(x−2)=3x−63(x - 2) = 3x - 6 becomes 3x−6=3x−63x - 6 = 3x - 6, then 0=00 = 0, which is always true, so every real number is a solution (an identity). On a graph, the two sides are parallel lines that never meet in the first case and the same line in the second.

Linear inequalities

Solve an inequality such as 5−2x≥115 - 2x \ge 11 with the same steps, with one extra rule: when you multiply or divide both sides by a negative number, reverse the inequality sign.

5−2x≥11⇒−2x≥6⇒x≤−35 - 2x \ge 11 \quad\Rightarrow\quad -2x \ge 6 \quad\Rightarrow\quad x \le -3

Dividing by −2 turned ≥\ge into ≤\le. Check with a value in the answer, such as x = −4: 5+8=135 + 8 = 13, which is at least 11. A value outside it, such as x = 0, gives 5, which is not. In interval notation the answer is (−∞,−3](-\infty, -3]. Check it with the inequality calculator.

Practice problems with answers

Solve each linear equation on paper first. The answers are below the list, and each one links to the math solver with the equation already entered, so you can compare its steps with yours.

  1. 3x+8=293x + 8 = 29
  2. 7−2x=157 - 2x = 15
  3. 4(x−3)=2x+104(x - 3) = 2x + 10
  4. 6−3(4x−1)=4x−76 - 3(4x - 1) = 4x - 7
  5. x2+x3=10\frac{x}{2} + \frac{x}{3} = 10
  6. 0.2x+1.4=0.5x−0.10.2x + 1.4 = 0.5x - 0.1
  7. 2x+5=2(x+1)2x + 5 = 2(x + 1)

Answers

Answers to the practice problems
ProblemAnswerCheck it
1x=7x = 7Open in solver
2x=−4x = -4Open in solver
3x=11x = 11Open in solver
4x=1x = 1Open in solver
5x=12x = 12Open in solver
6x=5x = 5Open in solver
7No solution (5=25 = 2)Open in solver

Check your answer with ScientifiCalc

  • Math solver: type 5(x-1)=2(x+4)+3 and choose Solve. It returns x = 16/3 ≈ 5.333333333 with numbered steps and a substitution check.
  • Inequality calculator: enter 5 - 2x >= 11 to get (−∞,−3](-\infty, -3] in interval notation, worked out with a sign chart.
  • Graphing calculator: plot each side as its own line, y = 5(x-1) and y = 2(x+4)+3. They intersect at x ≈ 5.3333, listed in the Key points panel.

Type any linear equation, with brackets, fractions, decimals or x on both sides, and get the exact answer with every step.

Open the math solver

Common mistakes

  • Multiplying only some terms by the denominator. In Example 3, the 1 on the right must also be multiplied by 12.
  • Dropping a sign when expanding. −3(x−2)-3(x - 2) is −3x+6-3x + 6. The minus sign multiplies both terms in the bracket.
  • Moving a term without changing its sign. Taking 2x2x from the right side means subtracting 2x2x from both sides, so it appears as −2x-2x on the left.
  • Rounding before the end. Write x=163x = \frac{16}{3}, not 5.33, then round only if the question asks for a decimal.
  • Checking against a rewritten line. Substitute into the original equation; a copying slip in an early line will not show up otherwise.
  • Forgetting to flip the inequality after multiplying or dividing by a negative number.

Frequently asked questions

What is the first step in solving a linear equation?

Simplify each side. Clear fractions or decimals by multiplying every term by the same number, then expand any brackets and combine like terms. Only after that move the x terms to one side.

How many solutions can a linear equation have?

Exactly one, none or infinitely many. If the x terms cancel and leave a false statement such as 6 = 5, there is no solution. If they leave a true statement such as 0 = 0, every real number is a solution.

Which side should I move x to?

Either side works, and the answer is the same. Moving x to the side with the larger coefficient keeps the coefficient positive, which avoids dividing by a negative number.

Is it wrong to leave the answer as a fraction?

No. A fraction such as 16/3 is the exact answer, and teachers usually prefer it. Give a decimal only when the question asks for one, and round at the last step.

How do I solve two linear equations at once?

That is a system of equations, solved by elimination or substitution. The two-equation guide works through both methods.

Tools used in this guide

Step-by-Step Math Solver

Free worked solutions for equations, systems, inequalities, factoring, derivatives, integrals, limits and matrices.

Inequality Calculator

Linear, compound, absolute-value, quadratic and rational inequalities solved step by step.

Graphing Calculator

Plot functions, equations, inequalities, parametric and polar curves; find roots and intersections.