As already mentioned, this is a convolution. Luckily, there's a more natural function to use for this problem than Integrate[]
, and that function is called, appropriately enough, Convolve[]
. Now, since Convolve[]
assumes an infinite integration region, we need a UnitStep[]
multiplier in both the functions being convolved to limit the integration region to a finite interval. Here is one such implementation, making use of Convolve[]
, as well as a caching technique described here:
r[0, k_, t_] := Exp[-k t] Cos[t];
r[n_Integer, k_, t_] :=
Module[{kl, tl, y},
Set @@ Hold[r[n, kl_, tl_],
Simplify[
Convolve[UnitStep[y] r[n - 1, kl, y], UnitStep[y] r[0, kl, y],
y, tl], tl >= 0]];
r[n, k, t]];
Note that I had already taken the liberty to add k
as an additional parameter. You can do the same thing for the $\omega_0$ factor within the cosine. The advantage of using Leonid's version of caching is that effort expended for computing, say, r[10, 4, t]
is still usable for computing r[7, 8, t]
, since the caching remembers for a generic, as opposed to a specific, k
value.