Second-order Møller–Plesset Perturbation Theory (MP2) corrects errors introduced by the mean-field ansatz of the Hartree–Fock (HF) theory, the perturbation operator is just the difference of the exact and the HF Hamiltonian. One straightforward obtains the MP2 energy:

| (9.1) |

with the t-amplitudes

| (9.2) |

i and j denote occupied, a and b virtual orbitals, ϵ_{p} are the corresponding orbital energies,
⟨ij||ab⟩ = ⟨ij|ab⟩-⟨ij|ba⟩ are four-center-two-electron integrals in a commonly used
notation.

MP2 gradients (necessary for optimisation of structure parameters at the MP2 level) are
calculated as analytical derivatives of the MP2 energy with respect to nuclear coordinates;
calulation of these derivatives also yields the first order perturbed wave function, expressed
as "MP2 density matrix", in analogy to the HF density matrix. MP2 corrections of
properties like electric moments or atomic populations are obtained in the same way as
for the HF level, the HF density matrix is just replaced by the MP2 density matrix.

The "resolution of the identity (RI) approximation" means expansion of products of virtual
and occupied orbitals by expansions of so-called "auxiliary functions". Calculation and
transformation of four-center-two-electron integrals (see above) is replaced by that of
three-center integrals, which leads to computational savings of RI-MP2 compared to
a conventional MP2 calculations by a factor of ca. 5 (small basis sets like SVP) to
ca. 10 (large basis sets like TZVPP) and more (for quadruple-ζ and larger basis sets).
The RI errors (error due to the RI approximation) are with optimised auxliliary basis
sets small and well documented [118,119]. The use of the mpgrad program is therefore
only recommended for reference calculations or if suitable auxiliary basis sets are not
available.