Maximum principle
In the mathematical fields of partial differential equations and geometric analysis, the maximum principle is any of a collection of results and techniques of fundamental importance in the study of elliptic and parabolic differential equations. In the simplest case, consider a function of two variables  such that

The weak maximum principle, in this setting, says that for any open precompact subset  of the domain of , the maximum of  on the closure of  is achieved on the boundary of . The strong maximum principle says that, unless  is a constant function, the maximum cannot also be achieved anywhere on  itself. Such statements give a striking qualitative picture of solutions of the given differential equation. Such a qualitative picture can be extended to many kinds of differential equations. In many situations, one can also use such maximum principles to draw precise quantitative conclusions about solutions of differential equations, such as control over the size of their gradient. There is no single or most general maximum principle which applies to all situations at once. In the field of convex optimization, there is an analogous statement which asserts that the maximum of a convex function on a compact convex set is attained on the boundary. Intuition

A partial formulation of the strong maximum principle
Here we consider the simplest case, although the same thinking can be extended to more general scenarios. Let  be an open subset of Euclidean space and let  be a  function on  such that

where for each  and  between 1 and ,  is a function on  with . Fix some choice of  in . According to the spectral theorem of linear algebra, all eigenvalues of the matrix  are real, and there is an orthonormal basis of  consisting of eigenvectors. Denote the eigenvalues by  and the corresponding eigenvectors by , for  from 1 to . Then the differential equation, at the point , can be rephrased as

The essence of the maximum principle is the simple observation that if each eigenvalue is positive (which amounts to a certain formulation of "ellipticity" of the differential equation) then the above equation imposes a certain balancing of the directional second derivatives of the solution. In particular, if one of the directional second derivatives is negative, then another must be positive. At a hypothetical point where  is maximized, all directional second derivatives are automatically nonpositive, and the "balancing" represented by the above equation then requires all directional second derivatives to be identically zero. This elementary reasoning could be argued to represent an infinitesimal formulation of the strong maximum principle, which states, under some extra assumptions (such as the continuity of ), that  must be constant if there is a point of  where  is maximized. Note that the above reasoning is unaffected if one considers the more general partial differential equation

since the added term is automatically zero at any hypothetical maximum point. The reasoning is also unaffected if one considers the more general condition

in which one can even note the extra phenomena of having an outright contradiction if there is a strict inequality ( rather than ) in this condition at the hypothetical maximum point. This phenomenon is important in the formal proof of the classical weak maximum principle. Non-applicability of the strong maximum principle
However, the above reasoning no longer applies if one considers the condition 

since now the "balancing" condition, as evaluated at a hypothetical maximum point of , only says that a weighted average of manifestly nonpositive quantities is nonpositive. This is trivially true, and so one cannot draw any nontrivial conclusion from it. This is reflected by any number of concrete examples, such as the fact that

and on any open region containing the origin, the function  certainly has a maximum. The classical weak maximum principle for linear elliptic PDE

The essential idea 
Let  denote an open subset of Euclidean space. If a smooth function  is maximized at a point , then one automatically has:
 
  as a matrix inequality. One can view a partial differential equation as the imposition of an algebraic relation between the various derivatives of a function. So, if  is the solution of a partial differential equation, then it is possible that the above conditions on the first and second derivatives of  form a contradiction to this algebraic relation. This is the essence of the maximum principle. Clearly, the applicability of this idea depends strongly on the particular partial differential equation in question. For instance, if  solves the differential equation

then it is clearly impossible to have  and  at any point of the domain. So, following the above observation, it is impossible for  to take on a maximum value. If, instead  solved the differential equation  then one would not have such a contradiction, and the analysis given so far does not imply anything interesting. If  solved the differential equation  then the same analysis would show that  cannot take on a minimum value. The possibility of such analysis is not even limited to partial differential equations. For instance, if  is a function such that

which is a sort of "non-local" differential equation, then the automatic strict positivity of the right-hand side shows, by the same analysis as above, that  cannot attain a maximum value. There are many methods to extend the applicability of this kind of analysis in various ways. For instance, if  is a harmonic function, then the above sort of contradiction does not directly occur, since the existence of a point  where  is not in contradiction to the requirement  everywhere. However, one could consider, for an arbitrary real number , the function  defined by

