Using an energy argument for the Neumann problem Background Information:
From Walter A Strauss Chapter 2.
Imagine an infinite string with constants $\rho$ and $Y$. Then $\rho u_{tt} = T u _{xx}$ for $-\infty < x < \infty$. From physics we know that the kinetic energy is $\frac{1}{2}m v^2$ which in our case takes the form $KE = \frac{1}{2}\rho \int u_t^{2} dx$. This integral, and the following ones, are evaluated from $-\infty$ to $\infty$. To be sure that the integral converges, we assume that $\phi(x)$ and $\psi(x)$ vanish outside an interval $\{|x|\leq R\}$. As mentioned above, $u(x,t)$ [and therefore $u_t(x,t)$] vanish for $|x| > R + ct$. Differentiating the kinetic energy, we can pass the derivatives under the integral sign to get $$\frac{d KE}{dt} = \rho \int u_t u_{tt} dx$$ Then we substitute the PDE $\rho u_{tt} = T u_{xx}$ and integrate by parts to get $$\frac{d KE}{dt} = T\int u_t u_{xx} dx = T u_t u_x - T \int u_{tx} u_x dx$$
The term, $T u_t u_x$ is evaluated at $x = \pm \infty$ and so it vanishes. But the final term is pure derivative since $u_{tx} u_x (\frac{1}{2} u_x^{2})_{t}$. Therefore, $$\frac{d KE}{dt} = -\frac{d}{dt}\int \frac{1}{2} T u_{x}^{2} dx$$
Let $PE = \frac{1}{2}T\int u_{x}^{2}dx$ and let $E = KE + PE$. Then $d KE/dt = - d PE/dt$ or $dE/dt = 0$. Thus $$E = \frac{1}{2}\int_{-\infty}^{\infty}(\rho u_t^{2} + T u_{x}^{2})dx$$
is a constant independent of $t$. This is the law of conservation of energy.
Question:

Consider an open, bounded region $U$, and the Neumann problem
  $$\begin{cases}
-\Delta u - f \ \ &\text{in} \ U\\
\frac{\partial u}{\partial v} = g \ \ &\text{on} \ \partial U 
\end{cases}$$
  Assume that $f$ and $g$ satisfy the constraint 
  $$-\int_{U}f dx = \int_{\partial U}g dS$$
  so that a solution is possible.
a.) Prove that solutions to this problem are unique up to additive constants, using an energy argument.
b.) (Dirichlet's principle for the Neumann problem)
Let $\mathcal{A} = C^{2}(\bar{U})$. Define the energy 
  $$E[w] = \int_{U}\frac{1}{2}|Dw|^2 - fw dx - \int_{\partial U}gw dS$$
  for $w\in\mathcal{A}$. Prove that $u\in \mathcal{A}$ is a solution to the Neumann problem if and only if $E[u] = \min_{w\in\mathcal{A}}E[w]$.

Remark: Note that, unlike the Dirichlet boundary problem, the boundary condition is not included in the definition of $\mathcal{A}$. For the $(\Leftarrow)$ direction, you must prove that $u$ satisfies the boundary condition, too.
Attempted proof a.) Assume that we have two solutions $u_1(x)$ and $u_2(x)$. Let $v(x) = u_1(x) - u_2(x)$. Then we have 
$$\begin{cases}\Delta v(x) = 0 \ \ &\text{for} \ x\in U\\
\frac{\partial v}{\partial n}(x) = 0 \ \ &\text{for} \ x\in \partial U
\end{cases}
$$
So, 
\begin{align*}
0 = -\int_U v \Delta v dx &= -\int_{U} v\cdot div(grad (v))dx\\
&= -\int_{\partial U} (v \cdot grad(v))\cdot n dS + \int_{U} grad(v) \cdot grad(v)dx\\
&= -\int_{\partial U}v \frac{\partial v}{\partial n}dS + \int_{U} |\nabla v|^2 dx\\
&= \int_{U} |\nabla v|^2 dx\\
\end{align*}
So, $\Delta v(x) = 0$ for all $x$ and $v(x) = c$ where $c\in\mathbb{R}$, constant. This implies $u_1 = u_2$ and hence the solution is unique. 
I am not sure if the proof for part a.) is correct. I don't know how to start b.) as of yet but I am open to suggestions.
 A: Question:

