The derivatives of density matrix are derived in Appendix A. As in the case of the first-order derivatives of density matrix P x or P n , only the first-order derivatives of orbital rotations are needed in the second-order derivatives of density matrix P nx , which is known as the 2n + 1 rule. The derivatives of orbital rotations are computed by the coupledperturbed Hartree-Fock equation or z-vector equation, which is presented in Appendix B.