An application of the Gauss-Green theorem in an integral with the Laplacian operator I have this exercise:
Let $f\in C_0^{+\infty}(\mathbb{R}^3)$ a function. Prove that 
$$I=\int_{\mathbb{R}^3}{\Delta{f}(x,y,z)\cdot f(x,y,z)dxdydz}\leq0.$$
I started writing
$$I=\int_{\mathbb{R}^3}{f_{xx}(x,y,z)\cdot f(x,y,z)dxdydz}+\int_{\mathbb{R}^3}{f_{yy}(x,y,z)\cdot f(x,y,z)dxdydz}+\int_{\mathbb{R}^3}{f_{zz}(x,y,z)\cdot f(x,y,z)dxdydz}.$$
Integrating by parts
I obtained
$$I=-\int_{\mathbb{R}^3}{\langle{\nabla{f},\nabla{f}}\rangle}+\int_{\mathbb{R}^2}{[f_x(x,y,z)\cdot f(x,y,z)]^ {x=A_1(y,z)}_{x=A_2(y,z)}dydz}+\int_{\mathbb{R}^2}{[f_y(x,y,z)\cdot f(x,y,z)]^ {y=B_1(x,z)}_{y=B_2(y,z)}dxdz}+\int_{\mathbb{R}^2}{[f_z(x,y,z)\cdot f(x,y,z)]^ {z=C_1(x,y)}_{z=C_2(x,y)}dxdy}$$
(I used the fact that the support of the function is compact).
Now I would like to prove that 
$$I=-\int_{\mathbb{R}^3}{\langle{\nabla{f},\nabla{f}}\rangle}.$$
In the solution of the exercise, I found that this statement is right, and to conclude the proof it is used Gauss-Green theorem (to prove, I think, that the other part of the RHS is zero), but I can't see how it could be used here. I think that it is not correct how I have done the integration by parts. Is my approach right? How can I conclude this exercise?
 A: By integration by parts, divergence theorem, your integral is equal to 
$$
\lim_{r\to \infty}f(x,y,z)\nabla f(x,y,z)\vert_{B_r(0)}-\int_{\mathbb{R}^3} \bigg(\frac{\partial f}{\partial x}\bigg)^2+\bigg(\frac{\partial f}{\partial y}\bigg)^2+\bigg(\frac{\partial f}{\partial z}\bigg)^2\mathrm dV
$$
the left hand boundary term vanishes due to compact support. The right hand term is negative since the integrand is positive.
A: Integration by parts is the same thing as using Gauss-Green. Now just choose your region to have its boundary where $f=0$ (remember, it's $0$ everywhere outside a compact set).
If you want to make it look like Gauss-Green, take $\vec F = f\overrightarrow{\nabla f}$. What is $\text{div}\,\vec F$?
A: @Ted Shifrin
I try to answer to my question, considering your second hint. I have
$$\text{div}({f\cdot\Delta{f}})=||\nabla{f}||^2+f\cdot\Delta{f},$$
then
$$I=\int_{\mathbb{R^3}}{\text{div}({f\cdot\Delta{f})dxdydz}-\int_{\mathbb{R}^3}||\nabla{f}||^2dxdydz}.$$
We have that $f$ is compactly supported. Let $K$ be its support. We can consider another compact $H$ such that $H\supset K.$ We observe that $f_{|_{\partial{H}}}\equiv0,$ then we have
$$I=\int_{\mathbb{R^3}}{\text{div}({f\cdot\Delta{f})dxdydz}}=\int_{H}{\text{div}({f\cdot\Delta{f})dxdydz}}=\int_{\partial{H}}{f\langle\nabla{f},N\rangle dS}=0,$$ and this proves the statement, because
$$\int_{\mathbb{R}^3}{||\nabla{f}||^2dxdydz}=\int_{\mathbb{R}^3}{\langle\nabla{f},\nabla{f}\rangle dxdydz}\geq 0$$
If instead I reason like I was reasoning in the question, I think I can do a similar reasoning choosing a suitable compact in $\mathbb{R}^3,$ like for example a cube before the integration by parts, and then I should do the same thing that I have done in this answer, am I right?