It is straightforward to see that

By the above analysis, if  then  cannot attain a maximum value. One might wish to consider the limit as  to 0 in order to conclude that  also cannot attain a maximum value. However, it is possible for the pointwise limit of a sequence of functions without maxima to have a maxima. Nonetheless, if  has a boundary such that  together with its boundary is compact, then supposing that  can be continuously extended to the boundary, it follows immediately that both  and  attain a maximum value on  Since we have shown that , as a function on , does not have a maximum, it follows that the maximum point of , for any , is on  By the sequential compactness of  it follows that the maximum of  is attained on  This is the weak maximum principle for harmonic functions. This does not, by itself, rule out the possibility that the maximum of  is also attained somewhere on . That is the content of the "strong maximum principle," which requires further analysis. The use of the specific function  above was very inessential. All that mattered was to have a function which extends continuously to the boundary and whose Laplacian is strictly positive. So we could have used, for instance,

with the same effect. The classical strong maximum principle for linear elliptic PDE

Summary of proof
Let  be an open subset of Euclidean space. Let  be a twice-differentiable function which attains its maximum value . Suppose that

Suppose that one can find (or prove the existence of):
 a compact subset  of , with nonempty interior, such that  for all  in the interior of , and such that there exists  on the boundary of  with . a continuous function  which is twice-differentiable on the interior of  and with

 and such that one has  on the boundary of  with 
Then  on  with  on the boundary of ; according to the weak maximum principle, one has  on . This can be reorganized to say

for all  in . If one can make the choice of  so that the right-hand side has a manifestly positive nature, then this will provide a contradiction to the fact that  is a maximum point of  on , so that its gradient must vanish. Proof
The above "program" can be carried out. Choose  to be a spherical annulus; one selects its center  to be a point closer to the closed set  than to the closed set , and the outer radius  is selected to be the distance from this center to ; let  be a point on this latter set which realizes the distance. The inner radius  is arbitrary. Define

Now the boundary of  consists of two spheres; on the outer sphere, one has ; due to the selection of , one has  on this sphere, and so  holds on this part of the boundary, together with the requirement . On the inner sphere, one has . Due to the continuity of  and the compactness of the inner sphere, one can select  such that . Since  is constant on this inner sphere, one can select  such that  on the inner sphere, and hence on the entire boundary of . Direct calculation shows

There are various conditions under which the right-hand side can be guaranteed to be nonnegative; see the statement of the theorem below. Lastly, note that the directional derivative of  at  along the inward-pointing radial line of the annulus is strictly positive. As described in the above summary, this will ensure that a directional derivative of  at  is nonzero, in contradiction to  being a maximum point of  on the open set . Statement of the theorem
The following is the statement of the theorem in the books of Morrey and Smoller, following the original statement of Hopf (1927):

The point of the continuity assumption is that continuous functions are bounded on compact sets, the relevant compact set here being the spherical annulus appearing in the proof. Furthermore, by the same principle, there is a number  such that for all  in the annulus, the matrix  has all eigenvalues greater than or equal to . One then takes , as appearing in the proof, to be large relative to these bounds. Evans's book has a slightly weaker formulation, in which there is assumed to be a positive number  which is a lower bound of the eigenvalues of  for all  in . These continuity assumptions are clearly not the most general possible in order for the proof to work. For instance, the following is Gilbarg and Trudinger's statement of the theorem, following the same proof:

