Let $U$ be an open ball in $\mathbb{R}^3$, and $f$, $g$ be the continuous functions on the boundary of $B$. Let $u$ be a $C^2$ function in $\mathbb{R}^3$ which is a solution of a Poisson equation, i.e. $$-\nabla^2 u = f \text{ on } U \text{ and } u = g \text{ on }\partial U$$ Let $w$ be an another $C^2$ function with $w =g$ on $\partial U$. I want to establish the inequality $$\iiint_U \frac{1}{2} \lVert \nabla u \rVert^2 - uf dV \leq \iiint_U \frac{1}{2} \lVert \nabla w \rVert^2 - wf dV$$ I tried to exploit the equalities such as $$\nabla \cdot ((u-w)\nabla u) = (u-w) \nabla^2 u + (\nabla u - \nabla w) \cdot (\nabla u) = uf - wf + \lVert \nabla u \rVert^2 - (\nabla u)\cdot (\nabla w)$$ since $u-w$ is zero in the boundary, using the divergence theorem will give me something similar, but I am not able to proceed further to get the desired inequality. For example, where does 1/2 in the inequality come from?
Thanks in advance for any form of help, hint, or solution to get the inequality.
Define $J[v] = \int_U \frac{1}{2} \|\nabla v\|^2 - vf \ dx$ for $v\in C^2(U)$. Notice that any $w$ in your formulation is equivalent to $u + \eta$, where $\eta$ is smooth and zero on the boundary. Your problem is equivalent to showing that $0 \leq J[u+\eta] - J[u]$. Plugging in an expanding $\|a+b\|^2 = (a+b)\cdot (a+b)$, we have
$$ J[u+\eta] = J[u] + J[\eta] + \int_U \nabla u\cdot\nabla\eta \ dx. $$ However, since $u$ satisfies the Poisson problem and $\eta$ is zero on the boundary, we have
$$ \int_U \nabla u\cdot\nabla\eta \ dx = -\int_U\nabla^2 u\eta \ dx = \int_U f\eta \ dx. $$
We then have $$ \begin{aligned} J[u+\eta] - J[u] &= J[\eta] + \int_U f\eta \ dx \\ &=\int_U \frac{1}{2} \|\nabla \eta\|^2 - \eta f \ dx + \int_U f\eta \ dx \\ &= \frac{1}{2}\int_U\|\nabla\eta\|^2 \ dx \geq 0, \end{aligned} $$ where equality is achieved iff $\nabla^2 \eta = 0$ on $U$ and $\eta = 0$ on $\partial U$, which implies $\eta = 0$ and $u=w$.