People starting "from scratch" may want to know the reference for these formulas. These are equations 4.35 (p. 104), 4.34 (p. 103) and 4.33 (p. 103), copied from the monograph
Härdle, W., Müller, M., Sperlich, S., and Werwatz, A. (2004), Nonparametric and Semiparametric Models, Berlin: Springer.