Skip to content
Tutorials Center
My learning

Topics

Lesson 17 of 38 ยท Variables and Simple Equations

One-Step Equations

Learn what an equation is and how to solve one-step equations using inverse operations and the balance idea, with checks, word problems and code.

An equation is a statement that two expressions are equal, such as x + 4 = 11. It contains an equals sign. To solve an equation means to find the value of the variable that makes the statement true. That value is the solution. Here, x = 7, because 7 + 4 = 11.

The balance idea

Picture a balance scale with x + 4 on one side and 11 on the other. It is level. If you take 4 away from the left pan, the scale tips, unless you also take 4 away from the right. Doing the same operation to both sides keeps it balanced:

x + 4 = 11 x + 4 โˆ’ 4 = 11 โˆ’ 4 x = 7

This is the one law of equation solving: whatever you do to one side, do to the other. We choose the operation to isolate the variable, getting it alone on one side.

flowchart LR
    A["x + 4 = 11"] -- "subtract 4 from both sides" --> B["x = 7"]

Subtracting undoes the adding.

Inverse operations

The equation uses Undo it with Example
x + a = b subtract a x + 4 = 11 โ†’ x = 7
x โˆ’ a = b add a x โˆ’ 6 = 3 โ†’ x = 9
aยทx = b divide by a 5x = 40 โ†’ x = 8
x / a = b multiply by a x/3 = 5 โ†’ x = 15

Worked examples

Addition: x + 12 = 20. Subtract 12 from both sides: x = 8.

Subtraction: y โˆ’ 9 = 5. Add 9 to both sides: y = 14.

Multiplication: 6n = 42. Divide both sides by 6: n = 7.

Division: m/4 = 10. Multiply both sides by 4: m = 40.

Negative coefficient: โˆ’3x = 18. Divide both sides by โˆ’3: x = โˆ’6.

Fraction coefficient: (2/3)x = 8. Multiply by the reciprocal 3/2: x = 8 ร— 3/2 = 12.

Always check

Substitute your answer into the original equation. For 6n = 42 with n = 7: 6 ร— 7 = 42. True, so the solution is correct. Checking takes seconds and catches nearly every mistake.

Python Solve and verify one-step equations

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The function applies the inverse operation, then the check puts x back into the original left side.

Solving with sympy

sympy can solve equations exactly, which is a convenient way to check your work.

Python Check solutions with sympy

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Word problems

Problem: After buying a 12-dollar book, Lina has 23 dollars left. How much did she have at first?

  1. Let m be her money at first.
  2. Equation: m โˆ’ 12 = 23.
  3. Add 12 to both sides: m = 35.
  4. Check: 35 โˆ’ 12 = 23. She had 35 dollars.

Problem: Four friends share a bill equally and each pays 9 dollars. What is the bill?

  1. Let b be the bill: b/4 = 9.
  2. Multiply by 4: b = 36 dollars.

Define your variable in words first ("Let m be the money Lina had at first"). It prevents confusion and gives the answer a meaning and units.

Python From a story to a solution

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Solve x + 15 = 40.

    Subtract 15 from both sides: x = 40 โˆ’ 15 = 25.
  2. 2. Solve 7k = 63.

    Divide both sides by 7: k = 9. Check: 7 ร— 9 = 63.
  3. 3. Solve p/5 = 12.

    Multiply both sides by 5: p = 60.
  4. 4. Solve โˆ’4x = 28.

    Divide both sides by โˆ’4: x = โˆ’7. Check: โˆ’4 ร— โˆ’7 = 28.

Summary

  • An equation says two expressions are equal; solving finds the value that makes it true.
  • Keep the equation balanced: do the same thing to both sides.
  • Use inverse operations to isolate the variable.
  • Always check the solution in the original equation.
  • Define the variable in words when you solve a word problem.

Next: Two-Step Equations