Equations Containing Fractions
When an equation has fractions, the quickest route is to get rid of them in one step: multiply every term on both sides by the least common denominator (LCD). What remains is an ordinary linear equation. This lesson covers numerical denominators, proportions solved by cross-multiplying, and a first look at the unknown in a denominator, where a forbidden value must be checked.
Clear the denominators
The LCD is the LCM of the denominators. Any common multiple works (24 would too), but the smallest keeps the numbers small.
Tip: Put brackets around numerators with more than one term before multiplying. times 6 is , not .
The minus sign in front of the second fraction applies to its whole numerator, which is why the bracket matters: .
Exact arithmetic in Python
Fractions in floating point lose exactness ( is stored as 0.333…). Python's fractions module and SymPy keep every step exact, which is handy for checking:
from fractions import Fraction as F
from sympy import symbols, Eq, solve, Rational
x = symbols("x")
print(solve(Eq(x/4 + x/6, 5), x))
print(solve(Eq((x - 2)/3 - (x + 1)/4, Rational(1, 2)), x))
print(solve(Eq(Rational(2, 3)*x - Rational(1, 5), Rational(3, 10)), x))
# the check for the second equation, exactly
v = 17
print(F(v - 2, 3) - F(v + 1, 4))[12]
[17]
[3/4]
1/2
Proportions: cross-multiplying
An equation with a single fraction on each side, , is a proportion. Multiplying both sides by gives , called cross-multiplying:
Cross-multiplying is just clearing denominators with the product as a common multiple. The Proportions lesson uses it for recipes and maps.
The unknown in a denominator
If appears in a denominator, the equation is a rational equation. You can still multiply by the LCD, but some values of would make a denominator zero. Those values are excluded and can never be solutions, even if the algebra produces them.
The second equation has no solution: the only candidate makes both fractions undefined. SymPy knows this and returns an empty list:
from sympy import symbols, Eq, solve, Rational
x = symbols("x")
print(solve(Eq(3/x + Rational(1, 2), 2), x))
print(solve(Eq(x/(x - 3), 3/(x - 3) + 2), x))[2]
[]
Multiplying by an expression that can be zero is not always an equivalent step, so a check is required, not optional. The full treatment is in Rational Equations.
In software
Fraction equations appear whenever rates combine. Two download mirrors that would each take 30 and 45 minutes, working together, finish in minutes where , so . The same pattern gives the combined resistance of parallel resistors and the throughput of parallel workers. And the excluded-value idea is the algebraic twin of a ZeroDivisionError guard.
Exercises
Exercise 1: Clear and solve
Solve .
Answer
Solution
Exercise 2: Two-term numerators
Solve .
Answer
Solution
from sympy import symbols, Eq, solve
x = symbols("x")
print(solve(Eq((2*x + 1)/6 - (x - 4)/9, 2), x))[25/4]
Exercise 3: Working together
One pipe fills a tank in 6 hours, another in 3 hours. How long do they take together?
Answer
2 hours
Solution
In hours the pipes fill and of the tank. Together that must be one full tank:
Exercise 4: Watch the excluded value
Solve and say which value of is excluded.
Answer
; the excluded value is .
Solution
Test yourself
What should you multiply both sides of by to clear the fractions with the smallest numbers?
- 24
- 10
- 12
- 6
Multiplying by 4 gives:
Solving a rational equation gives , but the equation has in a denominator. What is the conclusion?
- is the solution
- is the solution
- is excluded, so that candidate is rejected
- The equation is an identity