<s>[INST] How to derive $ \frac ab -x= \frac {c-xd}{b}+\left(\frac{b-d}{b}\right) \left(\frac{a-c}{b-d} - x \right) $ $$ \frac ab -x= \frac {c-xd}{b}+\left(\frac{b-d}{b}\right) \left(\frac{a-c}{b-d} - x \right)  $$
It is easy to check it by computing right hand side. It feels unnatural and a little magical. I could't derive it starting from LHS
This identity is used in the proof of Stolz Cesaro theorem (https://ru.wikipedia.org/wiki/Теорема_Штольца). It is in russian I understood with the  help of google translate .
 [/INST] Starting from the LHS
$$\frac{a}{b}-x$$
we can subtract and add $\frac{c-xd}{b}$ to form
$$\Big(\frac{a}{b}-x\Big) - \frac{c-xd}{b} + \frac{c-xd}{b}$$
which rearranges to
$$\frac{c-xd}{b}+\Big(\frac{a}{b}-x-\frac{c-xd}{b}\Big)$$
or
$$\frac{c-xd}{b}+\Big(\frac{a-c+xd}{b}-x\Big)$$
which is equivalent to
$$\frac{c-xd}{b}+\Big(\frac{a-bx-c+dx}{b}\Big)$$
where $\left(\frac{b-d}{b}\right) \left(\frac{a-c}{b-d} - x \right) = \Big(\frac{a-bx-c+dx}{b}\Big)$ and therefore we have the RHS
$$\frac{c-xd}{b}+\left(\frac{b-d}{b}\right) \left(\frac{a-c}{b-d} - x \right)$$
</s>