Integration by parts for a general negative-definite self-adjoint operator. I suspect I am asking a very stupid question.
Suppose you have self-adjoint negative-definite operator $L$ densely defined on a space $L^2(\pi)$, with $Lf = \nabla \cdot ( A(x)\nabla f)$, for some symm. pos. def matrix A.  Here assume that differentiation $\nabla = (D_i)_{i=1,..,n}$ is a skew-adjoint operator densely defined on $L^2(\pi)$, that is, $\mathcal{D}(D_i) = \mathcal{D}(D_i^*)$ and  $D_i^* = -D_i$, for $i=1,\ldots n$.
Now, I'm trying to make sense of the statement that $f \in \mathcal{D}((-L)^\frac{1}{2})$.  This would imply that $((-L)f, f) < \infty$,  but I'm not sure if we can ALWAYS write this as:
$$((-L)f, f) =   \int_\Omega \nabla f\cdot A(x) \nabla f \space \pi(dx)$$
I'm sorry if this is a stupid question but for some reason I can't convince myself of this fact.
 A: It is possible to make sense of $T^{1/2}$ without some of the particulars mentioned, when $T$ is a positive self-adjoint (densely-defined) operator on a Hilbert space. Namely, Friedrichs' argument (as in Riesz-Nagy, for example) shows that the resolvent $(T-\lambda)^{-1}$ exists and is a bounded operator for $\lambda$ not positive real. In particular, $T^{-1}$ is a bounded operator. It is also positive, so by standard (bounded-operator) spectral calculus admits a positive square root, whose inverse is the desired $T^{1/2}$.
Edit: after seeing some reactions, it is worth clarifying, as follows. Again, the square root of a positive unbounded (densely defined) _truly_self-adjoint_ operator exists without necessarily expressing the square root in terms of differential operators. The domain $D(\sqrt{T})$ is the same as the domains $D(\sqrt{T-\lambda})$ for $\lambda$ not in $[0,\infty)$.
There is the subordinate issue of whether one knows that the operator is genuinely self-adjoint, or only "symmetric". In the latter case, the question of self-adjoint extensions is non-trivial, depending on things abstracting "boundary conditions", tho' there is always the Friedrichs "minimal" extension. 
In a similar vein, if we truly know a-priori that the operators $D_i$ are well-behaved in the sense that their domains and their adjoints' domains agree (the skew-adjoint version of self-adjoint), and assuming the domain(s) of the various expressions genuinely agree with that of the original operator, the seemingly formal computations are (by fiat) correct.
In practice, yes, there would be a non-trivial issue of specifying a common domain for the $D_i$ so that they are "genuinely" skew-adjoint, and so that the implied domain of the symmetric second-order operator is equal to that of its adjoint (so it is truly self-adjoint). 
G. Grubb's book "Distributions and Operators" discusses many concrete examples of such things.
A: In short, "yes, probably, but you should be careful about boundary conditions."
The long version:
First a cautionary result. Let the Hilbert space be $L^2(0,1)$ and let $Lf =f''$ on the domain of functions $f\in L^2(0,1)$ with two derivatives in $L^2$ and such that $f(0)=-f'(1)$ and $f(1)=f'(0)$.  This is a self-adjoint operator and by integration by parts
$$(f,(-L)f)= 2 \mathrm{Re}(\overline{f(1)}f(0))+ \int_0^1 |f'(x)|^2 dx.$$ 
However, this counter example is crazy, since it is not possible to interpret $L$ as $- D^\dagger D$ for an operator $D$ which takes one derivative. Also the boundary conditions I used would be very unlikely to arise in practice. Nevertheless it shows that some caution is needed.
So, let me interpret your question as follows:  

"Let $L$ be the (unique!) operator
  defined on the domain
  $\mathcal{D}(L)\subset
> \mathcal{D}(\nabla)$ of functions $f$
  such that $A(x)\nabla f \in
> \mathcal{D}(\nabla^\dagger)$, with
  $Lf=-\nabla^\dagger A(x) \nabla f$. 
  Does the identity 
  $$((-L)f,f)=\int \nabla f \cdot A(x)\nabla f d\pi$$ 
  hold for $f\in \mathcal{D}(L)$?"

To begin with it may not be obvious that such an operator exists, or that it is self-adjoint, however this is the case and further more your integration by parts identity always holds. In fact, under the standard construction -- originally due to Friedrichs I think -- the answer is trivially yes since integration by parts is essentially the definition of $L$! 
The Friedrichs construction is based on a theorem from functional analysis that says that any closed, positive quadratic form $q$ on a Hilbert space is the quadratic form of a positive self-adjoint operator.  (See, for example, Thm. VIII.15 in Reed and Simon Vol. I.)  In the present case we would define the quadratic form 
$$q(g,f)= \int \overline{\nabla g(x)} \cdot A(x) \nabla f(x) d\pi(x) $$
which is easily shown to be closed and positive so long as $\nabla$ is a closed operator and $A(x)$ is symmetric positive definite as you assume. The proof of the theorem goes by showing that the domain $\mathcal{D}$ of functions $f$ such that $|q(g,f)| \le C \|g\| $
is dense so that it makes sense (by the Riesz thm. on linear functionals) to define an operator $L$ on this domain by the identity
$$q(g,f)= (g,(-L)f).$$
Note that the identity you want is a special case of this defintion!   
It is easy to see now that the domain of $L$ consists of all functions $f$ such that $A(x)\nabla f \in \mathcal{D}(\nabla^\dagger)$ and that the quadratic form domain agrees with the domain of $\sqrt{-L}$ so that we have 
$$\|\sqrt{-L}f\|^2 =q(f,f).$$
Note that, none of what was done above relied on the derivatives being implemented as anti-self-adjoint operators as you asked for.  Returning to the one-dimensional case with Hilbert space $L^2(0,1)$ and $A=1$, first let $\nabla = d/dx$ on the domain of functions in $L^2(0,1)$ with one derivative in $L^2$. The resulting operator $L_N$ is the Neumann second derivative defined on the domain $\mathcal{D}(L_N)$ of twice differentiable functions with derivatives that vanish at $0$ and $1$ and the identity holds, however $\nabla$ is not anti-self-adjoint.
A: Some comments:


*

*Self-adjointness of $L$ imposes a non-trivial condition on the measure $\pi$. I believe it has to be essentially Lebesgue. For example try $A = 1$, $\pi = 1 + x$, and $M = [0,1]$. Then $L$ is not self-adjoint.

*You should ask if for $f \in \mathcal{D}( (-L)^{\frac{1}{2}})$, one has
$$
 ( (-L)^{\frac{1}{2}} f, (-L)^{\frac{1}{2}} f) = \int \nabla f \cdot A \nabla f   \pi(dx),
$$
since $-L f$ is only defined for $f \in \mathcal{D}(L)$.
Is this an accurate interpretation of your question?

*The formulation above is non-trivial, since one doesn't have that 
$$
   (-\Delta)^{\frac{1}{2}} = - i \nabla.
  $$ 
It is given by multiplication by $|k|$ in the fourier basis. But my best guess is that for the usual cases the formula you stated is still correct... But I am also not completely sure how to check if for non-constant $A$.
