We derived the labor supply curve from a variation on the two goods - two prices analysis known as the labor-leisure tradeoff.
The welfare problem is a natural extension: