Suppose I want to simplify this expression: $$\frac{bx-bc-dx+ad}{a-c}$$ More specifically, I want to minimize the number of operations. Counting each addition, subtraction, and multiplication, the expression requires 9 operations to compute.
The expression $$b+\frac{(x-a)(b-d)}{a-c}$$ is equivalent to the previous expression, yet requires only 6 operations to compute.
So, my real question is, starting with the top expression, how do I derive the bottom expression? I want to know step-by-step. I can't think of any factoring techniques that would help me here. I know how to go from the bottom expression to the top expression, but not the other way around.
\begin{align} \frac{bx-bc-dx+ad}{a-c}&=\frac{x(b-d)+ad-ab+ab-bc}{a-c}\\ &=\frac{x(b-d)-a(b-d)+b(a-c)}{a-c}\\ &=\frac{(x-a)(b-d)+b(a-c)}{a-c}\\ &=\frac{b(a-c)}{a-c}+\frac{(x-a)(b-d)}{a-c}\\ &=b+\frac{(x-a)(b-d)}{a-c}\\ \end{align}