This lecture discusses the analysis of optimal production in the presence of external costs. It begins by illustrating the relationship between supply, demand, and external costs, highlighting that market equilibrium often results in overproduction. The instructor explains how taxes can be applied to internalize these external costs, effectively shifting supply and demand to achieve an optimal production level, denoted as Q star. The lecture also explores alternative methods, such as cap-and-trade systems, where production limits are imposed, and tradable quotas are introduced to ensure that low-cost producers are incentivized to produce. The complexities of implementing these systems, including administrative challenges and the need for accurate information, are examined. The instructor emphasizes the importance of determining the optimal cap and the role of political acceptability in choosing between taxes and quotas. The lecture concludes by summarizing various approaches to managing production levels and their implications for social welfare.