# integration by parts using gradient

I'm studying a paper and in some part they solve this integral by parts $$\int d\mathbf{x}\, u(\mathbf{x}) \nabla v(\mathbf{x}) \nabla u(\mathbf{x})= -\int d\mathbf{x}\, v(\mathbf{x}) (\nabla u(\mathbf{x}))^2$$ but I can't understand how they do that.

-
I think this is true when you assume that $u$ is harmonic. – Paul Sep 29 '12 at 8:42
Well, $\nabla f$ is a vector, so is the left integrand meant to be $u\,\nabla^T v\,\nabla u$? As it stands, it isn't defined. And what is the square of a vector? – Daryl Sep 29 '12 at 9:13

My answer is substantially identical to that of @ChristopherAWong, using a different notation, but I point out that you should take into account a surface term (thanks to the divergence theorem), so that your identity is only valid if

1. $\Delta u(\mathbf{x})=0\;\forall\,\mathbf{x}\in\Omega$,

2. $u(\mathbf{x})v(\mathbf{x})\mathbf{n}\cdot\nabla u(\mathbf{x})=0\;\forall\,\mathbf{x}\in\partial\Omega$.

Here the calculations:

Ah yes, I guess I wantonly assumed that we were integrating over $\mathbb{R}^n$ and functions were vanishing at infinity. – Christopher A. Wong Sep 29 '12 at 19:38
To start off, as mentioned in the comments, you aren't allowed to multiply two gradients unless you in fact mean inner product; I will assume this is the case. In my notation, $u_{x_i}$ means the partial derivative of $u$ with respect to $x_i$. Then we can write your integral as $$\int u \sum_i u_{x_i} v_{x_i} \, dx$$ which when applying integration by parts in $x_i$ with respect to each of the $i$-th terms of the summation yields $$- \int \sum_i (uu_{x_i})_{x_i} v \, dx = - \int \sum_i v(|u_{x_i}|^2 + u u_{x_i x_i}) \, dx = - \int v |\nabla u|^2 + vu \Delta u \, dx$$ If, in your problem, you also assume that $u$ is harmonic (you did not mention this, but if this assumption is not made, then the statement in your question is in fact false), i.e. $\Delta u = 0$, then we obtain the resulting integral $- \int v |\nabla u|^2 \, dx$, which is precisely what is written in the paper you're reading.
Thanks, this is exactly what I did to solve this integral, but in the paper is not mentioned at all whether the $u$ are harmonic functions, and that's what drives me nuts :) ... The only information I have is that they are Fourier Transformable, but at this point I must suppose they forced the function either to be harmonic, or to be zero on the surface (this is a physics paper, and they do that very often)... – Juan Sebastian Totero Sep 29 '12 at 11:26