There are two identities that have a seemingly dual correspondence:

$$e^x = \sum_{n\ge0} {x^n\over n!}$$


$$n! = \int_0^{\infty} {x^n\over e^x}\ dx.$$

Is there anything to this comparison? (I vaguely remember a generating function/integration correspondence)

Are there similar sum/integration pairs for other well-known (or not-so-well-known) functions?

  • $\begingroup$ Maybe some reading on the [Gamma Function][1] helps... [1]: en.wikipedia.org/wiki/Gamma_function "Gamma Function" $\endgroup$
    – Miguel
    Feb 4, 2011 at 19:44
  • $\begingroup$ Yes, the second identity is a non-standard display of $\Gamma(n-1)$. That integral is usually chosen to be the definition of 'best' analytic continuation of $n!$. But really, in the above, $n$ is always an integer so there's no complication there. $\endgroup$
    – Mitch
    Feb 4, 2011 at 21:10
  • $\begingroup$ I just found this: for a function $f(n)$, its ordinary generating function $g(x)$ and its exponential generating function $G(x)$, there is the relation $g(x) = \int_0^{\infty} e^{-u} G(x u) du$. It seems like it should be obvious but I just don't see the manipulation that connects this relation with the dual identities (it's obvious how it applies to the second identity) $\endgroup$
    – Mitch
    Feb 7, 2011 at 1:51
  • $\begingroup$ By the way, for a generating function (or more generally power series) $F(z)$, Cauchy's coefficient formula gives a way of determining $f_n = [z^n]F(z)$: it is given by $f_n = \frac{1}{2i\pi}\int_\lambda f(z) \frac{dz}{z^{n+1}}$, for $\lambda$ a simple loop around $0$ with positive orientation. In this case that would give $\frac{1}{n!} = \frac1{2i\pi}\int_\lambda \frac{e^z}{z^{n+1}} dz$. I'm not sure how this fits in. $\endgroup$ Jan 30, 2014 at 21:43

4 Answers 4


There is a close relationship between the two identities, but I don't know if the exact formal similarity is anything other than a neat coincidence along the lines of the Sophomore's dream (although I could of course be wrong about this). First note that the second identity can be written as

$$1 = \int_{0}^{\infty} e^{-x} \frac{x^n}{n!} \, dx$$

and therefore it is equivalent to the identity

$$\frac{1}{1 - t} = \sum_{n=0}^{\infty} t^n \int_0^{\infty} e^{-x} \frac{x^n}{n!} \, dx = \int_0^{\infty} e^{-x} e^{tx} \, dx.$$

which is an application of the first identity. (This new identity is easy to prove, since the integrand is just $e^{(t-1)x}$ so it has antiderivative $\frac{1}{t-1} e^{(t-1)x}$ and the identity follows from here.)

I know of interesting explanations of the two identities separately which are somewhat related, but not another direct connection like the one above: for the first see this math.SE question and for the second see this math.SE question.

  • $\begingroup$ Excellent...it took me a while to appreciate. Sometimes even the simplest manipulation can be inscrutable, like the integral equal to $\frac{1}{1-t}$. What this all does for me though is convince me in the simplest way possible that the second identity is just the best analytic continuation of the factorial function (just the simplest way that is). $\endgroup$
    – Mitch
    Feb 27, 2011 at 14:16

These two identities are the "opposite ends" (in a sense I will explain below) of $$ \frac1{n!} \int_0^t \frac{x^n}{e^x} \,dx + \frac1{e^t} \sum_{k=0}^n \frac{t^k}{k!} = 1 \tag{1} $$ (Proof: By induction, integrating by parts. Just like the usual proof of your second identity, but with $\int_0^t$ instead of $\int_0^\infty$.) If $t\ge 0$, then both terms on the left of (1) are nonnegative, so (1) implies they are both in $[0,1]$. The first term on the left expresses the accuracy of the truncated integral as an approximation to $n!$; the second expresses the accuracy of the truncated Taylor series as an approximation to $e^t$. What (1) asserts is that these approximations are in a see-saw relationship: when one is good, the other is bad.

