Sub topic 1
What an Equation and Its Solution Are
Prerequisites
This chapter assumes you can do the following:
- Do arithmetic with integers, fractions, and decimals.
- Apply the order of operations (parentheses, exponents, multiplication and division, then addition and subtraction).
- Read a variable as a letter that stands for a number.
If any of these feel shaky, review them first. Every later chapter in this tutorial builds on the ideas introduced here.
What an equation is
An equation is a statement that two expressions have the same value. It is written with an equals sign between them.
An expression is a combination of numbers, variables, and operations. It has no equals sign. For example, 2x + 3 is an expression. 2x + 3 = 11 is an equation.
Every equation has two sides:
- The left side is everything before the equals sign.
- The right side is everything after it.
The equals sign makes a claim: the left side and the right side have the same value. The claim can be true or false, depending on what number the variable stands for.
| Text | Kind | Can it be true or false? |
|---|---|---|
| `2x + 3` | Expression | No. It has a value once x is known, but it makes no claim. |
| `2 + 3 = 5` | Equation with no variable | Yes. It is true. |
| `2 + 3 = 6` | Equation with no variable | Yes. It is false. |
| `2x + 3 = 11` | Equation with a variable | Depends on x. |
The last row is the interesting case. The truth of the claim depends on the value given to x.
Variables and solutions
A variable is a letter that stands for a number we do not yet know, or that may change. In this tutorial the variable is usually x, but any letter works.
A solution of an equation is a value of the variable that makes the equation true. Solving an equation means finding every solution.
Take 2x + 3 = 11 and try some values:
- If
x = 1, the left side is2(1) + 3 = 5. The right side is 11. Since 5 is not 11, the equation is false. - If
x = 2, the left side is 7. False. - If
x = 4, the left side is2(4) + 3 = 11. The right side is 11. True.
So x = 4 is a solution. Trying values one at a time is slow and unreliable, so the rest of the tutorial builds a method that finds the solution directly.
The solution set
The solution set is the collection of all values that make the equation true. Writing it down precisely avoids confusion about "the answer".
- For
2x + 3 = 11, the solution set is{4}. - For
x + 1 = x + 2, no number works, so the solution set is empty. - For
x + 1 = 1 + x, every number works, so the solution set is all real numbers.
These three outcomes (one solution, none, or infinitely many) are the only possibilities for a linear equation in one variable. A later chapter covers them in detail.
What "linear in one variable" means
An equation is linear in one variable if it contains a single variable, and that variable appears only to the first power. It is never multiplied by itself or another variable, never inside a root, and never in a denominator.
| Equation | Linear in one variable? | Reason |
|---|---|---|
| `3x - 7 = 20` | Yes | `x` appears only to the first power. |
| `x/2 + 1 = 5` | Yes | Dividing by the number 2 is the same as multiplying by 1/2. |
| `x^2 = 9` | No | `x` is squared. |
| `1/x = 4` | No | `x` is in a denominator. |
| `x + y = 5` | No | It has two variables. |
The name "linear" comes from graphing. If you plot y = 2x + 3, you get a straight line. Solving 2x + 3 = 11 asks where that line reaches the height 11.
Checking a candidate by substitution
You can test any proposed solution with substitution. Replace the variable with the candidate value, simplify both sides, and compare.
Is x = 3 a solution of 5x - 4 = 2x + 5?
- Left side:
5(3) - 4 = 15 - 4 = 11. - Right side:
2(3) + 5 = 6 + 5 = 11. - Both sides equal 11, so the equation is true and
x = 3is a solution.
Is x = 2 a solution of the same equation?
- Left side:
5(2) - 4 = 6. - Right side:
2(2) + 5 = 9. - Since 6 is not 9,
x = 2is not a solution.
You can do this check in code. The following program tests a candidate for an equation of the form a*x + b = c*x + d. It uses exact fractions so that decimals cannot cause rounding surprises.
from fractions import Fraction
def is_solution(a, b, c, d, x):
"""Return True if x satisfies a*x + b == c*x + d."""
x = Fraction(x)
left = Fraction(a) * x + Fraction(b)
right = Fraction(c) * x + Fraction(d)
return left == right
# 5x - 4 = 2x + 5
print(is_solution(5, -4, 2, 5, 3)) # True
print(is_solution(5, -4, 2, 5, 2)) # FalseAlways substitute into the original equation, not into a version you have already rearranged. If you made a mistake while rearranging, checking the rearranged version will not reveal it.
The idea behind solving
Guess-and-check works for small examples, but you need a reliable procedure. The central idea is this: if an equation is true, it stays true when you do the same thing to both sides.
Think of a balance scale. If the two pans hold equal weight, the scale is level. Add 5 kg to both pans and it stays level. Double both pans and it stays level. Add to only one pan and the balance breaks.
Solving an equation uses this principle to simplify it step by step until the variable stands alone:
2x + 3 = 11
2x = 8 subtract 3 from both sides
x = 4 divide both sides by 2Each line has the same solution as the line before it. Equations related this way are called equivalent equations. The next chapter explains exactly which operations keep equations equivalent and which do not.
Solving by formula
For the general form a*x + b = c, subtracting b from both sides and then dividing by a gives x = (c - b) / a. This works whenever a is not 0. When a is 0, the variable disappears and the equation becomes the plain statement b = c, which is either true for every x or false for every x.
The function below implements this. It uses Fraction so answers such as 7/3 stay exact.
from fractions import Fraction
def solve_linear(a, b, c):
"""Solve a*x + b = c exactly for x."""
a, b, c = Fraction(a), Fraction(b), Fraction(c)
if a == 0:
return "infinitely many solutions" if b == c else "no solution"
return (c - b) / a
print(solve_linear(2, 3, 11)) # 4
print(solve_linear(3, -5, 2)) # 7/3
print(solve_linear(0, 4, 4)) # infinitely many solutions
print(solve_linear(0, 4, 5)) # no solutionThe four calls show all three kinds of outcome. Note that 7/3 is not a whole number. Solutions are often fractions, and that is normal.
The overall process
Every linear equation in this tutorial is solved with the same loop: simplify, isolate, check.
The later chapters fill in each box: which operations are legal, how to simplify with parentheses and like terms, and what to do when the variable appears on both sides.
Common mistakes
- Reading
=as "the answer comes next". In an equation,=states that two sides are equal. It is not an instruction to compute. Writing2 + 3 = 5 + 1 = 6is false, because5and5 + 1are not equal. - Confusing an expression with an equation. You can simplify an expression, but you can only solve an equation.
- Calling a failed check a "small error". If substitution gives different values on the two sides, the candidate is not a solution. Find the error and redo the work.
- Forgetting that the answer is a value. The solution to
2x + 3 = 11isx = 4, not8or2x = 8. Those are intermediate lines. - Checking in the wrong equation. Substitute into the original statement of the problem.
Summary of key ideas
- An equation claims that two expressions are equal. The claim may be true or false.
- A solution is a value of the variable that makes the claim true. The solution set holds all such values.
- A linear equation in one variable has exactly one solution, no solution, or infinitely many solutions.
- Substituting a value into the original equation tests it exactly.
- Doing the same thing to both sides keeps an equation true. This is the basis of every solving method that follows.
Exercise
Decide whether x = -2 is a solution of 4x + 9 = 1 - x. Show the value of each side after substituting.
Show answer
Left side: 4(-2) + 9 = -8 + 9 = 1. Right side: 1 - (-2) = 1 + 2 = 3. Since 1 is not 3, x = -2 is not a solution.
Exercise
Use the formula x = (c - b) / a to solve 5x - 7 = 18. Then verify the answer by substitution into the original equation.
Show answer
Here a = 5, b = -7, c = 18, so x = (18 - (-7)) / 5 = 25 / 5 = 5. Check: 5(5) - 7 = 25 - 7 = 18, which equals the right side. So x = 5 is the solution.
Exercise
Which of these are equations that are linear in one variable: (a) 3x + 1 = 10, (b) 3x + 1, (c) x^2 + 1 = 10, (d) 6 / x = 2, (e) 7 - x = 2x? Explain each answer briefly.
Show answer
(a) Yes. (b) No, it is an expression with no equals sign. (c) No, x is squared. (d) No, x is in a denominator. (e) Yes, x appears only to the first power on each side.
Exercise
Without solving, say how many solutions each equation has: (a) x + 2 = x + 5, (b) 2x + 6 = 2(x + 3). Give a reason.
Show answer
(a) None. Subtracting x from both sides gives 2 = 5, which is never true. (b) Infinitely many. Distributing on the right gives 2x + 6 on both sides, so the equation is true for every x.