0
$\begingroup$

I was wonder through my self-study of physics if there is a consistent way of converting sum to integrals, because it seems all tricks for me. For instance, the simplest case is the riemann sum but sometimes, it is not possible to sum into form. For instance, in statistical mechanics, where you need to define the canonical partition function for an ideal gas, you come across $$q_x=\sum_{l_x=0}^{\infty} e^{-\Delta l_x^2}$$ where $\Delta$ is $O(10^{-17})$ results in somehow the summation becoming an integral. I don't however see the formulation as being multiplications of two terms such as $$\lim_{n->\infty} \sum f(x)\,\Delta x = \int_0^\infty f(x) \;\text{dx}$$ from my reading, it seems possible to use Euler-Maclaurin, but it results in $$q_x= \int_0^\infty e^{-\Delta x^2} x^2 \text{dx}$$ which doesn't include the correction terms from Euler-maclaurin such as f(a) even if you assume zero for the remaining

$$\displaylines{\sum_{k=a}^b f(k) \approx \int_a^b f(x) \, dx + \frac{f(a) + f(b)}{2} + \sum_{n=1}^\infty \frac{B_{2n}}{(2n)!} \left( f^{(2n-1)}(b) - f^{(2n-1)}(a) \right)}$$

Overall, my question is there an approach that allows you to convert any summation to an integral?

edit:corrected q_x expression

$\endgroup$
6
  • 1
    $\begingroup$ I think your expression for $q_x$ as an integral is missing something, because otherwise $e^{-\Delta}$ is constant and the integral diverges. $\endgroup$ Commented May 23 at 1:47
  • $\begingroup$ thanks for hte note, just made the correction, i missed the $l_x^2$ as $x^2$ $\endgroup$ Commented May 23 at 2:14
  • $\begingroup$ I imagine the integral should then be $\int_0^\infty e^{-\Delta x^2} \, \mathrm{d}x$? Otherwise, the sum and integral are not even close to the same size. $\endgroup$ Commented May 23 at 3:00
  • $\begingroup$ "if there is a consistent way of converting sum to integrals, because it seems all tricks for me. For instance, the simplest case is the riemann sum" : based on "Calculus" Vol 1, 2nd Ed. (Tom Apostol 1966), $~\displaystyle \int_a^b f(x) ~dx ~$ is represented by reimann sums of form either $~\displaystyle \int_a^b s(x) ~dx ~$ or $~\displaystyle \int_a^b t(x) ~dx. ~$ ...see next comment $\endgroup$ Commented May 23 at 3:13
  • $\begingroup$ Assuming that $~s(x), ~t(x), ~$ are step functions that are based on the same partition $~a = x_0 < x_1 < x_2 < \cdots, < x_n = b,~$ you have that for each open interval $~\left(x_k, x_{k+1} \right) ~: ~k \in \{0,1,\cdots, x_{n-1}\},~$ you have that both $~s(x)~$ and $~t(x)~$ are constant, with (typically) $~s(x) \leq f(x) \leq t(x)~$ on $~\left(x_k, x_{k+1} \right).~$ Note that per Apostol's definition of a (Reimann) sum, you have that the explicit values of $~s(k),~$ and $~t(k) ~: ~k \in \{0,1,\cdots,n\}~$ are irrelevant. $\endgroup$ Commented May 23 at 3:17

1 Answer 1

1
$\begingroup$

Note: I assume, as mentioned in a comment, that we are dealing with $\sum_{l_x=0}^\infty e^{\Delta l_x^2}$ and $\int_0^\infty e^{-\Delta x^2} \, \mathrm{d}x$.


So, the thing is, except in very special circumstances, you're correct in that most sums do not meaningfully correspond to integrals. However, I would make the argument that your expressions for $q_x$ aren't equal either! For $\Delta = 10^{-17}$, Wolfram suggests $$ \left| \sum_{n=0}^\infty e^{-\Delta n^2} - \int_0^\infty e^{-\Delta x^2} \, \mathrm{d}x \right| \approx \frac 1 2 $$ (Wolfram link)


Definition of the Riemann Integral:

I'm not sure how necessary this is, but I feel it might be worth going over nonetheless, just in case.

The definition for the Riemann integral is actually not as described, but a tad bit more involved. We say $$ \int_a^b f(x) \, \mathrm{d}x = I $$ if and only if:

  • For every $\varepsilon > 0$...
  • ...there exists a $\delta > 0$...
  • ...such that, if $P$ is a partition of $[a,b]$ with $\|P\| < \delta$...
  • ...and $\Xi$ is a collection of tag points in the subintervals induced by $P$...
  • ...then $|R(f,P,\Xi)-I| < \varepsilon$

Here:

  • $P$ being a partition means we take points $\{x_i\}_{i=0}^n$ such that $a = x_0 < x_1 < \cdots < x_n = b$.
  • The norm of $P$ is given by $\|P\| := \max |x_i - x_{i-1}|$
  • $\Xi$ being a collection of tag points $\{\xi\}_{i=1}^n$ means that $\xi_i \in [x_{i-1},x_i]$ for each $i$. (Some might say $P \cup \Xi$ is a "tagged partition.")
  • We then define the Riemann sum by $$ R(f,P,\Xi) := \sum_i f(\xi_i) \Delta x_i $$ and even write $$ \lim_{\|P\| \to 0} R(f,P,\Xi) =: \int_a^b f(x) \, \mathrm{d}x $$

Key Takeaway: Intuitively, what this means is that, as we add many, many points to the partition -- and as they get closer and closer together -- we can approximate the integral arbitrarily well. More precisely, if we know a precise error $\varepsilon$ we wish to achieve, there is a corresponding $\delta$ that the intervals can be no wider than.

