Part I: the optimal profile problem