Converting a volume-integral to a surface integral using Gauss' theorem I have the following integral:
$$\int_V ((\vec\nabla.\vec A)(\vec\nabla.\vec B)+\vec B.\vec\nabla(\vec\nabla.\vec A))dV$$
Using Gauss' theorem I can convert this into a surface integral. However, I need to rewrite the integrandum into something of the form $\vec\nabla.\vec V$ in order to apply Gauss.
In short: 
$$(\vec\nabla.\vec A)(\vec\nabla.\vec B)+\vec B.\vec\nabla(\vec\nabla.\vec A)=\vec\nabla.\vec V$$
Where I need to find $\vec V$ so that the identity is correct.
I've tried using index notation but since the result is a scalar that doesn't make much sense so I was a bit hesitant to try it. I decided to give it a shot and got the following:
$$(\partial_iA_i)(\partial_jB_j)+B_k\partial_l\partial_lA_k$$
Which leads me nowhere.  
I've also tried putting $(\vec\nabla.\vec A)$ in front (applying distributivity) but that's not correct because, while $(\vec\nabla.\vec A)$ does appear in the second term, there is still a $\vec\nabla$ that works in on it. 
I honestly don't know what else I can try.
 A: Write everything in index notation. Your integrand is
$$
\frac{\partial A_i}{\partial x_i}\frac{\partial B_j}{\partial x_j} + B_j \hat{e}_j \cdot \left ( \hat{e}_m \frac{\partial}{\partial x_m} \left ( \frac{\partial A_p}{\partial x_p} \right)\right)
$$
which reduces, on simplification, to
$$
\frac{\partial A_i}{\partial x_i}\frac{\partial B_j}{\partial x_j} + B_j \frac{\partial^2 A_p}{\partial x_j \partial x_p}
$$
Now consider 
$$
\frac{\partial}{\partial x_p} \left( B_p \frac{\partial A_j}{\partial x_j} \right) \\
= \frac{\partial B_p}{\partial x_p}\frac{\partial A_j}{\partial x_j} + B_p \frac{\partial^2 A_j}{\partial x_p \partial x_j} \\
= \frac{\partial A_i}{\partial x_i} \frac{\partial B_j}{\partial x_j} + B_j \frac{\partial^2 A_p}{\partial x_j \partial x_p} 
$$
where we have interchanged the dummy indices j and p in the last step, and renamed the dummy indices in the first term. This is precisely your integrand above.
So your integrand can be written as
$$
\int_V \frac{\partial}{\partial x_p} \left( B_p \frac{\partial A_j}{\partial x_j} \right) dV
$$
which is now in a suitable form for application of the divergence theorem.
ETA: If you want everything back in vector form, 
$$
\frac{\partial}{\partial x_p} \left( B_p \frac{\partial A_j}{\partial x_j} \right) 
=\nabla \cdot (B (\nabla \cdot A))
$$
A: The key is that you have both $B \cdot \nabla$ and $\nabla \cdot B$.  This is a tell-tale sign of the product rule being applied.  You can use "overdot notation" to write the expression as a total divergence. First, recognize that
$$(B \cdot \nabla) (\nabla \cdot A) + (\nabla \cdot B)(\nabla \cdot A)= (\dot \nabla \cdot B)(\nabla \cdot \dot A) + (\dot \nabla \cdot \dot B)(\nabla \cdot A)$$
The dots denote what is to be differentiated; in $\dot \nabla \cdot B$, $B$ is "held constant", and as such, this is equivalent to $B \cdot\nabla$.
The overdot notation makes it easy to recognize that the product rule has been used to expand, and easy to see how the product rule should be undone:
$$ (\dot \nabla \cdot B)(\nabla \cdot \dot A) + (\dot \nabla \cdot \dot B)(\nabla \cdot A) = \dot \nabla \cdot [\dot B (\nabla \cdot A) + B(\nabla \cdot \dot A)] = \nabla \cdot [B (\nabla \cdot A)]$$
