Q:

How can I derive this formula

Please show how the second formula can be derived from the first one.  
(1)

(2)

A:

I trust you know how to simplify $(1)$ into the following:$$\frac{a+2b}{2e}-(\frac{c+d}{2e})^{2}-\frac{a}{2e}+\frac{c^2}{4e^2}+\frac{d^2}{4e^2}$$Then, you get:$$\frac{a+2b}{2e}-(\frac{c^2+2cd+d^2}{4e^2})-\frac{a}{2e}+\frac{c^2}{4e^2}+\frac{d^2}{4e^2}$$ Simplifying this by subtracting the similar terms gives:$$\frac{2b}{2e}-\frac{2cd}{4e^2}$$
And finally factoring the common factor gives:$$\frac{1}{e}(b-\frac{cd}{2e})$$

