added dKdiag_dtheta for linear