The problem of profit maximization for Cobb-Douglas and CES