The first law of thermodynamics states that energy can neither be created nor destroyed, but instead, it must be transformed…