One cannot naively extend these statements to the general second-order linear elliptic equation, as already seen in the one-dimensional case. For instance, the ordinary differential equation {{math|y{{}} + 2y  0}} has sinusoidal solutions, which certainly have interior maxima. This extends to the higher-dimensional case, where one often has solutions to "eigenfunction" equations  which have interior maxima. The sign of c is relevant, as also seen in the one-dimensional case; for instance the solutions to {{math|y'' are exponentials, and the character of the maxima of such functions is quite different from that of sinusoidal functions. See also 

 Maximum modulus principle
 Hopf maximum principle

Notes

References

Research articles
 Calabi, E. An extension of E. Hopf's maximum principle with an application to Riemannian geometry. Duke Math. J. 25 (1958), 45–56. Cheng, S.Y. ; Yau, S.T. Differential equations on Riemannian manifolds and their geometric applications. Comm. Pure Appl. Math. 28 (1975), no. 3, 333–354. Gidas, B.; Ni, Wei Ming; Nirenberg, L. Symmetry and related properties via the maximum principle. Comm. Math. Phys. 68 (1979), no. 3, 209–243. Gidas, B.; Ni, Wei Ming; Nirenberg, L. Symmetry of positive solutions of nonlinear elliptic equations in . Mathematical analysis and applications, Part A, pp. 369–402, Adv. in Math. Suppl. Stud., 7a, Academic Press, New York-London, 1981. Hamilton, Richard S. Four-manifolds with positive curvature operator. J. Differential Geom. 24 (1986), no. 2, 153–179. E. Hopf. Elementare Bemerkungen Über die Lösungen partieller Differentialgleichungen zweiter Ordnung vom elliptischen Typus. Sitber. Preuss. Akad. Wiss. Berlin 19 (1927), 147-152. Hopf, Eberhard. A remark on linear elliptic differential equations of second order. Proc. Amer. Math. Soc. 3 (1952), 791–793. Nirenberg, Louis. A strong maximum principle for parabolic equations. Comm. Pure Appl. Math. 6 (1953), 167–177. Omori, Hideki. Isometric immersions of Riemannian manifolds. J. Math. Soc. Jpn. 19 (1967), 205–214. Yau, Shing Tung. Harmonic functions on complete Riemannian manifolds. Comm. Pure Appl. Math. 28 (1975), 201–228. Kreyberg, H. J. A. On the maximum principle of optimal control in economic processes, 1969 (Trondheim, NTH, Sosialøkonomisk institutt https://www.worldcat.org/title/on-the-maximum-principle-of-optimal-control-in-economic-processes/oclc/23714026)

Textbooks

 Evans, Lawrence C. Partial differential equations. Second edition. Graduate Studies in Mathematics, 19. American Mathematical Society, Providence, RI, 2010. xxii+749 pp. Friedman, Avner. Partial differential equations of parabolic type. Prentice-Hall, Inc., Englewood Cliffs, N.J. 1964 xiv+347 pp. Gilbarg, David; Trudinger, Neil S. Elliptic partial differential equations of second order. Reprint of the 1998 edition. Classics in Mathematics. Springer-Verlag, Berlin, 2001. xiv+517 pp. Ladyženskaja, O. A.; Solonnikov, V. A.; Uralʹceva, N. N. Linear and quasilinear equations of parabolic type. Translated from the Russian by S. Smith. Translations of Mathematical Monographs, Vol. 23 American Mathematical Society, Providence, R.I. 1968 xi+648 pp. Ladyzhenskaya, Olga A.; Ural'tseva, Nina N. Linear and quasilinear elliptic equations. Translated from the Russian by Scripta Technica, Inc. Translation editor: Leon Ehrenpreis. Academic Press, New York-London 1968 xviii+495 pp. Lieberman, Gary M. Second order parabolic differential equations. World Scientific Publishing Co., Inc., River Edge, NJ, 1996. xii+439 pp. Morrey, Charles B., Jr. Multiple integrals in the calculus of variations. Reprint of the 1966 edition. Classics in Mathematics. Springer-Verlag, Berlin, 2008. x+506 pp. Protter, Murray H.; Weinberger, Hans F. Maximum principles in differential equations. Corrected reprint of the 1967 original. Springer-Verlag, New York, 1984. x+261 pp. Smoller, Joel. Shock waves and reaction-diffusion equations. Second edition. Grundlehren der Mathematischen Wissenschaften [Fundamental Principles of Mathematical Sciences], 258. Springer-Verlag, New York, 1994. xxiv+632 pp. Harmonic functions
Partial differential equations
Mathematical principles