Calculate the partial derivatives in gory detail.