In thermodynamics, a change in the thermodynamic state of a system and all of its surroundings cannot be precisely restored to its initial state by infinitesimal changes in some property of the system without expenditure of energy. A system that undergoes an irreversible process may still be capable of returning to its initial state. Because entropy is a state function, the change in entropy of the system is the same whether the process is reversible or irreversible. However, the impossibility occurs in restoring the environment to its own initial conditions. An irreversible process increases the total entropy of the system and its surroundings. The second law of thermodynamics can be used to determine whether a hypothetical process is reversible or not.