In an irreversible and spontaneous chemical reaction at constant temperature and pressure, the maximum amount of work that can be obtained is equal to the change in Gibbs free energy G of the reaction. The Gibbs free energy is a thermodynamic potential that measures the maximum reversible work that can be done by a system at constant temperature and pressure.G = H - TSwhere H is the change in enthalpy, T is the temperature in Kelvin, and S is the change in entropy.For an irreversible and spontaneous reaction, G will be negative, indicating that the reaction will proceed spontaneously and can perform work. The magnitude of G represents the maximum amount of work that can be obtained from the reaction. It is important to note that this is the theoretical maximum, and in practice, the actual work obtained may be less due to inefficiencies and losses.