Skip to content
  • Open the math solver
  • Ask the AI tutor
  • Find an AP course
  • Create a quiz
  • Open the calculator
  • Graphing Calculator
  • Browse all calculators
  • Read math guides
↑ ↓Enter to open · Esc to close
Solve a problem

Algebra

How to Solve Linear Equations Step by Step

By MathSolver Pro Editorial Team · Published

A linear equation is solved by undoing what has been done to the unknown, in reverse order, while keeping both sides equal. This guide turns that idea into a five-step routine and works through every common variation.

What a linear equation is

A linear equation in one variable is an equation that can be rearranged into the form ax+b=0ax + b = 0, where aa and bb are numbers and a≠0a \neq 0. The unknown appears only to the first power: there is no x2x^2, no x\sqrt{x}, and no xx in a denominator. Because the graph of y=ax+by = ax + b is a straight line, the equation has exactly one solution, x=−bax = -\frac{b}{a}, which is where that line crosses the x-axis.

Equations such as 3x+7=223x + 7 = 22, 5(x−2)=3x+45(x - 2) = 3x + 4 and x3+x4=7\frac{x}{3} + \frac{x}{4} = 7 are all linear, even though they do not look like ax+b=0ax + b = 0 yet. The job is to rewrite them, one legal step at a time, until the unknown stands alone.

The balance rule behind every step

Think of an equation as a balanced scale. You may do anything you like to one side as long as you do exactly the same thing to the other side, because equal quantities changed in the same way stay equal. The four operations you will use are:

  • add the same number or expression to both sides;
  • subtract the same number or expression from both sides;
  • multiply both sides by the same non-zero number;
  • divide both sides by the same non-zero number.

Multiplying or dividing by zero is the one forbidden move: multiplying by zero turns any equation into 0=00 = 0 and destroys the information, and dividing by zero is undefined.

a=b  ⇒  a+c=b+c,a−c=b−c,ac=bc,ac=bc (c≠0)a = b \;\Rightarrow\; a + c = b + c, \quad a - c = b - c, \quad ac = bc, \quad \frac{a}{c} = \frac{b}{c}\ (c \neq 0)

A five-step routine

  1. Clear grouping symbols by distributing: 5(x−2)5(x - 2) becomes 5x−105x - 10.
  2. Clear fractions or decimals by multiplying both sides by the least common denominator or by a power of 10.
  3. Combine like terms on each side separately.
  4. Collect the variable terms on one side and the constant terms on the other by adding or subtracting.
  5. Divide by the coefficient of the variable, then substitute the answer back into the original equation to check it.

Not every equation needs every step. The routine simply gives you an order that avoids the most common tangles, such as trying to divide before like terms have been combined.

Worked examples from simple to harder

Example 1: two steps, 3x+7=223x + 7 = 22

  1. Subtract 7 from both sides: 3x=153x = 15.
  2. Divide both sides by 3: x=5x = 5.
  3. Check: 3(5)+7=15+7=223(5) + 7 = 15 + 7 = 22. Correct.

Notice the order. Seven was added last when the expression 3x+73x + 7 was built, so it is removed first. Solving reverses the order of operations.

Example 2: brackets and variables on both sides, 5(x−2)=3x+45(x - 2) = 3x + 4

  1. Distribute: 5x−10=3x+45x - 10 = 3x + 4.
  2. Subtract 3x3x from both sides: 2x−10=42x - 10 = 4.
  3. Add 10 to both sides: 2x=142x = 14.
  4. Divide by 2: x=7x = 7.
  5. Check: left side 5(7−2)=255(7 - 2) = 25; right side 3(7)+4=253(7) + 4 = 25. Both sides agree.

Example 3: a negative coefficient, −4x+9=2x−15-4x + 9 = 2x - 15

  1. Subtract 2x2x from both sides: −6x+9=−15-6x + 9 = -15.
  2. Subtract 9 from both sides: −6x=−24-6x = -24.
  3. Divide by −6-6: x=4x = 4. A negative divided by a negative is positive.
  4. Check: −4(4)+9=−7-4(4) + 9 = -7 and 2(4)−15=−72(4) - 15 = -7.

If you prefer a positive coefficient, collect the variable terms on the side that already has the larger coefficient. In Example 3, adding 4x4x to both sides gives 9=6x−159 = 6x - 15, then 24=6x24 = 6x and x=4x = 4, with no negative division at all.

Equations with fractions and decimals

Fractions are where most errors happen, so remove them at the start. Multiply every term on both sides by the least common denominator (LCD). Every term means every term, including whole numbers that have no visible denominator.

Example 4: x3+x4=7\frac{x}{3} + \frac{x}{4} = 7

  1. The LCD of 3 and 4 is 12. Multiply each term by 12: 12⋅x3+12⋅x4=12⋅712 \cdot \frac{x}{3} + 12 \cdot \frac{x}{4} = 12 \cdot 7.
  2. Simplify: 4x+3x=844x + 3x = 84.
  3. Combine like terms: 7x=847x = 84, so x=12x = 12.
  4. Check: 123+124=4+3=7\frac{12}{3} + \frac{12}{4} = 4 + 3 = 7.

