Help explaining divergence theorem example I am looking at an application of the divergence theorem, and I don't understand what's going on. Could anyone explain how to go from the first expression to the second expression (which can then be translated into an integral on $\partial{D}$):

$$\int_{D} f(x,y) \Delta f(x,y) dV = \int_{D} ((\text{div}(f \nabla f) - \nabla{f} \cdot \nabla{f})dV$$

I know that if the expression within the integral was simply $\Delta{f(x,y)}$, then you could make it $\text{div}(\nabla{f(x,y)})$, but I don't know what to do when you're multiplying the Laplacian of $f$ by $f$ itself.
A vector identity is used:

$$\nabla \cdot (f \nabla f) = f\Delta f +\nabla f \cdot \nabla f.$$

($\Delta f, \nabla f, \nabla \cdot f$ are the Laplacian, gradient, and divergence of $f$, respectively.  The Wikipedia example uses two different functions, but there's only one function in your case.)

As far as the mechanics of multiplying $f$ by its Laplacian, they're just two functions of $x$ and $y$.  Given $f$ you can calculate its Laplacian explicitly.
A vector identity is used:

$$\nabla \cdot (f \nabla f) = f\Delta f +\nabla f \cdot \nabla f.$$

($\Delta f, \nabla f, \nabla \cdot f$ are the Laplacian, gradient, and divergence of $f$, respectively.  The Wikipedia example uses two different functions, but there's only one function in your case.)

As far as the mechanics of multiplying $f$ by its Laplacian, they're just two functions of $x$ and $y$.  Given $f$ you can calculate its Laplacian explicitly.