TExcelTAD
Home › Algebra › Rational Equations

Rational Equations

A rational equation has the variable in a denominator, for example 1x+1x+2=512\frac{1}{x} + \frac{1}{x + 2} = \frac{5}{12}. The standard method clears every fraction at once by multiplying both sides by the least common denominator, which leaves a polynomial equation. The catch is that this step can create extraneous solutions, numbers that solve the new equation but make a denominator of the original zero. Checking is not optional here.

The method

  1. Factor the denominators and note the excluded values (where any denominator is 0).
  2. Multiply every term on both sides by the LCD (finding the LCD).
  3. Solve the resulting polynomial equation.
  4. Reject any solution that is an excluded value; check the rest in the original equation.

A linear example

3x+12=5xexcluded: x=0;LCD=2x2x⋅3x+2x⋅12=2x⋅5x6+x=10x=4check: 34+12=54 ✓\begin{aligned} &\frac{3}{x} + \frac{1}{2} = \frac{5}{x} && \text{excluded: } x = 0; \quad \text{LCD} = 2x \\[1ex] &2x \cdot \frac{3}{x} + 2x \cdot \frac{1}{2} = 2x \cdot \frac{5}{x} \\ &6 + x = 10 \\ &x = 4 \\[1ex] &\text{check: } \frac{3}{4} + \frac{1}{2} = \frac{5}{4}\ \checkmark \end{aligned}

An example that becomes quadratic

1x+1x+2=512excluded: x=0, x=−2;LCD=12x(x+2)12(x+2)+12x=5x(x+2)24x+24=5x2+10x0=5x2−14x−240=(5x+6)(x−4)x=4 or x=−65\begin{aligned} &\frac{1}{x} + \frac{1}{x + 2} = \frac{5}{12} && \text{excluded: } x = 0,\ x = -2; \quad \text{LCD} = 12x(x + 2) \\[1ex] &12(x + 2) + 12x = 5x(x + 2) \\ &24x + 24 = 5x^2 + 10x \\ &0 = 5x^2 - 14x - 24 \\ &0 = (5x + 6)(x - 4) && x = 4 \text{ or } x = -\tfrac{6}{5} \end{aligned}

Neither is excluded, and both check: 14+16=512\frac{1}{4} + \frac{1}{6} = \frac{5}{12} ✓, and 1−6/5+14/5=−56+54=512\frac{1}{-6/5} + \frac{1}{4/5} = -\frac{5}{6} + \frac{5}{4} = \frac{5}{12} ✓. Solving the quadratic used factoring; the quadratic formula works too.

Extraneous solutions

xx−2+1=2x−2excluded: x=2;LCD=x−2x+(x−2)=22x−2=2x=2←excluded!\begin{aligned} &\frac{x}{x - 2} + 1 = \frac{2}{x - 2} && \text{excluded: } x = 2; \quad \text{LCD} = x - 2 \\[1ex] &x + (x - 2) = 2 \\ &2x - 2 = 2 \\ &x = 2 && \leftarrow \text{excluded!} \end{aligned}

The only candidate makes the denominators zero, so the equation has no solution. Why did it appear? Multiplying both sides by x−2x - 2 is multiplying by 0 when x=2x = 2, and multiplying by 0 makes any equation "true". The new equation has a root the old one never had.

Note: Only multiplying by an expression that can be zero creates extraneous roots. Multiplying by a nonzero number (like the 2 in the first example) never does, but checking is cheap, so always check.

Proportions

An equation of the form ab=cd\frac{a}{b} = \frac{c}{d} can be solved by cross-multiplying, ad=bcad = bc (Proportions), which is the same as multiplying by the LCD bdbd:

x+13=8x−1→(x+1)(x−1)=24→x2=25→x=±5\frac{x + 1}{3} = \frac{8}{x - 1} \quad\to\quad (x + 1)(x - 1) = 24 \quad\to\quad x^2 = 25 \quad\to\quad x = \pm 5

Both are allowed (only x=1x = 1 is excluded).

Work and rate problems

If a job takes tt hours, the rate is 1t\frac{1}{t} of the job per hour, and rates add when people (or machines) work together. A build server A finishes a test suite in 6 minutes alone. With a second server B the two finish in 4 minutes. How long would B take alone?

16+1t=14LCD=12t2t+12=3tt=12 minutes\begin{aligned} &\frac{1}{6} + \frac{1}{t} = \frac{1}{4} && \text{LCD} = 12t \\ &2t + 12 = 3t \\ &t = 12 \text{ minutes} \end{aligned}

Solving in Python

SymPy's solve returns only solutions valid in the original equation, so it drops extraneous ones. A small manual loop shows both the candidates and the rejections:

python · try it yourself
import sympy as sp

x = sp.symbols("x")

eq = sp.Eq(1/x + 1/(x + 2), sp.Rational(5, 12))
print("solve:", sp.solve(eq, x))

bad = sp.Eq(x/(x - 2) + 1, 2/(x - 2))
print("solve:", sp.solve(bad, x))

# by hand: multiply by the LCD, then test every candidate against it
lcd = x - 2
cleared = sp.cancel((bad.lhs - bad.rhs) * lcd)
print("cleared equation:", cleared, "= 0")
for c in sp.solve(cleared, x):
    print("candidate", c, "->", "extraneous" if lcd.subs(x, c) == 0 else "valid")