Decimals work the same way with a power of ten. Choose the power that clears the decimal with the most places.

Example 5: 0.2x+1.5=0.5x−0.30.2x + 1.5 = 0.5x - 0.3

  1. Every decimal has one place, so multiply by 10: 2x+15=5x−32x + 15 = 5x - 3.
  2. Subtract 2x2x and add 3: 18=3x18 = 3x.
  3. Divide by 3: x=6x = 6.
  4. Check: 0.2(6)+1.5=2.70.2(6) + 1.5 = 2.7 and 0.5(6)−0.3=2.70.5(6) - 0.3 = 2.7.

You can confirm fraction-heavy equations with the fraction calculator or compare each step with the equation solver.

No solution and infinitely many solutions

Sometimes the variable disappears completely while you are solving. What is left tells you which special case you have.

2(x+3)=2x+6  ⇒  2x+6=2x+6  ⇒  6=62(x + 3) = 2x + 6 \;\Rightarrow\; 2x + 6 = 2x + 6 \;\Rightarrow\; 6 = 6

A true statement such as 6=66 = 6 means the two sides are the same expression, so every real number is a solution. The equation is called an identity.

2(x+3)=2x+5  ⇒  6=52(x + 3) = 2x + 5 \;\Rightarrow\; 6 = 5

A false statement such as 6=56 = 5 means no value of xx can ever make the sides equal: the equation has no solution. Graphically, the two sides are parallel lines with the same slope and different intercepts, so they never meet.

Solving for one variable in a formula

The same balance rule rearranges formulas, which is often called solving a literal equation. Treat every letter except the one you want as if it were a number.

Example 6: solve 2x+3y=122x + 3y = 12 for yy

  1. Subtract 2x2x from both sides: 3y=12−2x3y = 12 - 2x.
  2. Divide every term by 3: y=4−23xy = 4 - \frac{2}{3}x.
  3. This is slope-intercept form: the line has slope −23-\frac{2}{3} and y-intercept 4.

Rewriting an equation this way is the first step for graphing it, which you can explore with the slope calculator.

Turning a word problem into an equation

Word problems become linear equations when one quantity changes at a constant rate. Name the unknown, write each phrase as an expression, and set the two descriptions of the same amount equal.

Example 7: a phone plan costs 15 dollars a month plus 10 cents per text. One bill was 27 dollars. How many texts were sent?

  1. Let tt be the number of texts. The bill is 15+0.10t15 + 0.10t.
  2. Set it equal to the amount paid: 15+0.10t=2715 + 0.10t = 27.
  3. Subtract 15: 0.10t=120.10t = 12. Divide by 0.10: t=120t = 120.
  4. Check: 15+0.10(120)=15+12=2715 + 0.10(120) = 15 + 12 = 27. The answer is 120 texts.

More practice translating sentences into equations is in the word problem solver.

Common mistakes and how to avoid them

  • Distributing to the first term only: 3(x+4)3(x + 4) is 3x+123x + 12, not 3x+43x + 4.
  • Losing a negative sign: −(x−5)-(x - 5) is −x+5-x + 5. Distribute the minus to every term in the bracket.
  • Multiplying only the fractions by the LCD and forgetting the whole-number terms.
  • Moving a term across the equals sign without changing its sign. Saying a term moves is shorthand for subtracting it from both sides.
  • Stopping at −x=3-x = 3. Divide by −1-1 to get x=−3x = -3.
  • Skipping the check. Substituting into the original equation, not a later line, catches errors made in any step.

Where to go next

Once linear equations feel automatic, the same skills carry straight into linear inequalities, where one extra rule applies, and into systems of equations, where two linear equations share two unknowns. If an equation contains x2x^2, read the guide to solving quadratic equations. To practise, type any of the examples above into the solve for x calculator and compare its steps with yours.

Frequently asked questions

How do I know if an equation is linear?

After simplifying, the variable appears only to the first power and is never inside a root, an absolute value or a denominator. If you can rearrange it to ax+b=0ax + b = 0 with a≠0a \neq 0, it is linear.

Does it matter which side I collect the variable on?

No. Both choices give the same answer. Collecting on the side with the larger coefficient keeps the coefficient positive and avoids dividing by a negative number.

Why should I check my answer in the original equation?

A check in a later line only confirms the steps after that line. The original equation is the only one you know is correct, so substituting there catches an error made anywhere in the working.

What does it mean when I end up with 0 = 0?

Any true statement without a variable means the equation is an identity: every real number is a solution. A false statement such as 0=40 = 4 means there is no solution.

Can a linear equation have a fraction as its answer?

Yes. For example 3x=23x = 2 gives x=23x = \frac{2}{3}. Leave the answer as an exact fraction unless the question asks for a decimal, because a rounded decimal such as 0.670.67 will not check exactly when you substitute it back.

MathSolver Pro Editorial Team

Math content and review

Our editorial team writes every guide to explain the reasoning behind each method, not just the answer. Each worked example is checked against the site's own solver engines and automated tests before it is published, and articles are revised whenever a method or an exam format changes.