Under this condition, the production of ethanol is energetically viable only if the energy required in the hydrolysis step is recovered and used elsewhere in the process. Most of the energy required by the hydrolysis step can be recovered because it consists of internal energy. Energy integration in a biorefinery, using pinch technology, can reduce the need of external source of energy and increase the EROI of both ethanol and biodiesel production to viable levels