Does the Divergence Theorem hold for arbitrary tensor fields? So, a heads up, this is my first post and I'm a fairly new user.  Additionally, my math knowledge tops out at vector calculus and ODEs, but don't shy away from answering beyond my understanding should it be necessary.
Anyway, my question is simply whether the divergence theorem holds for fields other than general 3-vector fields, and if so, what changes.  I imagine the dot product would be become an inner product and the gradient operator would have to evolve somehow, but I have no idea how.  
For simplicity, I think it can be assumed that I'm asking whether the divergence theorem holds for rank-2 tensors.
Thanks in advance for any insight.
 A: The short answer is yes. The divergence theorem holds for Cartesian tensors of any rank, $$\int_{V} \frac{\partial T_{i_{1}, i_{2}, \dots i_{q} \dots i_{k}}}{\partial x_{i_{q}}} dV  = \int_{\partial V} T_{i_1, i_2, \dots i_q \dots i_k} n_{i_q} dS,$$ where V is a volume in 3 dimensions and $\partial V$ is an oriented closed surface corresponding to the boundary of $V$ (whose orientation is given by $n_{i_q}$). It can also be extended to higher dimensions.
There is a longer answer, however, and it touches on the area of differential geometry. To start with, you may notice that the divergence theorem also holds in lower dimensions:


*

*in $d=2$ it is known as Green's theorem, which you may have encountered. It says that $$\int_D\left( \frac{\partial M}{\partial x} - \frac{\partial L}{\partial y} \right)dx dy = \int_{\partial D} L(x,y) dx + M(x,y) dy$$ for $D$ a simple region in the $xy$ plane and $\partial D$ an (oriented) simple closed curve that is the boundary of $D$.

*in $d=1$ it is known as the Fundamental Theorem of Calculus, $$\int_a^b df = f(b)-f(a)=\int_{\partial [a,b]} f$$ The way to see this last statement is the following. Notice that in all of the above cases the domain of integration on the right hand side is oriented, which means that the direction in which you integrate matters. Well, since when you integrate $df$ you do it from left to right (by convention), the arrow that denotes the direction of integration points away from $a$ and into $b$, and that's why $f(a)$ picks up a minus sign. In other words the right hand side of my statement of the FTC is a signed integral. You might think this is a strange way to write it and you would be correct, but it is instructive to illustrate how this is a special case of a more general result.


You are probably learning of various vector calculus identities like the divergence theorem that you mentioned, or perhaps Stokes' theorem that says something like $$\int_{\Sigma} \nabla \times F \cdot d\Sigma = \int_{\partial \Sigma} F \cdot dr.$$ It turns out that the divergence theorem and all the other cases I mentioned above are a special case of a very powerful and broad theorem, also called Stokes' theorem, which says that $$\int_{\Omega} d\omega = \int_{\partial\Omega} \omega$$ for something called a differential form $\omega$ and an (orientable) manifold (with boundary) $\Omega$. For now think of a manifold as being some space on which you can do integration, and a differential form as something that can be integrated. Manifolds can have any dimension you like, and it is a general fact that the boundary of an $n$-dimensional manifold is an $(n-1)$-dimensional manifold. So it is no surprise that the we could extend the divergence theorem to various dimensions as we did above - they're all just special cases! These are fancy terms and take some mathematical sophistication to define, but the point (for intuition) I would like to get across is the following interpretation of the divergence theorem:
In very general terms, you should think of the change of a substance within a region as given by the flux through the boundary of that region. 
A: Fundamentally, the answer is yes: if you have a continuously differentiable tensor $T_{ijk\dotsm}$ defined on a domain $\Omega$ with a piecewise-differentiable boundary (i.e. for almost all points, we have a well-defined normal vector $n_i$), then we have
$$ \int_{\Omega} \partial_i T_{ijk\dotsm} \, dV = \oint_{\partial \Omega} n_i T_{ijk\dotsm} \, dS  $$
(you can pretend that the other indices "don't matter": they don't actually do anything when you do the process of the proof (split into small rectangles and so on): all that has been done is to apply the divergence theorem individually to the vectors $T_{i111\dotsm},T_{i2111\dotsm},\dotsc$.
A more "canonical" generalisation is what is, for bizarre historical reasons, called Stokes's theorem, which applies to differential $k$-forms for any $k$ (which it turns out are one sensible way to extend the integral to manifolds. Terry Tao has a summary of some of the ideas here, if you'd like something short to get you started.
