TITLE: What is integration by parts, really?
QUESTION [81 upvotes]: Integration by parts comes up a lot - for instance, it appears in the definition of a weak derivative / distributional derivative, or as a tool that one can use to turn information about higher derivatives of a function into information about an integral of that function. Concrete examples of this latter category include: proving that $f \in C^2(S^1)$ implies that the Fourier series of $f$ converges absolutely and uniformly, and the Taylor series expansion with the integral formula for remainder.
However, I don't feel like I really understand what integration by parts is really doing. To me, it is just an algebraic trick that follows from the fundamental theorem of calculus and the product rule. Is there some more conceptual way to think about it?
How do you think about this useful idea?

REPLY [3 votes]: I learned this point of view recently:
"Integration by parts is a consequence of the translation invariance of the Lebesgue measure"
What this means is the following:
$\int \frac{f(x + h) - f(x)}{h} g(x) dx = \frac{1}{h} [\int f(x + h)g(x) dx - \int_{\mathbb{R}} f(x) g(x) dx] = \frac{1}{h}  [ \int_{\mathbb{R}} f(y)g(y - h) dy - \int_{\mathbb{R}} f(y)g(y) dy ] = \int_{\mathbb{R}} f(y) \frac{ g(y - h) - g(y)}{h} dy$
Translation invariance appears in the second equality, where we substitute $x + h = y$ into the first integral on the RHS.
Sending $h \to 0$ gives:
$\int_{\mathbb{R}} f'(x) g(x) dx = - \int_{\mathbb{R}} f(y) g'(y) dy$.
The boundary conditions can be obtained in the following way:
$$\int_a^b \frac{f(x + h) - f(x)}{h} g(x) dx = \frac{1}{h} [\int_a^b f(x + h)g(x) dx - \int_a^b f(x) g(x) dx] = \frac{1}{h}  [ \int_{a + h}^{b + h} f(y)g(y - h) dy - \int_a^b f(y)g(y) dy ]$$ $$=  \frac{1}{h}  [ \int_{a}^{b} f(y)g(y - h) dy - \int_a^{a+h} f(y)g(y -h) dy + \int_b^{b+h} f(y) g(y - h) dy - \int_a^b f(y)g(y) dy ]$$ $$ = \frac{1}{h}  [ \int_{a}^{b} f(y)[g(y - h) - g(y)] dy - \int_a^{a+h} f(y)g(y -h) dy + \int_b^{b+h} f(y) g(y - h) dy $$ 
Whereupon sending $h \to 0$ gives $\int_a^b f(x) g'(x) dx = - \int_a^b f(y) g'(y) dy- f(a)g(a)  + f(b) g(b) $.
The broader picture that this story fits into is that this shows what must change in order to obtain the integration by parts formula in the Malliavin calculus. This also shows how to obtain an integration for parts formula against a measure whose translation in a particular direction is absolutely continuous.