# integration and limits of series expansion for coth

I have to calculate an integral that looks like this:

$$\int_0^{\infty} dx f(x) \coth(x)$$

where $f(x)$ is some function. To do this, I am using the following series expansion (that is taken from here http://functions.wolfram.com/ElementaryFunctions/Coth/06/05/0001/)

$$\coth(x) = \frac{1}{x} + 2 x \sum_{n=1}^{\infty} \frac{1}{n^2 \pi^2 + x^2}$$

I then integrate the expression term-by-term, and get a result (I do this with MAPLE). It ends up being a hyperbolic series.

I am however not certain that the result is correct - in particular I am not quite sure if doing this kind of term-by-term integration is valid.

If I forget about $f(x)$, then

$$\int dx \coth(x) = \ln(\sinh(x)),$$

but doing the integration term by term gives

$$\int dx \coth(x) = \int dx \frac{1}{x} + \int dx 2 x \sum_{n=1}^{\infty} \frac{1}{n^2 \pi^2 + x^2} \\ =\ln(x) + \sum_{n=1}^{\infty} \ln(n^2 \pi^2 + x^2) \\ = \ln \left( x \prod_{n=1}^{\infty} n^2 \pi^2 + x^2 \right).$$

It is not obvious to me that the term $x \prod_{n=1}^{\infty} n^2 \pi^2 + x^2$ is the same as $\sinh(x)$. I have found this expression (from here http://functions.wolfram.com/ElementaryFunctions/Sinh/08/0001/ ) $$\sinh(x) = x \prod_{n=1}^{\infty} ( 1 + \frac{x^2}{\pi^2 n^2}),$$ however it does not seem the same as what I get from integrating $\coth(x)$ term-by-term.

On a related note, taking $lim_{x \rightarrow \infty} \coth(x) =1$, while the limit taken term-by-term, goes to zero.

My questions:

1) Is the term-by-term integration as shown above valid?

2) Why does taking the limit term-by-term give a different answer than looking at $\coth(x)$ directly.

• Your series $\sum \ln (n^2\pi^2 + x^2)$ that you got from termwise integration doesn't converge. To get something convergent, you must add suitable integration constants. $-\ln (n^2\pi^2)$ is a good choice, that leads to the correct $\ln (\sinh x) + C$. – Daniel Fischer Oct 31 '13 at 23:46
• Thanks for your comment. Does that mean that in general it is safe to do this the kind of termwise integration, or should i expect the validity to be strongly dependent on f(x). Also any ideas about my question (2)? thanks – user2562235 Nov 1 '13 at 19:00
• I guess I need to write an answer for that, have a little patience. – Daniel Fischer Nov 1 '13 at 19:04
• ohh.. no rush. I though, since the question is now so far back it would not get answered at all. First time posting to the math SE - it's a real busy one. – user2562235 Nov 1 '13 at 19:33
• True, once a question gets off the front page, its chances of receiving an answer decrease. But before it's been a couple of days, there's no reason to lose hope. – Daniel Fischer Nov 1 '13 at 20:01

In general, you can operate termwise on a series of functions, if the series converges "well enough".

What "well enough" means depends on the operation. For termwise differentiation, one tends to need the locally uniform convergence of the derived series (you can sometimes get the right result under weaker conditions), for termwise integration over a finite interval, uniform convergence of the series on the interval is sufficient (again, the result can be correct under weaker conditions), also monotone convergence is sufficient (all but finitely many of the terms are non-negative, or all but finitely many are non-positive). For integration over an infinite interval, like $[0,\infty)$, uniform convergence is not sufficient, but monotone convergence is, provided that the finitely many terms that have both positive and negative values are integrable, and dominated convergence (all partial sums are in absolute value bounded by an integrable function) is also sufficient, but these are once again not necessary conditions.

For an indefinite integral, i.e. for finding a primitive, when operating termwise, one needs to ensure that the obtained series of primitives of the terms does converge at all by choosing suitable integration constants. Ignoring the constants leads usually to a divergent series, as it did for the $\coth$ partial fraction decomposition in your question. Typically one tries to obtain a series that converges locally uniformly and absolutely (because that makes manipulating the series easy). In the $\coth$ case, one gets that if instead of $\ln (n^2\pi^2 + x^2)$ one chooses the primitives

$$\ln \left(1 + \frac{x^2}{n^2\pi^2}\right) = \ln (n^2\pi^2 + x^2) - \ln (n^2\pi^2)$$

for the terms.

1) Is the term-by-term integration as shown above valid?

No. Since you obtained a series whose sum is $\equiv +\infty$, the term-by-term integration as done is not valid. However, term-by-term integration of the series is valid in principle, if suitable constants are added to obtain a (locally uniformly) convergent series.

2) Why does taking the limit term-by-term give a different answer than looking at $\coth(x)$ directly?

In this specific case, because the result of the term-by-term integration didn't converge. In general, one can easily get a different integration constant by not adding just the right constants to the primitives of the terms to obtain convergence. Here, the obvious choice of convergence-generating constants leads to the "constantless" primitive $\ln (\sinh x)$ too, but it is conceivable that in other situations, choosing the "obvious" constants for convergence in term-by-term integration would lead to a primitive that differs by a nonzero constant from the "obvious" primitive obtained in a different way.

Does that mean that in general it is safe to do this the kind of termwise integration, or should I expect the validity to be strongly dependent on $f(x)$?

Dealing with infinite expressions is never unconditionally safe, one must always take care that the obtained expressions converge in the right manner. When that is done, termwise operations are justified, and yield the correct results. The validity of termwise operations depends not strongly on the represented function $f(x)$, but on the properties of the infinite representation. For analytic functions like $\coth$, the typical representations (power series, partial fraction decompositions, product representations) behave nicely enough to allow termwise operations in general.