Jugami Algebra

Jugami › Algebra › Solving Linear Equations

Solving Linear Equations

Keep it balanced. Get x alone.

A gym costs $25 to join and $15 a month. You have $115. How many months can you pay for? You could guess and check, or you could write one short equation and solve it in two moves.

This page shows you how, from one-step equations to ones with fractions and x on both sides. Every idea has a worked example, problems with answers you can reveal, and a practice machine at the end.

A balance scale. The left pan holds two teal boxes marked x and three gold weights marked 1. The right pan holds eleven gold weights. The scale is level, showing 2x + 3 = 11. xx111 11111111111 2x + 3 = 11

What is an equation?

An expression is a math phrase, like 3x + 5. It doesn’t say anything is true. It’s just a quantity.

An equation is a full sentence: two expressions joined by an equals sign, like 3x + 5 = 20. It claims that the left side and the right side are the same number.

The letter x is a variable, a stand-in for a number we don’t know yet. A solution is a value of the variable that makes the equation true. Here the solution is x = 5, because 3 · 5 + 5 = 15 + 5 = 20.

To solve an equation means to find every solution. Usually there is exactly one, but you’ll see two surprising exceptions later.

What makes it “linear”?

In a linear equation the variable only appears to the first power: you see x, 4x or x/3, but never x², √x or 1/x. The name comes from graphs: each side of a linear equation graphs as a straight line.

7x − 2 = 3x + 10 is linear. x² + 1 = 10 is not; that one is a quadratic, a later unit.

The balance idea

Picture an equation as a balance scale. The equals sign is the pivot in the middle. Whatever is on the left weighs exactly as much as whatever is on the right, so the scale is level.

You can change an equation any way you like, as long as you keep the scale level. That gives the one rule behind everything on this page:

Do the same thing to both sides.

Add the same amount to both sides, subtract the same amount, multiply or divide both sides by the same number (anything but zero), and the scale stays balanced. Your goal is to end with x alone on one side. Then the other side tells you what x weighs.

The balance picture is great for whole numbers. Algebra lets us go further: negative numbers, fractions and decimals all follow the same rule, even though they’re hard to put on a scale.

Inverse operations: the undo buttons

To get x alone, you undo whatever has been done to it. Each operation has an inverse, an operation that cancels it out.

Operations and their inverses
If x has been…Undo it by…Example
added to (x + 4)subtractingx + 4 − 4 = x
subtracted from (x − 4)addingx − 4 + 4 = x
multiplied (4x)dividing4x ÷ 4 = x
divided (x/4)multiplying(x/4) · 4 = x

Remember that you must apply the inverse to both sides, not just the side with x.

One-step equations

When only one thing has been done to x, one inverse operation solves it. Write each step under the last, and say what you did.

Worked examples

x + 9 = 14Startx + 9 − 9 = 14 − 9Subtract 9 from both sidesx = 5Check: 5 + 9 = 14 ✓
x − 6 = 2Startx − 6 + 6 = 2 + 6Add 6 to both sidesx = 8Check: 8 − 6 = 2 ✓
4x = 28Start4x ÷ 4 = 28 ÷ 4Divide both sides by 4x = 7Check: 4 · 7 = 28 ✓
x/5 = 3Start(x/5) · 5 = 3 · 5Multiply both sides by 5x = 15Check: 15 ÷ 5 = 3 ✓

Watch the sign. −x = 6 is not solved yet. It says “the opposite of x is 6.” Divide both sides by −1 (or multiply by −1) to get x = −6.

Your turn

Solve each one on paper first, then open it to check.

x − 11 = −4
x − 11 = −4Startx = −4 + 11Add 11 to both sidesx = 7Check: 7 − 11 = −4 ✓
−3x = 21
−3x = 21Startx = 21 ÷ (−3)Divide both sides by −3x = −7Check: −3 · (−7) = 21 ✓
x/4 = −2
x/4 = −2Startx = −2 · 4Multiply both sides by 4x = −8Check: −8 ÷ 4 = −2 ✓

Two-step equations

In 3x + 5 = 20, two things happened to x: it was multiplied by 3, then 5 was added. To undo them, work backwards, like taking off your shoes before your socks. Undo the last thing first.

Building 3x + 5: start with x, multiply by 3 to get 3x, add 5 to get 3x + 5. Undoing goes in reverse: subtract 5 first, then divide by 3. x 3x 3x + 5 × 3+ 5 − 5 (undo first)÷ 3 (undo second)
Building the expression goes left to right. Solving goes right to left, in reverse order.

