A necessary condition - the Principle of Fermat-Lagrange - is offered for mixed smooth-convexoptimization problems. This generalizes and unifies most of the known necessary conditions forconcrete finite and infinite dimensional optimization problems of interest. The new idea in comparisonwith the unified version of Tikhomirov and others ([I-T], [A-T-F] and [T]) is that a geometricalconstruction of the principle is given. In the present set-up constraints are not mentioned explicitly, thefeasibility set is allowed to vary in a non-standard way and the objective function is also allowed tovary. An equivalent analytical formulation is given as well; we propose a new standard form foroptimization problems which allows greater flexibility.