Retrofitting existing sugar mills to produce ethanol from sugarcane bagasse provides a significant opportunity in India to meet the nation's liquid transportation fuel demands. Utilization of sugarcane trash in the sugar mill can enhance the economic feasibility of this approach. This work developed an optimization model to determine the optimal distribution of bagasse and trash for ethanol production while simultaneously ensuring energy sufficiency of the sugar mill. A superstructure of sugar mill integrated with a second generation ethanol facility along with trash utilization and lignin valorization processes is developed. The model determines the break‐even selling price (BESP) of ethanol by optimizing the distribution of bagasse and trash subjected to the mass and energy balance constraints and cost functions. The application of the model for a sugar mill with a throughput of 150 Mg (Mega grams)/h of sugarcane showed the ethanol BESP to be Rs. 63/L when trash and lignin was available along with bagasse for heat production. Trash retention on farm increased the BESP to Rs. 117/L, indicating the economic value of trash utilization. However, on‐farm trash retention led to about 82% savings in GHG emissions due to reduced fertilizer use. Lignin valorization was found to be economically infeasible. © 2018 American Institute of Chemical Engineers Environ Prog, 37: 1901–1907, 2018