What about $n\to \infty$?: That assumes a particular choice of partition, with equal spacing - say, $$ \Delta x = \frac{b-a}{n} \qquad x_i = a + i \Delta x $$ However, we can work more generally than that, and the general definition proves enlightening for this case.

Okay, but I have an integral with an infinite bound. The same definitions from Calculus II still hold: $$\begin{align*} \int_a^\infty f(x) \, \mathrm{d}x &:= \lim_{b \to +\infty} \int_a^b f(x) \, \mathrm{d}x \\ \int_{-\infty}^b f(x) \, \mathrm{d}x &:= \lim_{a \to -\infty} \int_a^b f(x) \, \mathrm{d}x \\ \int_{-\infty}^\infty f(x) \, \mathrm{d}x &:= \int_{-\infty}^c f(x) \, \mathrm{d}x + \int_c^\infty f(x) \, \mathrm{d}x \tag{for any $c \in \mathbb{R}$} \end{align*}$$

So, when "converting" $$ \sum_{n=0}^\infty e^{-\Delta n^2} \xrightarrow{\text{"converted into"}} \int_0^\infty e^{-\Delta x^2} \, \mathrm{d}x $$ we need to consider what integrals of the type $\int_0^b e^{-\Delta x^2} \, \mathrm{d}x$ might even look like. For that, converting into Riemann sums, we would have something of the type $$ \sum_i e^{-\Delta \xi_i^2} (x_{i+1}-x_i) $$ (Above, $\Delta$ is explicitly your constant, and not the difference operator.) Notice that if you chose your partition to be the nonnegative integers, and your tag points to be the left endpoints of those intervals, these precisely match the sum you want to estimate.


The Role of $\Delta$ Being Small:

... okay this is all well and good, and justifies already the use of the approximation $$ \sum_{n=0}^\infty f(n) \approx \int_0^\infty f(n) \, \mathrm{d}n $$ for appropriate $f$. However, this is a very, very crude approximation. For particularly ill-behaved $f$, you could have an error on each "integer-width rectangle" that you use in the sum roughly equal to the maximum of the function over that interval.

(This pulls back to "integrals are areas under curves": the above estimation uses rectangles of width $1$ in particular.)

For instance, a comparatively well-behaved function like $f(x) = e^{-10x} - e^{-1}$ gets a lot of leftover area:

enter image description here

(Generic version of this Desmos demo I made for my Calculus I students here.)

In fact, it is a known result that, via this "left endpoint estimation" rule, the Riemann sum $R(f,P,\Xi)$, with $P = \{x_i\}_{i=0}^n$ and $\Xi = \{x_i\}_{i=0}^{n-1}$, if $f$ is differentiable on $[a,b]$, then $$ \left| R(f,P,\Xi) - \int_a^b f(x) \, \mathrm{d}x \right| \le \frac{(b-a)^2}{2n} \sup_{x \in [a,b]} |f'(x)| $$ Let's apply that to an integral of the type $\int_0^b e^{-\Delta x^2} \, \mathrm{d}x$, with the left-endpoint estimation rule and partition points at the integers. Then $$ \left| R\left( e^{-\Delta x^2},P,\Xi \right) - \int_0^b e^{-\Delta x^2} \, \mathrm{d}x \right| \le \frac{(b-0)^2}{2b} \sup_{x \in [0,b]} \left|\frac{\mathrm{d}}{\mathrm{d}x}e^{-\Delta x^2} \right| = \frac b 2 \sup_{x \in [0,b]} \left|\frac{\mathrm{d}}{\mathrm{d}x}e^{-\Delta x^2} \right| $$ You can even show that, for $b$ sufficiently large, $$ \sup_{x \in [0,b]} \left|\frac{\mathrm{d}}{\mathrm{d}x}e^{-\Delta x^2} \right| = \sqrt{ \frac{2\Delta}{e} } $$ so $$ \left| R\left( e^{-\Delta x^2},P,\Xi \right) - \int_0^b e^{-\Delta x^2} \, \mathrm{d}x \right| \le \frac b 2\sqrt{ \frac{2\Delta}{e} } = \frac{ b \sqrt{\Delta }}{\sqrt{2e}} \tag{$\ast$} $$

Anecdote: Amusingly, plotting what Desmos considers the error, and the error bound, while the error bound is proportional to $\Delta^{1/2}$, the error itself seems to scale linearly.

enter image description here

This may be an artifact of the estimation methods used by Desmos, especially since $e^{-x^2}$ decays very fast. Not that it matters here, since we want $\Delta$ small. Here's a link to my demo.

The takeaway, then: why choose $\Delta$ to be small? Because then the error will be correspondingly quite small, with a suitable upper bound as given in $(\ast)$. Equality is unlikely to be achieved, but taking $\Delta$ this small presumably makes the error negligible, and integrals are usually easier to treat and handle in many situations.


In short, then: You cannot convert sums to integrals like this most of the time in any meaningful sense, but I believe that's not what we care about here: instead I believe what's at play is treating a sum as an integral, and choosing a very small parameter to create a very small error.

$\endgroup$
1
  • $\begingroup$ I obtained the same result for the error being 1/2, which is consistent with Euler-Maclaurin relationship if you only ignore the higher order term (It is actually correct since the higher order term is zero at both x=0,$\infty$. Although it is not the same, it is a good approximation! since the percentage error is what is negligable because the 1/2 is insignificant relative to the summation. Basically, the integral term is much larger than the correct of 1/2 $\endgroup$ Commented May 23 at 6:19

You must log in to answer this question.

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