We discuss the thermodynamics of closed quantum systems driven out of equilibrium by a change in a control parameter and undergoing a unitary process. We compare the work actually done on the system with the one that would be performed along ideal adiabatic and isothermal transformations. The comparison with the latter leads to the introduction of irreversible work, while that with the former leads to the introduction of inner friction. We show that these two quantities can be treated on equal footing, as both can be linked with the heat exchanged in thermalization processes and both can be expressed as relative entropies. Furthermore, we show that a specific fluctuation relation for the entropy production associated with the inner friction exists, which allows the inner friction to be written in terms of its cumulants.PACS numbers: 05.70. Ln, With the increasing ability to manufacture and control microscopic systems, we are approaching the limit where quantum fluctuations, as well as thermal ones, become important when trying to put nanomachines and quantum engines to useful purposes [1, 2]. To discuss engines performances, e.g. for heat-to-work conversion, one typically starts by considering reversible transformations that drive the system from an equilibrium configuration to another one. However, if the system is pushed faster than the thermalization time, such transformations are irreversible, and can lead outside the manifold of equilibrium states [3][4][5]. Nonetheless, these processes are of interest as the reversible protocols, despite enjoying very good efficiencies, give rise to very small output powers [6]. The irreversibility of a process is hence related both to better performances and to lack of control, leading to entropy production [7].To analyze irreversibility and entropy production in the quantum realm, we consider a system initially kept in equilibrium and subject to a finite time adiabatic transformation. While its initial state is prepared by keeping it in contact with a thermal bath, the system is then thermally isolated and subject to a parametric change of its Hamiltonian from an initial H i = H[λ i ] to a final H f = H[λ f ] in a finite time τ . The process is defined by the time variation of the work parameter λ(t), changing from λ(t = 0) = λ i to λ(τ ) = λ f .The work w performed on the system during such a process is a stochastic variable with an associated probability density p(w) [4,8,9], which can be reconstructed experimentally [10,11]