I want to derive the least square estimation of the coefficients for y=B_0+B_1*x_1+e

Can someone walk me through how to get from B to D in the image below?

http://i.imgur.com/9zwvO.jpg

I can do it through taking the derivative of the residual sum of squares, but I want to know how to do the proof through the general formula.