Sub topic 3
Clearing fractions and decimals
This chapter assumes you can work with integers, fractions, and decimals, you know the order of operations, and you can use inverse operations to isolate a variable.
Clearing fractions and decimals
Fractions and decimals make equations harder to read. You can remove them by multiplying both sides by a number that clears every denominator. Use the least common denominator (LCD) for fractions, or a power of 10 for decimals. Multiplying both sides keeps the equation equivalent, so the solution does not change.
For $\frac{x}{2} + \frac{1}{3} = \frac{x}{6} + 1$, multiply every term by 6: $3x + 2 = x + 6$, so $x = 2$.
For $0.5x + 1.2 = 3$, multiply by 10: $5x + 12 = 30$, so $x = 3.6$.
The general form ax + b = c
Most linear equations reduce to $ax + b = c$. Subtract $b$, then divide by $a$, to get $x = \frac{c - b}{a}$. This works only when $a \neq 0$.
from fractions import Fraction
def solve_linear(a, b, c):
"""Solve a*x + b = c exactly. Inputs may be ints, decimal strings, or fractions."""
a, b, c = Fraction(a), Fraction(b), Fraction(c)
if a == 0:
return "no solution" if b != c else "infinitely many solutions"
return (c - b) / a
print(solve_linear("0.5", "1.2", 3)) # 18/5, which is 3.6
print(solve_linear("1/2", "1/3", "2/3")) # 2/3No solution and infinitely many solutions
When $a = 0$, the $x$ term disappears. If $b = c$, every value of $x$ works. If $b \neq c$, no value works.
From word problems to equations
Name the unknown with a variable, write each fact as an expression, and set up one equation. Then solve and check the answer against the story.
Solving a formula for one variable
Treat the other letters as constants and apply the same steps. For $P = 2l + 2w$, subtract $2l$ and divide by 2 to get $w = \frac{P - 2l}{2}$.
Extension: absolute value equations
$|x - 2| = 5$ means $x - 2 = 5$ or $x - 2 = -5$. The solutions are $x = 7$ and $x = -3$.
Exercise
Solve $0.5x + 1 = 2x - 2$.
Show answer
Multiply by 2 to get $x + 2 = 4x - 4$, so $6 = 3x$ and $x = 2$. Check: $0.5(2) + 1 = 2$ and $2(2) - 2 = 2$.
Exercise
Solve $|x + 1| = 4$.
Show answer
$x + 1 = 4$ gives $x = 3$, and $x + 1 = -4$ gives $x = -5$.