  We present an approach based on a density matrix expansion to study
thermodynamic properties of a quantum system strongly coupled to two or more
baths. For slow external driving of the system, we identify the adiabatic and
nonadiabatic contributions to thermodynamic quantities, and we show how the
first and second laws of thermodynamics are manifested in the strong coupling
regime. Particularly, we show that the entropy production is positive up to
second order in the driving speed. The formulation can be applied both for
Bosonic and Fermionic systems, and recovers previous results for the
equilibrium case (Phys. Rev. B 98, 134306 [2018]). The approach is then
demonstrated for the driven resonant level model as well as the driven Anderson
impurity model, where the hierarchical quantum master equation method is used
to accurately simulate the nonequilibrium quantum dynamics.