Worked examples

3x + 5 = 20Start3x = 15Subtract 5 from both sidesx = 5Divide both sides by 3. Check: 3 · 5 + 5 = 20 ✓
x/2 − 4 = 3Startx/2 = 7Add 4 to both sidesx = 14Multiply both sides by 2. Check: 14/2 − 4 = 3 ✓
7 − 2x = 13Start: notice the x-term is −2x−2x = 6Subtract 7 from both sidesx = −3Divide both sides by −2. Check: 7 − 2(−3) = 7 + 6 = 13 ✓

Your turn

5x − 8 = 17
5x − 8 = 17Start5x = 25Add 8 to both sidesx = 5Divide by 5. Check: 25 − 8 = 17 ✓
4 + x/3 = 10
4 + x/3 = 10Startx/3 = 6Subtract 4 from both sidesx = 18Multiply by 3. Check: 4 + 6 = 10 ✓
−4x + 1 = 13
−4x + 1 = 13Start−4x = 12Subtract 1 from both sidesx = −3Divide by −4. Check: −4(−3) + 1 = 13 ✓

Variables on both sides

Sometimes x shows up on both sides, like 5x − 4 = 2x + 11. The plan: first gather all the x-terms on one side, then it’s a two-step equation.

Tip: move the smaller x-term. That way the x-term you keep has a positive coefficient (the number in front of x), which means fewer negative signs to trip over.

Worked examples

5x − 4 = 2x + 11Start3x − 4 = 11Subtract 2x from both sides3x = 15Add 4 to both sidesx = 5Divide by 3. Check: 25 − 4 = 21 and 10 + 11 = 21 ✓
2x + 9 = 6x − 7Start9 = 4x − 7Subtract 2x from both sides (2x is smaller)16 = 4xAdd 7 to both sides4 = xDivide by 4, so x = 4. Check: 17 = 17 ✓

Ending with 4 = x is fine. It means exactly the same as x = 4.

Your turn

7x + 2 = 4x + 14
7x + 2 = 4x + 14Start3x + 2 = 14Subtract 4x from both sides3x = 12Subtract 2x = 4Divide by 3. Check: 30 = 30 ✓
x − 5 = 3x + 7
x − 5 = 3x + 7Start−5 = 2x + 7Subtract x from both sides−12 = 2xSubtract 7x = −6Divide by 2. Check: −11 = −11 ✓

Distributing and combining like terms

Before you start moving things across the equals sign, tidy up each side.

  • Distribute: multiply the number outside the parentheses by every term inside. 3(x − 4) = 3x − 12.
  • Combine like terms: add up the x-terms with each other and the plain numbers (constants) with each other. 4x + 3 − x = 3x + 3.

Worked examples

3(x − 4) = 2x + 1Start3x − 12 = 2x + 1Distribute the 3x − 12 = 1Subtract 2x from both sidesx = 13Add 12. Check: 3(9) = 27 and 26 + 1 = 27 ✓
4x + 3 − x = 2(x + 5)Start3x + 3 = 2x + 10Combine 4x − x on the left; distribute on the rightx + 3 = 10Subtract 2xx = 7Subtract 3. Check: 28 + 3 − 7 = 24 and 2(12) = 24 ✓

A minus sign in front of parentheses is the trickiest case. Treat it as multiplying by a negative number, and the sign of every term inside flips.

10 − 2(x + 3) = 8Start10 − 2x − 6 = 8Distribute −2: −2 · x and −2 · 34 − 2x = 8Combine 10 − 6−2x = 4Subtract 4x = −2Divide by −2. Check: 10 − 2(1) = 8 ✓

Your turn

5(x + 2) = 3x + 18
5(x + 2) = 3x + 18Start5x + 10 = 3x + 18Distribute2x + 10 = 18Subtract 3x2x = 8Subtract 10x = 4Divide by 2. Check: 30 = 30 ✓
6 − (x − 4) = 2x + 1
6 − (x − 4) = 2x + 1Start6 − x + 4 = 2x + 1The minus flips both signs inside10 − x = 2x + 1Combine 6 + 49 = 3xAdd x and subtract 1 on both sidesx = 3Divide by 3. Check: 6 − (−1) = 7 and 6 + 1 = 7 ✓

Equations with fractions (and decimals)

Fractions are allowed, but they’re annoying. The fastest trick is to clear the fractions right away: multiply every term on both sides by the least common denominator (LCD), the smallest number all the denominators divide into.

