In mathematics, the maximum principle is a property of solutions to certain partial differential equations, of the elliptic and parabolic types. Roughly speaking, it says that the maximum of a function in a domain is to be found on the boundary of that domain. Specifically, the strong maximum principle says that if a function achieves its maximum in the interior of the domain, the function is uniformly a constant. The weak maximum principle says that the maximum of the function is to be found on the boundary, but may re-occur in the interior as well. Other, even weaker maximum principles exist which merely bound a function in terms of its maximum on the boundary.
In convex optimization, the maximum principle states that the maximum of a convex function on a compact convex set is attained on the boundary.
Harmonic functions are the classical example to which the strong maximum principle applies. Formally, if f is a harmonic function, then f cannot exhibit a true local maximum within the domain of definition of f. In other words, either f is a constant function, or, for any point inside the domain of f, there exist other points arbitrarily close to at which f takes larger values.