Differentiating linear functions