Worked examples

x/3 + x/4 = 7Start. The LCD of 3 and 4 is 124x + 3x = 84Multiply every term by 12: (x/3)·12 = 4x, (x/4)·12 = 3x, 7·12 = 847x = 84Combine like termsx = 12Divide by 7. Check: 12/3 + 12/4 = 4 + 3 = 7 ✓
(x + 2)/5 = 3Start. The whole top is divided by 5x + 2 = 15Multiply both sides by 5x = 13Subtract 2. Check: 15/5 = 3 ✓
(2/3)x − 1 = 5Start(2/3)x = 6Add 1x = 9Multiply by 3/2, the reciprocal of 2/3. Check: (2/3)(9) − 1 = 6 − 1 = 5 ✓

Answers can be fractions too. Not every equation comes out to a whole number, and that’s fine:

4x + 1 = 7Start4x = 6Subtract 1x = 3/2Divide by 4 and simplify 6/4. That’s 1.5. Check: 4(1.5) + 1 = 7 ✓

Decimals work the same way. Multiply by 10, 100 or 1000 to make them whole numbers:

0.5x + 1.2 = 3.7Start5x + 12 = 37Multiply every term by 105x = 25Subtract 12x = 5Divide by 5. Check: 2.5 + 1.2 = 3.7 ✓

Your turn

x/2 + 3 = x/5 + 6
x/2 + 3 = x/5 + 6Start. The LCD is 105x + 30 = 2x + 60Multiply every term by 103x = 30Subtract 2x and subtract 30x = 10Divide by 3. Check: 5 + 3 = 8 and 2 + 6 = 8 ✓
(3x − 1)/4 = 5
(3x − 1)/4 = 5Start3x − 1 = 20Multiply both sides by 43x = 21Add 1x = 7Divide by 3. Check: 20/4 = 5 ✓

Special cases: no solution, or infinitely many

Most linear equations have exactly one solution. But sometimes the x-terms cancel out completely, and you’re left with a statement that has no x in it at all. What it says tells you the answer.

No solution

2(x + 3) = 2x + 1Start2x + 6 = 2x + 1Distribute6 = 1Subtract 2x from both sidesNo solution6 = 1 is false, and no value of x can make it true

The two sides can never be equal. The set of solutions is empty, sometimes written ∅.

Infinitely many solutions

3(x − 2) + x = 4x − 6Start3x − 6 + x = 4x − 6Distribute4x − 6 = 4x − 6Combine like terms: both sides are identical−6 = −6Subtract 4x from both sidesAll real numbersAlways true, so every x works

An equation that is true for every value of the variable is called an identity. Try any number: if x = 10, both sides are 34.

Don’t write “x = −6” when you get −6 = −6. The variable disappeared. The answer is “all real numbers,” not one number.

Three small graphs, one for each side of an equation. One solution: the lines y = x + 1 and y = −x + 5 cross once, at (2, 3). No solution: the lines y = x + 1 and y = x − 2 are parallel and never meet. Infinitely many: y = 2(x + 1) and y = 2x + 2 are the same line, so they meet everywhere. (2, 3) One solution No solution Infinitely many
Graph each side as its own line, y = left side and y = right side. Left: x + 1 = −x + 5 has one solution, x = 2, where the lines cross. Middle: x + 1 = x − 2 has none, because the lines are parallel. Right: 2(x + 1) = 2x + 2 is the same line twice, so every x works.

Checking your answer

You never have to wonder whether your answer is right. Substitute it, meaning put it in place of x in the original equation, and work out each side separately. If the two sides match, you’re right.

Say a classmate solves 5x − 4 = 2x + 11 and gets x = 8.

Checking two possible answers to 5x − 4 = 2x + 11
TryLeft: 5x − 4Right: 2x + 11Result
x = 840 − 4 = 3616 + 11 = 2736 ≠ 27, wrong
x = 525 − 4 = 2110 + 11 = 2121 = 21, correct

Two habits make checking work. Always check in the original equation, because a mistake in your middle steps would be copied into a check that starts there. And work out each side on its own, without moving anything across the equals sign.

Word problems

Real problems don’t arrive as equations. You have to write the equation yourself. A plan that works almost every time:

  1. Name the unknown. “Let m = the number of months.” Any letter is fine; pick one that reminds you what it means.
  2. Translate the sentence into an equation. “Is,” “costs” and “equals” usually become =.
  3. Solve it.
  4. Check the answer against the words, not just the equation.
  5. Answer the question in a sentence, with units.