solve: [-6/5, 4]
solve: []
cleared equation: 2*x - 4 = 0
candidate 2 -> extraneous

In software

  • Throughput. The combined rate of nn parallel workers is the sum of their rates 1t1+⋯+1tn\frac{1}{t_1} + \cdots + \frac{1}{t_n}. Capacity planning ("how many servers to finish the batch in 10 minutes?") is a rational equation.
  • Division-by-zero guards. Extraneous roots are the algebra version of a classic bug: a formula is rearranged, the new code returns an answer, and nobody notices that the original formula was undefined at that input. Validate solutions against the original constraint.
  • Camera optics. Solving the thin-lens equation 1f=1a+1b\frac{1}{f} = \frac{1}{a} + \frac{1}{b} for the image distance bb (used for depth-of-field effects in renderers) is a rational equation; an object placed exactly at the focal length (a=fa = f) has no solution, and the code must handle that case.

Exercises

Exercise 1: Linear

Solve 4x−13=1x\frac{4}{x} - \frac{1}{3} = \frac{1}{x}.

Answer

x=9x = 9

Solution
excluded x=0;LCD 3x12−x=3→x=9check: 49−39=19 ✓\begin{aligned} &\text{excluded } x = 0; \quad \text{LCD } 3x \\ &12 - x = 3 \quad\to\quad x = 9 \\ &\text{check: } \frac{4}{9} - \frac{3}{9} = \frac{1}{9}\ \checkmark \end{aligned}

Exercise 2: Cross-multiply

Solve 2x−1x+4=35\frac{2x - 1}{x + 4} = \frac{3}{5}.

Answer

x=177x = \frac{17}{7}

Solution
5(2x−1)=3(x+4)10x−5=3x+127x=17→x=177(not −4, so it is allowed)\begin{aligned} &5(2x - 1) = 3(x + 4) \\ &10x - 5 = 3x + 12 \\ &7x = 17 \quad\to\quad x = \frac{17}{7} && \text{(not } -4\text{, so it is allowed)} \end{aligned}

Exercise 3: Watch for extraneous roots

Solve xx−3=3x−3+2\frac{x}{x - 3} = \frac{3}{x - 3} + 2.

Answer

No solution (the candidate x=3x = 3 is extraneous).

Solution
LCD x−3:x=3+2(x−3)=2x−3→x=3excluded\text{LCD } x - 3{:}\quad x = 3 + 2(x - 3) = 2x - 3 \quad\to\quad x = 3 \quad \text{excluded}

Exercise 4: Becomes quadratic

Solve xx−1−2x+1=4x2−1\frac{x}{x - 1} - \frac{2}{x + 1} = \frac{4}{x^2 - 1}.

Answer

x=2x = 2 (the candidate x=−1x = -1 is extraneous).

Solution
x2−1=(x−1)(x+1);excluded x=1 and x=−1;LCD (x−1)(x+1)x(x+1)−2(x−1)=4x2+x−2x+2=4x2−x−2=0(x−2)(x+1)=0→x=2 or x=−1x=−1 is excluded;check x=2: 21−23=43 and 43 ✓\begin{aligned} &x^2 - 1 = (x - 1)(x + 1); \quad \text{excluded } x = 1 \text{ and } x = -1; \quad \text{LCD } (x - 1)(x + 1) \\ &x(x + 1) - 2(x - 1) = 4 \\ &x^2 + x - 2x + 2 = 4 \\ &x^2 - x - 2 = 0 \\ &(x - 2)(x + 1) = 0 \quad\to\quad x = 2 \text{ or } x = -1 \\ &x = -1 \text{ is excluded}; \quad \text{check } x = 2{:}\ \frac{2}{1} - \frac{2}{3} = \frac{4}{3} \text{ and } \frac{4}{3}\ \checkmark \end{aligned}
python · try it yourself
import sympy as sp

x = sp.symbols("x")
print(sp.solve(sp.Eq(x/(x - 1) - 2/(x + 1), 4/(x**2 - 1)), x))
[2]

Exercise 5: Two pipes

One pipe fills a tank in 3 hours; a drain empties it in 5 hours. With both open, how long does the empty tank take to fill? Check with code.

Answer

7.5 hours

Solution
13−15=1tLCD 15t5t−3t=15→t=152=7.5 h\begin{aligned} &\frac{1}{3} - \frac{1}{5} = \frac{1}{t} && \text{LCD } 15t \\ &5t - 3t = 15 \quad\to\quad t = \frac{15}{2} = 7.5\ \text{h} \end{aligned}
python · try it yourself
import sympy as sp

t = sp.symbols("t", positive=True)
print(sp.solve(sp.Eq(sp.Rational(1, 3) - sp.Rational(1, 5), 1/t), t))
[15/2]

Test yourself

What is an extraneous solution of a rational equation?

  1. A solution that is irrational
  2. A candidate that makes a denominator of the original equation zero
  3. A solution of the LCD
  4. A negative solution

Solve 6x=3x−2\frac{6}{x} = \frac{3}{x - 2}.

  1. x=4x = 4
  2. x=2x = 2
  3. x=−4x = -4
  4. no solution

Alice paints a fence in 4 h, Bob in 12 h. Together?

  1. 8 h
  2. 16 h
  3. 2 h
  4. 3 h