The dreaded calculus torture device that works for exactly two integrals, and .

Actually, no. A version of it (with one integration by parts) works for :

hence (assuming )

Yes, this is more of a calculus joke. A more serious example comes from Fourier series.

The functions , , are orthogonal on , in the sense that

This is usually proved using a trigonometric identity that converts the product to a sum. But the double integration by parts give a nicer proof, because no obscure identities are needed. No boundary terms will appear because the sines vanish at both endpoints:

All integrals here must vanish because . As a bonus, we get the orthogonality of cosines, , with no additional effort.

The double integration by parts is also a more conceptual proof, because it gets to the heart of the matter: eigenvectors of a symmetric matrix (operator) that correspond to different eigenvalues are orthogonal. The trigonometric form is incidental, the eigenfunction property is essential. Let’s try this one more time, for the mixed boundary value problem , . Suppose that and satisfy the boundary conditions, , and . Since and vanish at both endpoints, we can pass the primes easily:

If , all integrals must vanish.