On the conditions under which the euler equation or the maximum principle hold