When can a series be integrated term by term? I have a function that is defined as a harmonic series, I would like to integrate it over part of its domain.  I have been doing this by integrating term by term and summing the result, but I seem to remember something in little Rudin that gave conditions under which this is valid, however, if I could remember what it said I still don't think I understood it.  So my question is when is the following true?

$$\int_a^b{\sum_{i}{f_i\left(x\right)}}=\sum_i{\int_a^b{f_i\left(x\right)}}$$
If the sum is finite (in number of terms) then the formula always works, just by additivity of the integration operator.

If the series is uniformly convergent and each $f_{n}(x)$ is integrable, then the formula works. I think there may be examples of pointwise- (but not uniformly-) convergent series for which the formula doesn't work, but I can't seem to find them at the moment.

Basically, we need the sequence of partial sums to be uniformly convergent to some limit function, in which case the limit function is the series itself. The result uses the fact that the limit of a sequence of integrals of functions that converge uniformly is the integral of their uniform limit..

Edit: This set of notes from UCSC (with references) includes a pretty good treatment of the whole situation, and also has some helpful examples.
If I remember correctly, as long as each of the individual terms is integrable, this is ok. It's when some of the terms might have discontinuities that make an individual term non-integrable, but are cancelled out by similar features in other terms that this method falls apart. Not a rigorous definition, I know, but in the case of a harmonic series, this shouldn't be problematic.