There are many ways to integrate by parts in vector calculus. So many that I can't show you all of them. There are, after all, lots of ways to put a vector differential form into an equation, and (at least) three dimensionalities of integral you might be trying to do! I will therefore demonstrate how to think about integrating by parts in vector calculus, exploiting the gradient product rule, the divergence theorem, or Stokes' theorem. In almost all of these cases, they result from integrating a total derivative of some sort or another over some particular domain (as you can see from their internal derivations or proofs, beyond the scope of this course).
It is easiest to teach this by example. Let's write one of our product rules:
Note that the left hand side is a pure divergence. Let's integrate it over a volume bounded by a closed surface:
Now we will apply the divergence theorem (one of our ``fundamental theorems'' above) to the left hand side only:
Finally, let's rearrange:
In electrodynamics, it is often the case the , all of real space, and either or vanish at infinity, where we would get:
or (a divergenceless field) in which case:
Both of these expressions can be algebraically useful.
This is not by any means the only possibility. We can do almost exactly the same thing with and the curl theorem. We can do it with the divergence of a cross product, . You can see why there is little point in tediously enumerating every single case that one can build from applying a product rule for a total differential or connected to one of the other ways of building a fundamental theorem.
The main point is this: If you need to integrate an expression in vector calculus containing the operator, try to find a product rule connected to a version of the fundamental theorem that produces the expression as one of its two terms.
Then go through the conceptual process of writing out the differential product expression, integrating both sides, applying e.g. the divergence theorem, the curl theorem, or generalizations or special cases of them indicated above:
There are two moderately important (and fairly easy to derive, at this point) consequences of all of the ways of mixing the fundamental theorems and the product rules into statements of integration by parts. One is the slightly less useful Green's First Identity (or theorem). Suppose and are, as usual, scalar functions. Then:
where is the rate of change of the function in the direction of the outgoing normal (and ditto for the similar expression for f).
Hint for proof: Consider integrating .
One use of this is to prove the very useful Green's Second Identity (or theorem):
You can just write the first identity twice with f and g reversed and subtract them them to get this result.
At this point it is important to connect this ``too abstract'' review of rules and theorems and forms to real physics. An example is in order.