Sub topic 10
The general form ax + b = c
This chapter assumes you can do arithmetic with integers, fractions, and decimals, and that you know the order of operations. It also assumes you can move a term across an equals sign by performing the same operation on both sides. Earlier chapters covered that balance principle and inverse operations. Here you use them once, on letters instead of numbers, to get a formula that solves every equation of one type.
Why one general form helps
Look at these equations:
- 2x + 3 = 11
- 3x - 5 = 2
- x/4 = 3
- 7 = 3x + 1
They look different, but each has the same structure. The variable x appears once, multiplied by a number, and a constant is added to it. The result is set equal to another constant.
The general form of a linear equation in one variable is
ax + b = c
Here a, b, and c are fixed numbers, called coefficients and constants, and x is the unknown.
- a is the coefficient of x. It is the number that multiplies x.
- b is the constant added to the x term. It can be negative, which covers subtraction.
- c is the value on the right side.
Once you know a, b, and c, you can solve the equation without repeating the same steps each time.
Deriving the solution
Start with ax + b = c and apply two inverse operations.
- Subtract b from both sides. This undoes the addition and gives ax = c - b.
- Divide both sides by a. This undoes the multiplication and gives x = (c - b) / a.
Step 2 is only legal when a is not 0, because dividing by zero is undefined. Whenever a ≠ 0, each step is reversible. Each equation is equivalent to the one before it, so the final equation has exactly the same solutions as the original. Therefore:
If a ≠ 0, the equation ax + b = c has exactly one solution, x = (c - b) / a.
Check the formula by substituting it back into the left side:
a · (c - b)/a + b = (c - b) + b = c
The left side equals c, so the formula works for every a ≠ 0.
Worked examples
| Equation | a | b | c | x = (c - b) / a |
|---|---|---|---|---|
| 2x + 3 = 11 | 2 | 3 | 11 | (11 - 3) / 2 = 4 |
| 3x - 5 = 2 | 3 | -5 | 2 | (2 - (-5)) / 3 = 7/3 |
| x/4 = 3 | 1/4 | 0 | 3 | 3 / (1/4) = 12 |
| -x/2 + 1 = 4 | -1/2 | 1 | 4 | 3 / (-1/2) = -6 |
The second row shows the most common slip. Because b is -5, subtracting b means subtracting -5, which is the same as adding 5. Always put the sign inside b before substituting.
The last row can be verified by hand: -(-6)/2 + 1 = 3 + 1 = 4. ✓
The case a = 0
If a = 0, the term ax is 0 · x, which is 0 for every x. The equation becomes
0 · x + b = c, which simplifies to b = c
The unknown has disappeared, so the equation is now a statement about two fixed numbers. That statement is either true or false, and it does not depend on x.
- If b = c, the statement is true for every x. The equation has infinitely many solutions. For example, 0x + 4 = 4.
- If b ≠ c, the statement is false for every x. The equation has no solution. For example, 0x + 4 = 5.
Together with the a ≠ 0 case, this gives the complete classification.
Always test a before dividing. A calculator or program that divides first will fail or give a meaningless result.
Implementing the general form in code
The formula translates directly to Python. Using Fraction keeps the arithmetic exact, so 7/3 stays 7/3 and does not become 2.3333333333333335.
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 function checks a == 0 first and only divides in the other branch. It returns a string in the degenerate cases and a Fraction otherwise. In production code you would more likely return a structured result or raise an exception, but the strings keep the example readable.
You can also verify an answer by substituting it back, which matches the checking habit from the earlier chapter:
from fractions import Fraction
a, b, c = Fraction(3), Fraction(-5), Fraction(2)
x = (c - b) / a
print(x) # 7/3
print(a * x + b == c) # TrueBecause Fraction is exact, the comparison with == is reliable. With floating-point numbers, you would need a tolerance instead.
Getting an equation into general form
Most equations you meet are not written as ax + b = c. The skill is to simplify until they are. Use these moves:
- Distribute and combine like terms so that x appears in one term.
- Move any x terms to one side and constants to the other, if x appears on both sides.
- Swap sides if the variable is on the right. For example, 7 = 3x + 1 is the same as 3x + 1 = 7, so a = 3, b = 1, c = 7.
- Read off a, b, and c.
Here is the equation 3(x - 2) + 4 = 2x + 5 from the simplification chapter, run through these moves:
3(x - 2) + 4 = 2x + 5
3x - 6 + 4 = 2x + 5 distribute
3x - 2 = 2x + 5 combine like terms
x - 2 = 5 subtract 2x from both sides
x = 7 add 2 to both sides
Check: 3(7 - 2) + 4 = 19 and 2(7) + 5 = 19The line x - 2 = 5 is already in general form with a = 1, b = -2, and c = 5. The formula gives x = (5 - (-2)) / 1 = 7, the same answer.
Moving x terms can change the value of a. In 5x - 4 = 2x + 8, subtracting 2x from both sides gives 3x - 4 = 8, so a = 3. If you instead moved 5x to the right, you would get a = -3 and a different arrangement of b and c, but the same solution.
Common errors
- Dropping the sign of b. For 3x - 5 = 2, the constant is b = -5. Writing (2 - 5)/3 gives -1 instead of 7/3.
- Dividing only part of the right side. After 4x = 10 - 2, the whole right side must be divided by 4. Writing x = 10 - 2/4 is wrong. The correct result is x = 8/4 = 2.
- Dividing before subtracting. For 2x + 3 = 11, dividing 11 by 2 first and then subtracting 3 gives 2.5, which is wrong. The formula subtracts first, then divides.
- Treating a = 0 as an error in the problem. An equation like 0x + 4 = 4 is valid. It is true for every x.
- Concluding "no solution" because x vanished. If x disappears and the leftover statement is true, the equation has infinitely many solutions. Only a false statement means no solution.
- Mixing up a and the sign of a. For -x + 6 = 2, the coefficient is a = -1, not 1. The solution is (2 - 6)/(-1) = 4.
Summary of the classification
| Condition | Meaning | Number of solutions |
|---|---|---|
| a ≠ 0 | x can be isolated | Exactly one: x = (c - b) / a |
| a = 0 and b = c | Reduces to a true statement | Infinitely many |
| a = 0 and b ≠ c | Reduces to a false statement | None |
The next chapter builds on this classification and applies it to equations with variables on both sides.
Exercise
Solve 4x - 9 = 15 using the general form. State a, b, c and the solution, then check it.
Show answer
Here a = 4, b = -9, c = 15. Then x = (15 - (-9)) / 4 = 24 / 4 = 6. Check: 4(6) - 9 = 24 - 9 = 15, which equals c.
Exercise
Classify each equation as having one solution, no solution, or infinitely many solutions, and give the solution when there is exactly one: (i) 0x + 7 = 7, (ii) 0x - 3 = 3, (iii) -x/2 + 1 = 4.
Show answer
(i) a = 0 and b = c = 7, so there are infinitely many solutions. (ii) a = 0 and b = -3 differs from c = 3, so there is no solution. (iii) a = -1/2, b = 1, c = 4, so x = (4 - 1) / (-1/2) = -6. Check: -(-6)/2 + 1 = 4.
Exercise
Simplify 2(x + 3) - 4 = 2x + 1 into the form ax + b = c after moving the x terms to the left. Then decide how many solutions it has.
Show answer
Distribute to get 2x + 6 - 4 = 2x + 1, then combine like terms to get 2x + 2 = 2x + 1. Subtracting 2x from both sides gives 0x + 2 = 1, so a = 0, b = 2, c = 1. Since b ≠ c, the statement 2 = 1 is false and the equation has no solution.