# 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

## 2 Answers

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:

\begin{align*} &\int_{\Omega}u(\mathbf{x})\sum_{i=1}^{3}\frac{\partial v(\mathbf{x})}{\partial x_{i}}\frac{\partial u(\mathbf{x})}{\partial x_{i}}d\mathbf{x}=\\ &\qquad=\int_{\Omega}\left[\sum_{i=1}^{3}\frac{\partial}{\partial x_{i}}\left(u(\mathbf{x})v(\mathbf{x})\frac{\partial u(\mathbf{x})}{\partial x_{i}}\right)-v(\mathbf{x})\sum_{i=1}^{3}\frac{\partial}{\partial x_{i}}\left(u(\mathbf{x})\frac{\partial u(\mathbf{x})}{\partial x_{i}}\right)\right]d\mathbf{x}=\\ &\qquad=\int_{\partial \Omega}\sum_{i=1}^{3}n_{i}\left(u(\mathbf{x})v(\mathbf{x})\frac{\partial u(\mathbf{x})}{\partial x_{i}}\right)da-\int_{\Omega}v(\mathbf{x})\sum_{i=1}^{3}\frac{\partial u(\mathbf{x})}{\partial x_{i}}\frac{\partial u(\mathbf{x})}{\partial x_{i}}d\mathbf{x}+\\ &\qquad\qquad\qquad-\int_{\Omega}v(\mathbf{x})\sum_{i=1}^{3}u(\mathbf{x})\frac{\partial^{2}u(\mathbf{x})}{\partial x_{i}^{2}}d\mathbf{x}=\\ &\qquad=\int_{\partial \Omega}u(\mathbf{x})v(\mathbf{x})\mathbf{n}\cdot\nabla u(\mathbf{x})da-\int_{\Omega}v(\mathbf{x})\left(\nabla u(\mathbf{x})\right)^{2}d\mathbf{x}-\int_{\Omega}v(\mathbf{x})u(\mathbf{x})\Delta u(\mathbf{x})d\mathbf{x}= \end{align*}

-
Yes the surface term is missing in Chistopher's answer, so despite he arrived early, I have to set yours as right :) Grazie Enzo :) – Juan Sebastian Totero Sep 29 '12 at 12:18
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
@Christopher : I know, but for sake of clarity, enzo has been more explicit, so this is the right answer :) this is a difficult situation :) – Juan Sebastian Totero Oct 2 '12 at 9:40

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