Example 1: The gym

A gym charges a $25 sign-up fee plus $15 per month. You have $115. How many months can you pay for?

25 + 15m = 115Let m = months. Fee plus 15 per month equals 11515m = 90Subtract 25m = 6Divide by 15

Check: $25 + 6 × $15 = $25 + $90 = $115. ✓ You can pay for 6 months.

Example 2: Which taxi?

Taxi A charges $3 plus $2 per mile. Taxi B charges $6 plus $1.50 per mile. For what trip length do they cost the same?

3 + 2d = 6 + 1.5dLet d = miles. Cost A = cost B3 + 0.5d = 6Subtract 1.5d0.5d = 3Subtract 3d = 6Divide by 0.5 (the same as multiplying by 2)

Check: A costs 3 + 12 = $15 and B costs 6 + 9 = $15. ✓ At 6 miles they cost the same. For shorter trips Taxi A is cheaper; for longer ones, Taxi B.

Example 3: Consecutive integers

Three consecutive integers (whole numbers in a row) add up to 78. What are they?

n + (n + 1) + (n + 2) = 78Let n = the smallest. The next two are n + 1 and n + 23n + 3 = 78Combine like terms3n = 75Subtract 3n = 25Divide by 3

The numbers are 25, 26 and 27. Check: 25 + 26 + 27 = 78. ✓

Your turn

A rectangle’s length is 3 more than twice its width. Its perimeter is 54 cm. Find its width and length.
2w + 2(2w + 3) = 54Let w = width, so length = 2w + 3. Perimeter = 2·width + 2·length2w + 4w + 6 = 54Distribute6w + 6 = 54Combine like terms6w = 48Subtract 6w = 8Divide by 6

Width 8 cm, length 2(8) + 3 = 19 cm. Check: 2(8) + 2(19) = 16 + 38 = 54 ✓

Maya has $40 saved and adds $12 a week. Jon has $88 and adds $4 a week. After how many weeks will they have the same amount?
40 + 12w = 88 + 4wLet w = weeks40 + 8w = 88Subtract 4w8w = 48Subtract 40w = 6Divide by 8

After 6 weeks. Check: Maya has 40 + 72 = $112 and Jon has 88 + 24 = $112 ✓

Common mistakes

✗x + 5 = 12, so x = 12 + 5 = 17.✓Use the inverse: the 5 was added, so subtract it. x = 12 − 5 = 7.
✗3(x + 4) = 3x + 4✓Distribute to every term inside: 3x + 12.
✗−(x − 2) = −x − 2✓The minus flips both signs: −x + 2.
✗−4x = 20, so x = 5.✓Divide by −4, sign included: x = −5.
✗Clearing x/2 + 3 = 7 by doubling only the fraction: x + 3 = 14.✓Multiply every term: x + 6 = 14, so x = 8. (Check: 4 + 3 = 7.)
✗Writing 3x + 2 as 5x.✓Only like terms combine. 3x and 2 are different kinds of terms, so 3x + 2 stays as it is.
✗Getting 6 = 6 and writing “x = 6.”✓No x is left and the statement is true, so the answer is “all real numbers.”

Practice problems with answers

