# Maximum principle for the heat equation with Dirichlet conditions

Let us consider the Laplacian operator in a domain $\Omega\subset \mathbb{R}^n$, with Dirichlet boundary conditions.

For all $f\in L^2(\Omega)$, we denote by $S(t)f$ the solution of the equation $$dy/dt=\Delta y,\; y(0)=f.$$

We say that $f\ge 0$ iff $f(x)\ge 0,\; \forall x\in \Omega$.

I have two questions :

1) It follows from the maximum principle that

$f\ge 0 \;$ implies $\; S(t)f\ge 0,\; \forall t\ge 0$.

Suppose now that $\; S(t_1)f\ge 0,\;$ for some $t_1>0$. Do we have $f\ge0?$

2) Let $f, g \in L^2(\Omega)$ such that $fg\ge0$. Do we have $(S(t)f)(S(t)g)\ge 0,\;\forall t\ge 0?$

The answer to all these questions is "no". Think of $S$ as an averaging operator. Initial temperature can be mostly positive on most of $\Omega$ but somewhere slightly negative. After some time $t_1$ it will be positive everywhere. This answers the first question. Second one is similar.

No, (1) and (2) are both false.

Take $n=1$ and $\Omega = (0,1)$ the unit interval.

Lemma. For $0 \le \delta \le \frac{1}{2 \sqrt{2}}$ we have $\sin(\pi x) \ge \delta \sin(2 \pi x)$ for all $x \in [0,1]$.

Proof. Set $F(x) = \sin(\pi x) - \delta \sin(2 \pi x)$. Note $F(0) = 0$. For $0 < x < \frac{1}{4}$ we have $$\pi \cos(\pi x) \ge \pi \cos(\frac{\pi}{4}) = \frac{\pi}{\sqrt{2}} \ge 2 \pi \delta \ge 2 \pi \delta \cos(2 \pi x)$$ proving that $F'(x) \ge 0$. So $F$ is increasing on $(0,\frac{1}{4})$ and hence $F \ge 0$ on $(0,\frac{1}{4})$. If $\frac{1}{4} \le x \le \frac{1}{2}$ we have $$\sin(\pi x) \ge \sin(\frac{\pi}{4}) = \frac{1}{\sqrt{2}} > \delta \ge \delta \sin(2 \pi x)$$ and so $F(x) \ge 0$ on $[\frac{1}{4}, \frac{1}{2}]$. Finally for $\frac{1}{2} \le x \le 1$ we have $$\sin(\pi x) \ge 0 \ge \delta \sin(2 \pi x)$$ and so $F(x) \ge 0$ on $[\frac{1}{2}, 1]$. QED.

Now set $f(x) = \sin(\pi x) - \sin(2 \pi x)$. Clearly $f(x) < 0$ for sufficiently small $x > 0$. Since $\sin(n \pi x)$ is a Dirichlet eigenfunction of $\Delta$ with eigenvalue $-(n \pi)^2$, we have $$(S(t) f)(x) = e^{-\pi^2 t} \sin(\pi x) - e^{-4 \pi^2 t} \sin (2 \pi x) = e^{-\pi^2 t}\left(\sin(\pi x) - e^{-3 \pi^2 t} \sin(2 \pi x)\right)$$ so if we choose $t$ large enough that $e^{-3 \pi^2 t} \le \frac{1}{2 \sqrt{2}}$ we have $S(t) f \ge 0$ by our lemma, disproving (1).

For (2), set $f(x) = \sin(2 \pi x)$ and $$g(x) = \begin{cases} 1, & 0 \le x < \frac{1}{2} \\ 0, & \frac{1}{2} \le x \le 1. \end{cases}$$ Clearly $fg \ge 0$. By the strong maximum principle, $S(t) g > 0$ everywhere for all $t > 0$, but $(S(t) f)(x) = e^{-4 \pi^2 t} \sin(2 \pi x) < 0$ for $\frac{1}{2} < x < 1$. So for any $t > 0$ we have $(S(t) f)(S(t) g) < 0$ on $(\frac{1}{2}, 1)$.