Let's consider in dimension $d\geq 3$ the Newton/riesz potential $f=I\_2[g]$
$$
f(x)=\int\_{R^d}\frac{1}{|x-y|^{d-2}}g(y)dy,
$$
which solves $-\Delta f=g$ (up to positive normalizing constants, which I shall ignore), and assume that $g\in L^q$ for all $q\in[1,2d/(d+2)]$. By the [Hardy-Littlewood-Sobolev](http://en.wikipedia.org/wiki/Hardy%E2%80%93Littlewood%E2%80%93Sobolev_inequality#Hardy.E2.80.93Littlewood.E2.80.93Sobolev_lemma "Hardy-Littlewood-Sobolev") inequality (or any other variation from [Stein, singular inegrals], [Lieb-Loss, Analysis] etc...) we know that $f\in L^{2d/(d-2)}$, and also $\nabla f\in L^2$ (this is one way to prove the Sobolev embedding $H^1\subset L^{2d/(d-2)}$). If $p=2d/(d+2)$ the conjugated Holder exponent is exactly $p'=\frac{2d}{d-2}$, thus $g\in L^p$, $f\in L^{p'}$ and $fg\in L^1$. Since by definition $-\Delta f=g$ we would expect that
$$
\int \underbrace{f}\_{\in L^{p'}}\underbrace{g}\_{\in L^p}=\int f(-\Delta f)\overset{?}{=}\int |\underbrace{\nabla f}\_{\in L^2}|^2.
$$


**When is the last integration by parts legitimate?** With my hypotheses all the above terms are well defined, but is this enough? I seem to remember that there are "exotic" counterexamples...


It seems to me that an approximation argument works fine: if $g\_n$ is a sequence of smooth compactly supported functions such that $g\_n\to g$ in $L^{2d/(d+2)}$ then by continuity (HLS inequality) we have that $f\_n\to f$ in $L^{2d/(d-2)}$ and $\nabla f\_n\to \nabla f$ in $L^2$. Since the integration by parts is legitimate for smooth decaying functions then it should pass to the limit... I don't think anything is wrong here, did I miss something or is it really just that easy?


**Edit:** I just added the approximation argument



Is this integration by parts legitimate?
This "integration by parts" is true in larger generality:
Let $\mu$ be a measure, 
$$u(x)=\int\frac{1}{|x-y|^{n-2}}d\mu(y).$$
Then 
$$\int u(x)d\mu=\int\frac{1}{|x-y|^{n-2}}d\mu(x)d\mu(y)$$
is called the energy of $\mu$. If this is finite, the measure is said of
finite energy. Gradient of the potential of such measure is in $L^2$ and
your formula holds. Then it is extended to differences of measures (charges)
of finite energy. Measures and potentials of finite energy form a Hilbert space
with respect to the scalar product
$$(\mu,\nu)=\int u(x)d\nu(x).$$


Reference: Landkof, Introduction to modern potential theory, Ch. I, section 4. 


