I already wrote a first section on piecewise linear approximation. However, it is missing a few points and is not tested properly on real problems (I have used some similar code, but could not just copy and paste it into the Primer for various reasons). Also the stepwise function could be integrated.