We derive a general optimal income tax formula when individuals respond along both the intensive and extensive margins and when income effects can prevail. Individuals are heterogeneous across two dimensions: their skill and their disutility of participation. Preferences over consumption and...