This paper develops a general theory of optimal income taxation with multiple dimensions of agent heterogeneity. The main technical hurdle in developing this theory is the possibility that individuals have multiple optimal incomes. Using a perturbation approach, optimal tax formulas are derived...