TITLE: Can $\sum_{x \in [0,1]} e^x$ be represented as an integral?
QUESTION [21 upvotes]: In $$\sum_{x \in [0,1]} e^x,$$ $e^x$ is summed over all values in the interval $[0,1]$. 
Am I right to say that $$\sum_{x \in [0,1]} e^x = \int^{x=1}_{x=0} e^x \, \mathrm dx?$$

REPLY [30 votes]: Since nobody has wrote about this yet, let me mention that this sum indeed represents an integral, but not the integral you thought of. Namely, for any set $X$ and any function $f:X\to\Bbb R$
$$
  \sum_{x\in X}f(x) = \int_Xf(x)\mu(\mathrm dx)
$$
where $\mu$ is the counting measure. In your case $X = [0,1]$, and you instead thought of integrating with a more natural Lebesgue measure $\lambda$ which is of course different from the counting one, so
$$
  \sum_{x\in[0,1]} f(x) = \int_{[0,1]}f(x)\mu(\mathrm dx)\neq \int_{[0,1]}f(x)\lambda(\mathrm dx)
$$
in general. In particular, the inequality does not hold for $f(x) = \exp (x)$ as other answers showed. 
In fact, both integrals only agree (being finite) if they both are zero. Indeed, if the counting integral is non-zero and finite, then $f$ takes only countably many non-zero values - but then the Lebesgue integral is zero. Vice-versa, if the Lebesgue integral is non-zero, then $f$ takes uncountably many values so that either the counting integral is undefined, or infinite.