Sub topic 6
When the Variable Appears in Several Terms: Collect and Factor
Assume you can solve linear equations, work with fractions, and use the distributive property. This chapter focuses on formulas in which the target variable appears in more than one term.
The main pattern
Consider an equation such as
\[ ax+b=cx+d \]
The variable \(x\) appears on both sides. To isolate it, move all terms containing \(x\) to one side and all constant terms to the other side.
Subtract \(cx\) from both sides:
\[ ax-cx+b=d \]
Subtract \(b\) from both sides:
\[ ax-cx=d-b \]
Factor out \(x\):
\[ (a-c)x=d-b \]
Finally, divide by \(a-c\):
\[ x=\frac{d-b}{a-c} \]
This formula is valid when \(a-c\neq 0\).
Worked example
Solve for \(x\):
\[ 7x+4=3x+20 \]
Subtract \(3x\) from both sides:
\[ 4x+4=20 \]
Subtract \(4\):
\[ 4x=16 \]
Divide by \(4\):
\[ x=4 \]
The important step is collecting like terms. The terms \(7x\) and \(3x\) are like terms because both contain \(x\). Their coefficients can be combined after they are placed on the same side.
Factoring after collecting
Sometimes collecting terms produces a common factor rather than an immediate answer. For example:
\[ px+qx=r \]
Both variable terms contain \(x\), so factor it out:
\[ (p+q)x=r \]
Then divide:
\[ x=\frac{r}{p+q} \]
The same idea works when the variable appears in a product:
\[ mx+n x+k=y \]
First combine the variable terms:
\[ (m+n)x+k=y \]
Then subtract \(k\) and divide by \(m+n\):
\[ x=\frac{y-k}{m+n} \]
A formula with a target on both sides
Suppose a quantity \(T\) is defined by
\[ T=a x+b x+c \]
The variable \(x\) appears in two terms. Factor it:
\[ T=(a+b)x+c \]
Subtract \(c\):
\[ T-c=(a+b)x \]
Divide by \(a+b\):
\[ x=\frac{T-c}{a+b} \]
The order matters. Factoring before dividing keeps the expression organized and reduces sign errors.
| Original form | Collect or factor | Isolated variable |
|---|---|---|
| \(ax+b=cx+d\) | \((a-c)x=d-b\) | \(x=(d-b)/(a-c)\) |
| \(px+qx=r\) | \((p+q)x=r\) | \(x=r/(p+q)\) |
Common errors
- Moving a term across the equals sign without changing its sign.
- Combining unlike terms, such as \(3x+4\) into \(7x\).
- Dividing before collecting every \(x\)-term.
- Forgetting that a coefficient can be negative.
- Dividing by an expression that might equal zero.
If the coefficient of \(x\) becomes zero, the equation needs separate analysis. For example:
\[ 5x+2=5x+9 \]
Subtracting \(5x\) from both sides gives
\[ 2=9 \]
This is impossible, so the equation has no solution. In contrast,
\[ 5x+2=5x+2 \]
reduces to a true statement. Every value of \(x\) satisfies it.
Checking the rearrangement
Substitute your result into the original equation. For
\[ 7x+4=3x+20 \]
the result \(x=4\) gives
\[ 7(4)+4=3(4)+20 \]
\[ 32=32 \]
A symbolic check can also confirm the general pattern:
from sympy import symbols, Eq, solve
a, b, c, d, x = symbols("a b c d x")
equation = Eq(a * x + b, c * x + d)
print(solve(equation, x))
# [(d - b)/(a - c)]The denominator \(a-c\) shows the restriction directly: \(a\) must differ from \(c\).
Exercise
Solve \(9x-5=4x+15\), and state the value that must not be zero when using the general method.
Show answer
Subtract \(4x\): \(5x-5=15\). Add \(5\): \(5x=20\). Divide by \(5\): \(x=4\). In the general method, \(a-c\) must not be zero.