The last expression for the MM energy will be used in the derivation of the high-order derivatives of the energy. When the MM region is adjacent to the QM region (as described on the DFT level of theory), the total generalized field F tot would include the contributions from the QM region in addition to the external source,