  The Mori-Zwanzig projection operator formalism is a powerful method for the
derivation of mesoscopic and macroscopic theories based on known microscopic
equations of motion. It has applications in a large number of areas including
fluid mechanics, solid-state theory, spin relaxation theory, and particle
physics. In its present form, however, the formalism cannot be directly applied
to systems with time-dependent Hamiltonians. Such systems are relevant in a lot
of scenarios like, for example, driven soft matter or nuclear magnetic
resonance. In this article, we derive a generalization of the present
Mori-Zwanzig formalism that is able to treat also time-dependent Hamiltonians.
The extended formalism can be applied to classical and quantum systems, close
to and far from thermodynamic equilibrium, and even in the case of explicitly
time-dependent observables. Moreover, we develop a variety of approximation
techniques that enhance the practical applicability of our formalism.
Generalizations and approximations are developed for both equations of motion
and correlation functions. Our formalism is demonstrated for the important case
of spin relaxation in a time-dependent external magnetic field. The Bloch
equations are derived together with microscopic expressions for the relaxation
times.