Consider an open, bounded region $U$, and the Neumann problem
  $$\begin{cases}
-\Delta u = f \ \ &\text{in} \ U\\
\frac{\partial u}{\partial n} = g \ \ &\text{on} \ \partial U 
\end{cases}$$
  Assume that $f$ and $g$ satisfy the constraint 
  $$-\int_{U}f dx = \int_{\partial U}g dS$$
  so that a solution is possible.
a.) Prove that solutions to this problem are unique up to additive constants, using an energy argument.
b.) (Dirichlet's principle for the Neumann problem)
Let $\mathcal{A} = C^{2}(\bar{U})$. Define the energy 
  $$E[w] = \int_{U}\frac{1}{2}|Dw|^2 - fw dx - \int_{\partial U}gw dS$$
  for $w\in\mathcal{A}$. Prove that $u\in \mathcal{A}$ is a solution to the Neumann problem if and only if $E[u] = \min_{w\in\mathcal{A}}E[w]$.

a. Your proof is correct. Only change needed is in the end.
"So, $\Delta v(x) = 0$ for all $x$ and $v(x) = c$ where $c\in\mathbb{R}$, constant. This implies $u_1 = u_2+c$ and hence the solution is unique up to additive constants".
b. (=>) Suppose that $u\in \mathcal{A}$ is a solution to the Neumann problem. Let us prove that for all $w\in\mathcal{A}$, $E[w] \geqslant E[u]$. Let  $w\in\mathcal{A}$. Then, we define $v=w-u$. So $w=u+v$ and we have 
\begin{align*}
E[w] &= \int_{U}\frac{1}{2}|Dw|^2 - fw dx - \int_{\partial U}gw dS = \\
&= \int_{U}\frac{1}{2}|Du+Dv|^2 - f(u+v) dx - \int_{\partial U}g(u+v) dS =\\
&= \int_{U}\frac{1}{2}(|Du|^2+ 2(Du).(Dv) +|Dv|^2) - f(u+v) dx - \int_{\partial U}g(u+v) dS =\\
&= \left (\int_{U}\frac{1}{2}|Du|^2 - fu dx - \int_{\partial U}gu dS \right ) + \\ &\phantom{mmmm} + \left(\int_{U}(Du).(Dv)dx +\int_{U}\frac{1}{2} |Dv|^2 dx- \int_{U}fv dx - \int_{\partial U}gv dS    \right)= \\
&= E[u] + \int_{U}\frac{1}{2} |Dv|^2 dx + \left(\int_{U}(Du).(Dv)dx - \int_{U}fv dx - \int_{\partial U}gv dS    \right)= \\
&= E[u] + \int_{U}\frac{1}{2} |Dv|^2 dx + \left(\int_{U}(Du).(Dv)dx + \int_{U}v\Delta u dx - \int_{\partial U}v\frac{\partial u}{\partial n} dS    \right)= \\
&= E[u] + \int_{U}\frac{1}{2} |Dv|^2 dx  \\
\end{align*}
So we have proved 
$$ E[w] = E[u] + \int_{U}\frac{1}{2} |D(w-u)|^2 dx  \tag{1} $$
Since $\frac{1}{2} |D(w-u)|^2 \geqslant 0$, we have that $E[w] \geqslant E[u]$. 
(<=) Suppose  $w_1\in\mathcal{A}$ and $E[w_1] = \min_{w\in\mathcal{A}}E[w]$. We know that the Neumann problem has a solution $u$ and from the (=>) part, we know that $E[u] = \min_{w\in\mathcal{A}}E[w]$. So we have $E[w_1] = E[u]$. Now, from   applying $(1)$ to $w_1$ and $u$, we have: 
$$ E[w_1] = E[u] + \int_{U}\frac{1}{2} |D(w_1-u)|^2 dx  $$
So we have $\int_{U}\frac{1}{2} |D(w_1-u)|^2 dx=0$. So $D(w_1-u)=0$. So, there is a constant $c$ such that $w_1=u+c$. So $w_1$ is a solution to the Neumann problem.