Your identities are the "opposite ends" of (1) in the following sense: for fixed $n$, as $t\to\infty$, the first term approaches $1$ and the second approaches $0$, yielding your second identity in the limit; for fixed $t$, as $n\to\infty$, the first term approaches $0$ and the second approaches $1$, yielding your first identity in the limit. That's a kind of duality, I suppose, though it leaves mysterious the apparent formal symmetry that prompted your question, where the factorial and exponential functions seem to trade places.

For other (sufficiently differentiable) functions, it is straightforward to generalize (1) to $$ \int_0^t \frac{x^n f^{(n+1)}(-x)}{n!} \,dx + \sum_{k=0}^n \frac{t^k f^{(k)}(-t)}{k!} = f(0) \tag{2} $$ but again, this loses the nice formal symmetry that prompted your question.

(That symmetry is suspiciously imperfect, though, in that both identities have $x^n$ in the numerator, even though the roles of $x$ and $n$ are reversed in the two identities.)


Here's a generalization of the dual identity described by the OP. It requires $n \geq m$ for the integral.

$$(1) \hspace{1cm} x^m e^x = \sum_{n=0}^{\infty} n^{\underline{m}}\frac{x^n}{n!},$$

$$(2) \hspace{0.6cm} \frac{n!}{n^{\underline{m}}} = \int_0^{\infty} \frac{x^n}{x^m e^x} dx.$$

Equation (1) can be rewritten $$x^m e^x = \sum_{n=m}^{\infty} \frac{x^n}{(n-m)!} = \sum_{n=0}^{\infty} \frac{x^{n+m}}{n!},$$ which follows immediately from the sum in the OP's question.

Equation (2) is just $$(n-m)! = \int_0^{\infty} \frac{x^{n-m}}{e^x} dx,$$ which is also straightforward.

OP asked in the comments how I came up with this. It's a bit roundabout, actually. I was thinking about the question "Is there a definite integral for which the Riemann sum can be calculated but for which there is no closed-form antiderivative?" and wondering if one way to construct an answer would be to find an interesting sum that we know how to evaluate and that could also be expressed as a Riemann sum but for which the corresponding integral had no closed form. That eventually led me to the Wikipedia page on mathematical series, especially this section on series with factorial denominators, which has your infinite sum as the first example. I remembered your question (I had starred it as a favorite) and wondered if some of the other examples there could be used to construct answers to your question. The sum $\sum_{m=0}^{\infty} m x^m = xe^x$ worked, and I thought I might have a generalization of your identities, but then the sum $\sum_{m=0}^{\infty} m^2 x^m = (x+x^2) e^x$ did not. The page mentions that some of the examples there can be thought of as moments of a Poisson distribution. I then remembered that the factorial moments of a Poisson ($x$) distribution are much simpler than the usual moments; the factorial moments are just powers of $x$. I checked it, and that turned out to be the right generalization.

As to the meaning, I'm not sure. However, if you read George Lowther's answer or Benja's answer to the second question linked to in Qiaochu Yuan's answer to your question you see the Poisson distribution and its relationship to the gamma distribution figuring prominently. That might be the source of the relationship for the generalization as well as for your original pair of identities.

  • $\begingroup$ Excellent! Thanks. How did you come to know that? As usual the algebra is almost trivial after the fact. Any hints as to the meaning import (like Qioachu's question in his 2nd link)? $\endgroup$
    – Mitch
    Feb 27, 2011 at 14:11
  • 1
    $\begingroup$ @Mitch: Thanks. I'm glad you found it useful. The answer to "How did you come to know that?" is too long for a comment, so I'll edit it into my answer. $\endgroup$ Feb 27, 2011 at 22:04

Note that this duality is in fact a special case of Ramanujan's master theorem:

For some $x$ around the neighbourhood of $0$: $$F(x) = \sum_{n=0}^\infty f(n) \frac{(-x)^n}{n!}$$


$$\int_0^\infty x^{n} F(x)\,\text dx = n! f(-n-1)$$

  • $\begingroup$ Nice! Can you relate this theorem to the ordinary and exponential generating function in my comments to the OP: $g(x)=\int_0^{\infty} e^{−u}G(xu) du$? Also, can you give any meaning/interpretation to the master theorem here? $\endgroup$
    – Mitch
    Dec 28, 2015 at 22:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .