How to prove that $|u(x)|\leq 1$ for all $x \in \Omega$, given u solves $-\vec \nabla^2 u = (1-u^2)\cdot u$ and $u=0$ on $\partial \Omega$. Let $\Omega$ be a bounded domain and let $u$ be a solution to the PDE $-\vec \nabla^2 u = (1-u^2)\cdot u$, which satisfies $u=0$ on $\partial \Omega$.
Show that $|u(x)|\leq 1$  for all $x \in \Omega$. This is a question from an old exam I ran into during my studies for my PDE course final exam. There is a hint in the question: first prove $\vec \nabla^2 (u^2) = 2 \cdot |\nabla u|^2 -2(1-u^2)u^2$ which could easily be proven by the given PDE. I wasn't able to prove this, I think it has something to do with the maximum principle, but I couldn't get to the bottom of it. I would appreciate help of any kind,
 A: I assume
$u \in C^2(\bar \Omega, \Bbb R), \tag 0$
where
$\Omega \subset \Bbb R^n; \tag{0.1}$
the given equation,
$-\nabla^2u = (1 - u^2)u, \tag 1$
may be negated to form
$\nabla^2 u = u(u^2 - 1) = u^3 - u, \tag 2$
slightly more convenient for the present purposes.  Suppose
$\exists x \in \Omega, \; \vert u(x) \vert > 1; \tag 3$
then
$u(x) > 1 \tag 4$
or
$u(x) < -1; \tag 5$
in the former case (4) we have
$u^3(x) - u(x) > 0; \tag 6$
thus,
$\nabla^2 u(x) > 0; \tag 7$
From (0) it follows that $u$ is continuous on $\bar \Omega$, which is compact since $\bar \Omega$ is closed and bounded.  Thus $u$ attains both its maximum and minimum on $\bar \Omega$; now by virtue of (4), a global maximum must occur at a point
$x_M \in \Omega \tag 8$
where
$u(x_M) \ge u(x) > 1; \tag 9$
we note that since
$u = 0 \; \text{on} \; \partial \Omega, \tag{10}$
both $x$ and $x_M$ must lie in the interior $\Omega^\circ$ of $\Omega$,
$\Omega^\circ = \bar \Omega \setminus \partial \Omega. \tag{11}$
The reader will recall that, since $x_M$ is a global maximum for $u$,
$\nabla u(x_M) = 0. \tag{12}$
Now let $y_1$, $y_2$, $\ldots$, $y_n$ be a standard coordinate system on $\Bbb R^n$, so that
$\nabla u = \left (\dfrac{\partial u}{\partial y_1}, \dfrac{\partial u}{\partial y_2}, \ldots, \dfrac{\partial u}{\partial y_n} \right ) \tag{13}$
and
$\nabla^2 u = \displaystyle \sum_1^n \dfrac{\partial^2 u}{\partial y_i^2}; \tag{14}$
(12) and (13) together imply that
$\dfrac{\partial u}{\partial y_j}(x_M) = 0, \; 1 \le j \le n, \tag{15}$
whereas (7) and (14) guarantee the existence of at least one value of the index $i$ such that
$u_{y_i y_i}(x_M) = \dfrac{\partial^2 u}{\partial y_i^2}(x_M) > 0, \tag{16}$
lest
$\nabla^2 u(x_M) \le 0;  \tag{17}$
note that in (16) we have introduced the subscript notation for partial derivatives, which will will use interchangeably with $\partial u / \partial y_i$ throughout.  Now by the continuity of $u_{y_i y_i}$ it follows that
$u_{y_i y_i}(z) = \dfrac{\partial^2 u}{\partial y_i^2}(z) > 0 \tag{18}$
for
$z \in B(x_M, \epsilon) = \{w \mid \vert w - x_M \vert < \epsilon \}, \tag{19}$
the open ball of radius $\epsilon$ centered at $x_M$, where $\epsilon$ is sufficiently small.  Consider the $y_i$ coordinate line which passes through $x_M$; along this line the coordinates $y_j$, $j \ne i$, are fixed at the values they take at $x_M$, the $y_j(x_M)$, whereas
$-\infty < y_i < \infty. \tag{20}$
We may further consider the functions $u$, $u_{y_i}$, and $u_{y_i y_i}$ along this $y_i$ line: since the $y_j(x_M)$ are constant, these three functions reduce to functions of the single variable $y_i$, and we shall write $u(y_i)$ etc.  for the values of these functions restricted to this line.  We observe that
$u(y_i(x_M)) = u(x_M), \tag{21}$
the global maximum value of $u$,
$u_{y_i}(x_M) = u_{y_i}(y_i(x_M)) = 0 \tag{22}$
in accord with (15), and that choosing
$0 < \delta < \epsilon \tag{23}$
we have
$u_{y_i y_i}(y_i) > 0 \tag{24}$
for
$y_i(x_M) - \delta < y_i < y_i(x_M) + \delta \tag{25}$
by virtue of (18)-(19); now choosing $z$ such that
$y_i(x_M) < z < y_i(x_M) + \delta, \tag{26}$
we find
$u_{y_i}(z) = u_{y_i}(z) - 0 = u_{y_i}(z) - u_{y_i}(y_i(x_M)) = \displaystyle \int_{y_i(x_M)}^z u_{y_i y_i}(s) \; ds > 0 \tag{27}$
which shows that $u_{y_i}(z)$ is positive for $z$ in the interval
$y_i(x_M) < y_i(x_M) + \delta$; we integrate once again, this time
$u_{y_i}(y_i)$ over the same interval $(y_i(x_M)), z)$:
$u(z) - u(x_M) = u(z) - u(y_i(x_M)) = \displaystyle \int_{y_i(x_M)}^z u_{y_i}(s) \; ds > 0,  \tag{28}$
where we have drawn on (27) to infer this intergral is positive for all $z$ as in (26).  (28) immediately yields
$u(z) > u(x_M), \tag{29}$
which contradicts the assertion that $x_M$ is a global maximum of $u$; we conclude in turn that
$u(x) \le 1, \; \forall x \in \Omega. \tag{29.1}$
The preceding argument shows that case (4) above cannot bind.  Case (5) may be handled in a similar manner; (6) and (7) are replaced by
$u^3(x) - u(x) < 0, \tag{30}$
$\nabla^2 u(x) < 0, \tag{31}$
respectively; $x_M$ now becomes a global minimun of $u$, with
$u(x_M) \le u(x) < -1; \tag {32}$
in lieu of (16) we find $i$ such that
$u_{y_i y_i}(x_M) = \dfrac{\partial^2 u}{\partial y_i^2}(x_M) < 0, \tag{33}$
and again by continuity we infer that
$u_{y_i y_i}(z) = \dfrac{\partial^2 u}{\partial y_i^2}(z) < 0 \tag{34}$
in some open ball $B(x_M, \epsilon)$.  From here it is a simple matter to set up integrals such as (27), (28), from which we may develop a contradiction to the hypothesis that $x_M$ is a global minimum for $u$, and hence that (5) is false and in conjunction with the above proof that (4) does not bind, that $\vert u(x) \vert \le 1$ for all $x \in \Omega$.
Of course, it is even simpler to observe that equation (2) is invariant under the transformation
$u \longleftrightarrow -u, \tag{35}$
which interchanges global maxima and minima of $u$, as well as the inequalities (4) and (5). Therefore if (5) binds for $u$, (4) binds for $-u$, which we have seen to be impossible.  From this the assertion
$\vert u(x) \vert \le 1, \; \forall x \in \Omega \tag{36}$
readily follows.
