Intuition behind choosing a specific test function I am learning about elliptic PDEs using the book by Chen & Wu, especially on the maximum principle. The author uses the De Giorgi iteration technique to establish the weak maximum principle for elliptic operators under some conditions. I attached the statement here, and you can also see the proof in this link.


Before asking my question, I will describe the scheme of the proof briefly. As the main lemma of the De Giorgi iteration, the following is presented.

Lemma. Suppose $\varphi(t)$ is a nonnegative decreasing function on $[k_0, \infty)$ with
$$ \varphi(h) \leq \frac{C}{(h-k)^\alpha} \varphi(k)^\beta$$
for $h>k\geq k_0$, where $\alpha>0, \beta>1$. Then, for
$$d = C^{1 /\alpha} \left[ \varphi(k_0)\right]^{(\beta -1)/{\alpha}} 2^{\beta / (\beta -1)},$$
we have
$$ \varphi(k_0 + d) = 0.$$

Then, we want to apply this lemma to the measure of the sets
$$ A(k) = \left\lbrace x \in \Omega \ \vert \ u(x) >k \right\rbrace, \quad k \in \mathbb R$$
in order to obtain an upper bound of the essential supremum of $u$ on $\Omega$. After some estimation and using the lemma, we can get the following result.

Result. Let $\tilde C $ be the embedding constant of the Sobolev embedding of $W^{1,2}_0 (\Omega)$. Suppose $k_0 \geq l := \sup_{\partial \Omega} u^+$ satisfies
$${\tilde C}^2 \left\vert A(k_0) \right\vert^{2/{n}} \leq \frac{1}{2}.$$
Then,
$$\DeclareMathOperator{\esssup}{\mathrm ess \, sup} \esssup_{\Omega} \leq k_0 + CF_0 \lvert \Omega\rvert^{(1/n) - (1/p)} =: k_0 + C \tilde{F}_0,$$
where $F_0 = \frac{1}{\lambda} \left( \sum_i \lVert f^i \rVert_{L^p} + \lVert f \rVert_{L^{p_*}}  \right)$ and $p_* = np/(n+p)$.

To get $k_0$, we can first use the Chebyshev inequality on $u$. Then, we obtain some $k_0$ such that $k_0 \leq \sup_{\partial \Omega} u^+ + C \lVert u \rVert_{L^2}$, but this only guarantees the essential boundedness of $u$ on $\Omega$. Thus, we need to estimate further.
In order to obtain a better choice of $k_0$, the following test function is chosen: for $v = (u-l)^+$,
$$ \varphi = \frac{v}{M+ \epsilon + \tilde{F}_0 - v} \in W^{1,2}_0(\Omega),$$
where $M = \esssup_{\Omega} u - l$. This gives a better estimate on $\left\vert A(k) \right\vert$ than the estimate by the Chebyshev inequality: for $l<k<\esssup_{\Omega} u$,
$$ \left\vert A(k) \right\vert^{1/2^*} \log \frac{M+ \epsilon + \tilde{F}_0}{M+ \epsilon + \tilde{F}_0 - (k-l)} \leq \textrm{constant},$$
where $2^*$ is the Sobolev conjugate of $2$.
Now I can tell my question: is there some intuition behind choosing that test function? I am trying to find some reason for that choice, but I don't figure it out currently. I only understand that such a choice provides a better estimate.
I heard that such a kind of a test function is frequently useful, and in fact it is often used. By searching some references, I found that N. Trudinger also used the same type of the test function in 1973's and 1977's papers. I think there is some hint in the estimate procedure, but I don't grasp any idea from that.
Could you give me some intuition about that? Also, I would like to ask what way of thinking (or algorithm) is useful when choosing a test function in an estimation procedure. Thanks!
Addition: I think I should mention my opinion on why the last estimate on $\lvert A(k)\rvert$ is better. First, it does not involve the $L^2$-norm of $u$ anymore. It exactly contains our desired quantities: $\esssup_{\Omega} u$, $\sup_{\partial \Omega}u^+$ and $F_0$. In addition to this, by its form, we can easily relate $k$ and the other quantities as in the proof from the book. In this context, I can change my question to be more specific: what intuition does make somebody expect to get an estimate with those nice features?
It could be just obtained by some trials and errors. I fully understand that it would be possible that there is no critical insight. But then, what would be the starting point of this strategy?
I might be just complicating a simple stuff. I could just accept this part of the proof as a technique or machinery. However, I am really curious about what is a source of it. That is why I posted this question.
 A: This is a nice question. In my view, the choice of test function is motivated by the idea of taking some positive quantity that is a supersolution to an elliptic equation, and looking at the equation for its logarithm. The new equation contains a useful term that is quadratic in the gradient. This idea is pervasive in geometry and elliptic PDEs, and some examples are below.
(1) The basic case to consider is that $u$ is positive and superharmonic. Then $v := -\log u$ satisfies $|\nabla v|^2 \leq \Delta v$, which gives local bounds on the integral of $|\nabla v|^2$ (independent of $v$) after multiplying by standard cutoffs and integrating by parts. This is enough to prove the Harnack inequality for harmonic functions in two dimensions, since in that case the Dirichlet energy controls oscillation for functions that satisfy the maximum and minimum principle.
(2) In your context, the choice of test function $H(u)$ satisfies
$$a^{ij}\partial_iu\partial_j(H(u)) = a^{ij}\partial_i(V(u))\partial_j(V(u)),$$
where $V(u) = c_1\log(c_2 - u)$ with $c_2 - u$ positive. I view the estimate as coming from integrating the equation for $V(u)$.
To illustrate how this works in a simple context, assume that $u \in C^2_0(B_1)$ satisfies $\Delta u \geq -A$, and that $u \leq M$. Then for $w := M+A-u > 0$ we have that $v := \log(M+A)-\log(w)$ is compactly supported and satisfies $|\nabla v|^2 \leq 1 + \Delta v$. Thus the integral of $|\nabla v|^2$ (hence $v^{2^*}$) is bounded in terms of the volume of the domain.
(3) The Bombieri-De Giorgi-Miranda interior gradient estimate for a solution $u$ to the minimal surface equation is based on the fact that the vertical component $\nu^{n+1}$ of the unit normal to the graph of $u$ is positive and superharmonic (on the graph). The proof uses the equation for $v := -\log(\nu^{n+1})$, which just as above contains a useful term quadratic in $|\nabla v|$.
(4) The Li-Yau proof of the Harnack inequality for a harmonic function $u$ is obtained by looking at the quantity $w := |\nabla (-\log u)|^2$. The key is that $w$ solves a differential inequality with the powerful term $\frac{2}{n}w^2$, which allows one to bound $w$ from above locally by a universal constant independent of $w$.
I am sure there are many other interesting examples, and I am not sure where the first instances of the "log trick" appeared. One final remark is that the estimate (4.9) can also quickly be inferred using the properties of the Green's function $G$ for uniformly elliptic operators (namely, $G \in L^p$ for $p < \frac{n}{n-2}$ and $\nabla G \in L^p$ for $p < \frac{n}{n-1}$, just like the Laplace case).
