Optimal dynamic taxation