Suppose *f*(*x*) and *g*(*x*) are functions that are each proportional to their second derivative. These include exponential, circular, and hyperbolic functions. Then the integral of *f*(*x*) *g*(*x*) can be computed in closed form with a moderate amount of work.

The first time you see how such integrals are computed, it’s an interesting trick. I wrote up an example here. It may seem like you’re going in circles—and if you’re not careful you *will* go in circles—but the integral pops out.

After you’ve done this kind of integration a few times, the novelty wears off. You know how the calculation is going to end, and it’s a bit tedious and error-prone to get there.

There’s a formula that can compute all these related integrals in one fell swoop [1].

Suppose

and

for constants *h* and *k*. All the functions mentioned at the top of the post are of this form. Then

So, for example, let

and

Then *h* = 400, *k* = −529, and

Here’s another example.

Let

and

Then *h* = -1, *k* = 900, and

Implicit in the formula above is the requirement *h* ≠ *k*. If *h* does equal *k* then the integral can be done by more basic techniques.

## Related posts

[1] Donald K. Pease. A useful integral formula. American Mathematical Monthly. December 1959. p. 908.

Note that the right hand side of the integral formula is the negative of the Wronskian of f and g. This measures how close f and g are to being linearly dependent.

Roughly speaking, as h and k get close, f and g become more similar. The left side is approaching f^2, but the Wronskian is approaching zero. But dividing by h-k keeps the right side from going to zero.

This is dancing around the fact that the differential equation y” = ky is well-posed, i.e. solutions depend continuously on the parameter k (and on initial conditions which we haven’t made explicit.)