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 .

Let
$$
Z=\:\frac{\left(c-xd\right)}{b}+\left(\frac{b-d}{b}\right)\:\left(\frac{a-c}{b-d}\:-\:x\:\right)\:$$
Let
$$ K=\frac{\left(c-xd\right)}{b}$$
Let 
$$ N=\left(\frac{b-d}{b}\right)\:\left(\frac{a-c}{b-d}\:-\:x\:\right)\:$$
$$Z=K+N$$
We will rewrite $\left(\frac{a-c}{b-d}\:-\:x\:\right)\:$ as:
$$\left(\frac{a-c}{b-d}\:-\:x\:\right)\:=\left(\frac{a-c}{b-d}\:-\:x\:\frac{\left(b-d\right)}{\left(b-d\right)}\:\right)\:$$
$$N\:=\left(\frac{b-d}{b}\right)\left(\frac{a-c}{b-d}\:-\:x\:\frac{\left(b-d\right)}{\left(b-d\right)}\:\right)\:=\left(\frac{b-d}{b}\right)\left(\frac{a-c\:-x\left(b-d\right)}{b-d}\:\right)$$
$$N\:=\left(\frac{a-c\:-x\left(b-d\right)}{b}\:\right)$$
$$N\:=\left(\frac{a-c\:-xb+xd}{b}\:\right)$$
Using $Z=K+N$ and substituting the last expression for $N$ we get:
$$z\:=\frac{\left(c-xd\right)}{b}+\left(\frac{a-c\:-xb+xd}{b}\:\right) $$
$$z\:=\left(\frac{a\:-xb}{b}\:\right)$$
$$ z\:=\frac{a\:}{b}-x$$
