The paper is concerned with developing a production theory for the case when some inputs have nonlinear prices because the price depends on endogenous quality. This involves extending the notion of a cost function to the case where nonlinear prices are parameters of costs. After developing the appropriate theory, we apply our results to the case of coal-fired electric power generation where fuel quality depends on sulfur and ash impurities. Environmental regulations induce a negative value on sulfur whereas ash impurities degrade performance and thus reduce production possibilities. A number of empirical results emerge, including significant rates of technological change that are sulfur and ash saving though capital using. This change may explain in part the recent drop in the price of sulfur allowances in the United States.