The chain rule for linear functions