Fourteen problems, from easy to tricky. Solve each on paper, then open it to compare your steps. Your steps don’t have to match ours exactly; any order that keeps the balance works.

  1. x + 13 = 4
    Show answer
    x = 4 − 13Subtract 13x = −9Check: −9 + 13 = 4 ✓
  2. 6x = −42
    Show answer
    x = −42 ÷ 6Divide by 6x = −7Check: 6(−7) = −42 ✓
  3. 2x − 7 = 9
    Show answer
    2x = 16Add 7x = 8Divide by 2. Check: 16 − 7 = 9 ✓
  4. x/3 + 5 = 1
    Show answer
    x/3 = −4Subtract 5x = −12Multiply by 3. Check: −4 + 5 = 1 ✓
  5. 9 − x = 14
    Show answer
    −x = 5Subtract 9x = −5Divide by −1. Check: 9 − (−5) = 14 ✓
  6. 8x − 3 = 5x + 12
    Show answer
    3x − 3 = 12Subtract 5x3x = 15Add 3x = 5Divide by 3. Check: 37 = 37 ✓
  7. 4(x − 1) = 2x + 6
    Show answer
    4x − 4 = 2x + 6Distribute2x = 10Subtract 2x, add 4x = 5Divide by 2. Check: 16 = 16 ✓
  8. 3(2x + 1) − 4x = 11
    Show answer
    6x + 3 − 4x = 11Distribute2x + 3 = 11Combine like termsx = 4Subtract 3, divide by 2. Check: 27 − 16 = 11 ✓
  9. x/4 − x/6 = 2
    Show answer
    3x − 2x = 24Multiply every term by 12x = 24Combine. Check: 6 − 4 = 2 ✓
  10. 6x − 4 = 2x + 5
    Show answer
    4x = 9Subtract 2x, add 4x = 9/4Divide by 4 (that’s 2.25). Check: 9.5 = 9.5 ✓
  11. 5x + 2 = 5(x − 1)
    Show answer
    5x + 2 = 5x − 5Distribute2 = −5Subtract 5x: falseNo solution
  12. 2(3x − 4) = 6x − 8
    Show answer
    6x − 8 = 6x − 8Distribute: both sides identical−8 = −8Subtract 6x: always trueAll real numbers
  13. Twice a number, plus 7, is 3 less than four times the number. Find the number.
    Show answer
    2n + 7 = 4n − 3Let n = the number10 = 2nSubtract 2n, add 3n = 5Divide by 2. Check: 17 = 17 ✓
  14. Streaming plan A costs $30 for the device plus $9 a month. Plan B has no device fee but costs $14 a month. After how many months do they cost the same?
    Show answer
    30 + 9m = 14mLet m = months30 = 5mSubtract 9mm = 6Divide by 5. Both cost $84 ✓

A short history: where “algebra” comes from

The word algebra comes from a book written in Baghdad about 1,200 years ago.

Its author, Muhammad ibn Musa al-Khwarizmi (born around 780, died around 850), was a scholar at the House of Wisdom, a center of learning and translation supported by the caliph al-Ma’mun. Around the 820s he wrote al-Kitāb al-mukhtaṣar fī ḥisāb al-jabr wa’l-muqābala, usually translated as The Compendious Book on Calculation by Completion and Balancing.

The book was meant to be practical. Al-Khwarizmi said it would teach the arithmetic people need for inheritances, lawsuits, trade, and measuring land. It solves linear and quadratic equations step by step, and backs up the methods with geometric drawings.

Two operations in the title should sound familiar:

  • al-jabr (“restoring” or “completing”): getting rid of a subtracted term by adding it to both sides. In modern symbols, 5x − 3 = 12 becomes 5x = 15.
  • al-muqābala (“balancing”): taking away equal amounts from both sides so each kind of term appears only once. 7x + 4 = 2x + 19 becomes 5x = 15.

Those are exactly the balance moves on this page. But al-Khwarizmi wrote them in a different way. His algebra used no symbols at all. Everything, even the numbers, was written out in words: “squares,” “roots” (our x) and plain “numbers.” The examples above are our modern translation.

In 1145, Robert of Chester translated the book into Latin, and the word al-jabr became algebra. Another of al-Khwarizmi’s books, on calculating with Hindu-Arabic numerals, survives only in Latin as Algoritmi de numero Indorum. His Latinized name, Algoritmi, gave us the word algorithm.

Two word histories. Al-jabr, from al-Khwarizmi's book title, became the Latin algebra and the English algebra. The name al-Khwarizmi became the Latin Algoritmi and the English algorithm. al-jabralgebra (Latin)algebra al-KhwārizmīAlgoritmi (Latin)algorithm book title, c. 820sRobert of Chester, 1145the author’s nameLatin translation
Two everyday math words come from one ninth-century scholar.

And the equals sign?

It’s much younger than algebra. The Welsh mathematician Robert Recorde introduced “=” in his 1557 book The Whetstone of Witte, choosing two parallel lines “bicause noe 2 thynges can be moare equalle.” Before that, writers spelled out “is equal to” in words.

How do we know?

Al-Khwarizmi’s own Arabic text survives in later manuscript copies, and historians compare it with the medieval Latin translations. We know little about his life, and historians still disagree about details, such as where his family came from. Dates like “about 780” are estimates.

Practice: Solve It

A new equation every time, with hints and a full step-by-step solution. Choose a level, or mix them all. Type your answer as a number (like 7, −3, 5/2 or 2.5), or use the buttons for the special cases.

Sources

Credits: all illustrations and diagrams on this page are original SVG drawings made for Jugami. Every worked example and answer was checked by substituting it back into the original equation.