Skip to main content
added 5 characters in body
Source Link
Iosif Pinelis
  • 127.9k
  • 8
  • 107
  • 229

$\newcommand{\vpi}{\varphi} \newcommand{\vp}{\varepsilon}$ We have \begin{align*} S_{n,s}&=\sum_{k\in \mathbb Z^{n}}\frac{1}{\Gamma(s/2)}\int_0^\infty u^{s/2-1} e^{-(1+|k|^2)u}\,du \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \sum_{k\in \mathbb Z^{n}}e^{-|k|^2u} \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \Big(\sum_{k\in \mathbb Z}e^{-k^2u}\Big)^n \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u}\, \vpi(u)^n, \end{align*} where $\vpi(u):=\vartheta_3(0,e^{-u})$ and $\vartheta_a(u,q)$ is the elliptic theta function.

So, instead of an $n$-fold sum, we now only need to compute an ordinary integral of a special function.


E.g., it takes the Mathematica command NSum[] 22 sec to output the value $12.6028$ for the double sum $S_{2,2.5}$ computed according to its definition. In comparison, it takes Mathematica command NIntegrate[] only 0.054 sec to output the value $12.6001$ for the integral expression of this double sum, and only 0.023 sec to output the value $22.0645$ for the integral expression of the triple sum $S_{3,3.5}$. (I have not attempted an evaluation of a triple sum using NSum[]. Even for $n=2$, I tend to believe NIntegrate[] more than NSum[], which latter lacks in accuracy and speed even for ordinary sums.)

Here is a copy of the corresponding Mathematica notebook:

enter image description here


Added: As pointed out in the comments and answer by Henri Cohen, the Mathematica calculations of the above integral expression for $S_{n,s}$ are probably faulty. This can be helped as follows. Note that the series \begin{equation} \vpi(u)=\sum_{k\in \mathbb Z}e^{-k^2u} \end{equation} converges very fast if $u>0$ is bounded away from $0$. In particular, for any natural $m$ and all $u\ge\pi$ \begin{equation} \vpi_m(u)<\vpi(u)<\vpi_m(u)(1+\vp_m), \end{equation} where \begin{equation} \vpi_m(u):=1+2\sum_{k=1}^{m-1}e^{-k^2u},\quad \vp_m:=\frac{2e^{-m^2\pi}}{1-e^{-5\pi}}<2.000001e^{-m^2\pi}; \end{equation} here we used the inequality $\sum_{k=m}^\infty e^{-k^2u}\le\sum_{k=m}^\infty e^{-k^2\pi}$ and bounded the latter sum by the sum of a geometric series.

Using the Jacobi identity $\vpi(u)=\pi^{1/2}u^{-1/2}\vpi(\pi^2/u)$ for $u>0$ (which is an instance of the Poisson summation formula), we now represent $\vpi(u)$ as the sum of a series that converges very fast if $u>0$ is bounded away from $\infty$. In particular, for any natural $m$ and all $u\in(0,\pi]$ \begin{equation} \pi^{1/2}u^{-1/2}\vpi_m(\pi^2/u)<\vpi(u)<\pi^{1/2}u^{-1/2}\vpi_m(\pi^2/u)(1+\vp_m). \end{equation}

Thus, \begin{equation} S_{m;n,s}<S_{n,s}<S_{m;n,s}(1+\vp_m), \tag{$\ast$} \end{equation} where \begin{align*} S_{m;n,s}&:=\frac{1}{\Gamma(s/2)}\,\int_\pi^\infty du\, u^{s/2-1}e^{-u}\vpi_m(u)^n \\ &+\frac{\pi^{n/2}}{\Gamma(s/2)}\,\int_0^\pi du\, u^{s/2-1-n/2}e^{-u}\vpi_m(\pi^2/u)^n, \end{align*} so that now we only have to integrate elementary functions.

E.g., using $(\ast)$ with $m=2$, in 0.014 sec we get the approximate value $12.602759835$ for $S_{2,2.5}$, which agrees with Henri Cohen's Pari/GP calculation.

$\newcommand{\vpi}{\varphi} \newcommand{\vp}{\varepsilon}$ We have \begin{align*} S_{n,s}&=\sum_{k\in \mathbb Z^{n}}\frac{1}{\Gamma(s/2)}\int_0^\infty u^{s/2-1} e^{-(1+|k|^2)u}\,du \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \sum_{k\in \mathbb Z^{n}}e^{-|k|^2u} \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \Big(\sum_{k\in \mathbb Z}e^{-k^2u}\Big)^n \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u}\, \vpi(u)^n, \end{align*} where $\vpi(u):=\vartheta_3(0,e^{-u})$ and $\vartheta_a(u,q)$ is the elliptic theta function.

So, instead of an $n$-fold sum, we now only need to compute an ordinary integral of a special function.


E.g., it takes the Mathematica command NSum[] 22 sec to output the value $12.6028$ for the double sum $S_{2,2.5}$ computed according to its definition. In comparison, it takes Mathematica command NIntegrate[] only 0.054 sec to output the value $12.6001$ for the integral expression of this double sum, and only 0.023 sec to output the value $22.0645$ for the integral expression of the triple sum $S_{3,3.5}$. (I have not attempted an evaluation of a triple sum using NSum[]. Even for $n=2$, I tend to believe NIntegrate[] more than NSum[], which latter lacks in accuracy and speed even for ordinary sums.)

Here is a copy of the corresponding Mathematica notebook:

enter image description here


Added: As pointed out in the comments and answer by Henri Cohen, the Mathematica calculations of the above integral expression for $S_{n,s}$ are probably faulty. This can be helped as follows. Note that the series \begin{equation} \vpi(u)=\sum_{k\in \mathbb Z}e^{-k^2u} \end{equation} converges very fast if $u>0$ is bounded away from $0$. In particular, for any natural $m$ and all $u\ge\pi$ \begin{equation} \vpi_m(u)<\vpi(u)<\vpi_m(u)(1+\vp_m), \end{equation} where \begin{equation} \vpi_m(u):=1+2\sum_{k=1}^{m-1}e^{-k^2u},\quad \vp_m:=\frac{2e^{-m^2\pi}}{1-e^{-5\pi}}<2.000001e^{-m^2\pi}; \end{equation} here we used the inequality $\sum_{k=m}^\infty e^{-k^2u}\le\sum_{k=m}^\infty e^{-k^2\pi}$ and bounded the latter sum by the sum of a geometric series.

Using the Jacobi identity $\vpi(u)=\pi^{1/2}u^{-1/2}\vpi(\pi^2/u)$ for $u>0$ (which is an instance of Poisson summation formula), we now represent $\vpi(u)$ as the sum of a series that converges very fast if $u>0$ is bounded away from $\infty$. In particular, for any natural $m$ and all $u\in(0,\pi]$ \begin{equation} \pi^{1/2}u^{-1/2}\vpi_m(\pi^2/u)<\vpi(u)<\pi^{1/2}u^{-1/2}\vpi_m(\pi^2/u)(1+\vp_m). \end{equation}

Thus, \begin{equation} S_{m;n,s}<S_{n,s}<S_{m;n,s}(1+\vp_m), \tag{$\ast$} \end{equation} where \begin{align*} S_{m;n,s}&:=\frac{1}{\Gamma(s/2)}\,\int_\pi^\infty du\, u^{s/2-1}e^{-u}\vpi_m(u)^n \\ &+\frac{\pi^{n/2}}{\Gamma(s/2)}\,\int_0^\pi du\, u^{s/2-1-n/2}e^{-u}\vpi_m(\pi^2/u)^n, \end{align*} so that now we only have to integrate elementary functions.

E.g., using $(\ast)$ with $m=2$, in 0.014 sec we get the approximate value $12.602759835$ for $S_{2,2.5}$, which agrees with Henri Cohen's Pari/GP calculation.

$\newcommand{\vpi}{\varphi} \newcommand{\vp}{\varepsilon}$ We have \begin{align*} S_{n,s}&=\sum_{k\in \mathbb Z^{n}}\frac{1}{\Gamma(s/2)}\int_0^\infty u^{s/2-1} e^{-(1+|k|^2)u}\,du \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \sum_{k\in \mathbb Z^{n}}e^{-|k|^2u} \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \Big(\sum_{k\in \mathbb Z}e^{-k^2u}\Big)^n \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u}\, \vpi(u)^n, \end{align*} where $\vpi(u):=\vartheta_3(0,e^{-u})$ and $\vartheta_a(u,q)$ is the elliptic theta function.

So, instead of an $n$-fold sum, we now only need to compute an ordinary integral of a special function.


E.g., it takes the Mathematica command NSum[] 22 sec to output the value $12.6028$ for the double sum $S_{2,2.5}$ computed according to its definition. In comparison, it takes Mathematica command NIntegrate[] only 0.054 sec to output the value $12.6001$ for the integral expression of this double sum, and only 0.023 sec to output the value $22.0645$ for the integral expression of the triple sum $S_{3,3.5}$. (I have not attempted an evaluation of a triple sum using NSum[]. Even for $n=2$, I tend to believe NIntegrate[] more than NSum[], which latter lacks in accuracy and speed even for ordinary sums.)

Here is a copy of the corresponding Mathematica notebook:

enter image description here


Added: As pointed out in the comments and answer by Henri Cohen, the Mathematica calculations of the above integral expression for $S_{n,s}$ are probably faulty. This can be helped as follows. Note that the series \begin{equation} \vpi(u)=\sum_{k\in \mathbb Z}e^{-k^2u} \end{equation} converges very fast if $u>0$ is bounded away from $0$. In particular, for any natural $m$ and all $u\ge\pi$ \begin{equation} \vpi_m(u)<\vpi(u)<\vpi_m(u)(1+\vp_m), \end{equation} where \begin{equation} \vpi_m(u):=1+2\sum_{k=1}^{m-1}e^{-k^2u},\quad \vp_m:=\frac{2e^{-m^2\pi}}{1-e^{-5\pi}}<2.000001e^{-m^2\pi}; \end{equation} here we used the inequality $\sum_{k=m}^\infty e^{-k^2u}\le\sum_{k=m}^\infty e^{-k^2\pi}$ and bounded the latter sum by the sum of a geometric series.

Using the Jacobi identity $\vpi(u)=\pi^{1/2}u^{-1/2}\vpi(\pi^2/u)$ for $u>0$ (which is an instance of the Poisson summation formula), we now represent $\vpi(u)$ as the sum of a series that converges very fast if $u>0$ is bounded away from $\infty$. In particular, for any natural $m$ and all $u\in(0,\pi]$ \begin{equation} \pi^{1/2}u^{-1/2}\vpi_m(\pi^2/u)<\vpi(u)<\pi^{1/2}u^{-1/2}\vpi_m(\pi^2/u)(1+\vp_m). \end{equation}

Thus, \begin{equation} S_{m;n,s}<S_{n,s}<S_{m;n,s}(1+\vp_m), \tag{$\ast$} \end{equation} where \begin{align*} S_{m;n,s}&:=\frac{1}{\Gamma(s/2)}\,\int_\pi^\infty du\, u^{s/2-1}e^{-u}\vpi_m(u)^n \\ &+\frac{\pi^{n/2}}{\Gamma(s/2)}\,\int_0^\pi du\, u^{s/2-1-n/2}e^{-u}\vpi_m(\pi^2/u)^n, \end{align*} so that now we only have to integrate elementary functions.

E.g., using $(\ast)$ with $m=2$, in 0.014 sec we get the approximate value $12.602759835$ for $S_{2,2.5}$, which agrees with Henri Cohen's Pari/GP calculation.

deleted 2 characters in body
Source Link
Iosif Pinelis
  • 127.9k
  • 8
  • 107
  • 229

$\newcommand{\vpi}{\varphi} \newcommand{\vp}{\varepsilon}$ We have \begin{align*} S_{n,s}&=\sum_{k\in \mathbb Z^{n}}\frac{1}{\Gamma(s/2)}\int_0^\infty u^{s/2-1} e^{-(1+|k|^2)u}\,du \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \sum_{k\in \mathbb Z^{n}}e^{-|k|^2u} \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \Big(\sum_{k\in \mathbb Z}e^{-k^2u}\Big)^n \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u}\, \vpi(u)^n, \end{align*} where $\vpi(u):=\vartheta_3(0,e^{-u})$ and $\vartheta_a(u,q)$ is the elliptic theta function.

So, instead of an $n$-fold sum, we now only need to compute an ordinary integral of a special function.


E.g., it takes the Mathematica command NSum[] 22 sec to output the value $12.6028$ for the double sum $S_{2,2.5}$ computed according to its definition. In comparison, it takes Mathematica command NIntegrate[] only 0.054 sec to output the value $12.6001$ for the integral expression of this double sum, and only 0.023 sec to output the value $22.0645$ for the integral expression of the triple sum $S_{3,3.5}$. (I have not attempted an evaluation of a triple sum using NSum[]. Even for $n=2$, I tend to believe NIntegrate[] more than NSum[], which latter lacks in accuracy and speed even for ordinary sums.)

Here is a copy of the corresponding Mathematica notebook:

enter image description here


Added: As pointed out in the comments and answer by Henri Cohen, the Mathematica calculations of the above integral expression for $S_{n,s}$ are probably faulty. This can be helped as follows. Note that the series \begin{equation} \vpi(u)=\sum_{k\in \mathbb Z}e^{-k^2u} \end{equation} converges very fast if $u>0$ is bounded away from $0$. In particular, for any natural $m$ and all $u\ge\pi$ \begin{equation} \vpi_m(u)<\vpi(u)<\vpi_m(u)(1+\vp_m), \end{equation} where \begin{equation} \vpi_m(u):=1+2\sum_{k=1}^{m-1}e^{-k^2u},\quad \vp_m:=\frac{2e^{-m^2\pi}}{1-e^{-5\pi}}<2.000001e^{-m^2\pi}; \end{equation} here we used the inequality $\sum_{k=m}^\infty e^{-k^2u}\le\sum_{k=m}^\infty e^{-k^2\pi}$ and bounded the latter sum by the sum of a geometric series.

Using the Jacobi identity $\vpi(u)=\pi^{1/2}u^{-1/2}\vpi(\pi^2/u)$ for $u>0$ (which is an instance of Poisson summation formula), we now represent $\vpi(u)$ as the sum of a series that converges very fast if $u>0$ is bounded away from $\infty$. In particular, for any natural $m$ and all $u\in(0,\pi]$ \begin{equation} \pi^{1/2}u^{-1/2}\vpi_m(\pi^2/u)<\vpi(u)<\pi^{1/2}u^{-1/2}\vpi_m(\pi^2/u)(1+\vp_m). \end{equation}

Thus, \begin{equation} S_{m;n,s}<S_{n,s}<S_{m;n,s}(1+\vp_m), \tag{$\ast$} \end{equation} where \begin{align*} S_{m;n,s}&:=\frac{1}{\Gamma(s/2)}\,\int_\pi^\infty du\, u^{s/2-1}e^{-u}\vpi_m(u)^n \\ &+\frac{\pi^{n/2}}{\Gamma(s/2)}\,\int_0^\pi du\, u^{s/2-1-n/2}e^{-u}\vpi_m(\pi^2/u)^n, \end{align*} so that now we only have to integrate elementary functions.

E.g., using $(\ast)$ with $m=2$, in $0.014$0.014 sec we get the approximate value $12.602759835$ for $S_{2,2.5}$, which agrees with Henri Cohen's Pari/GP calculation.

$\newcommand{\vpi}{\varphi} \newcommand{\vp}{\varepsilon}$ We have \begin{align*} S_{n,s}&=\sum_{k\in \mathbb Z^{n}}\frac{1}{\Gamma(s/2)}\int_0^\infty u^{s/2-1} e^{-(1+|k|^2)u}\,du \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \sum_{k\in \mathbb Z^{n}}e^{-|k|^2u} \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \Big(\sum_{k\in \mathbb Z}e^{-k^2u}\Big)^n \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u}\, \vpi(u)^n, \end{align*} where $\vpi(u):=\vartheta_3(0,e^{-u})$ and $\vartheta_a(u,q)$ is the elliptic theta function.

So, instead of an $n$-fold sum, we now only need to compute an ordinary integral of a special function.


E.g., it takes the Mathematica command NSum[] 22 sec to output the value $12.6028$ for the double sum $S_{2,2.5}$ computed according to its definition. In comparison, it takes Mathematica command NIntegrate[] only 0.054 sec to output the value $12.6001$ for the integral expression of this double sum, and only 0.023 sec to output the value $22.0645$ for the integral expression of the triple sum $S_{3,3.5}$. (I have not attempted an evaluation of a triple sum using NSum[]. Even for $n=2$, I tend to believe NIntegrate[] more than NSum[], which latter lacks in accuracy and speed even for ordinary sums.)

Here is a copy of the corresponding Mathematica notebook:

enter image description here


Added: As pointed out in the comments and answer by Henri Cohen, the Mathematica calculations of the above integral expression for $S_{n,s}$ are probably faulty. This can be helped as follows. Note that the series \begin{equation} \vpi(u)=\sum_{k\in \mathbb Z}e^{-k^2u} \end{equation} converges very fast if $u>0$ is bounded away from $0$. In particular, for any natural $m$ and all $u\ge\pi$ \begin{equation} \vpi_m(u)<\vpi(u)<\vpi_m(u)(1+\vp_m), \end{equation} where \begin{equation} \vpi_m(u):=1+2\sum_{k=1}^{m-1}e^{-k^2u},\quad \vp_m:=\frac{2e^{-m^2\pi}}{1-e^{-5\pi}}<2.000001e^{-m^2\pi}; \end{equation} here we used the inequality $\sum_{k=m}^\infty e^{-k^2u}\le\sum_{k=m}^\infty e^{-k^2\pi}$ and bounded the latter sum by the sum of a geometric series.

Using the Jacobi identity $\vpi(u)=\pi^{1/2}u^{-1/2}\vpi(\pi^2/u)$ for $u>0$ (which is an instance of Poisson summation formula), we now represent $\vpi(u)$ as the sum of a series that converges very fast if $u>0$ is bounded away from $\infty$. In particular, for any natural $m$ and all $u\in(0,\pi]$ \begin{equation} \pi^{1/2}u^{-1/2}\vpi_m(\pi^2/u)<\vpi(u)<\pi^{1/2}u^{-1/2}\vpi_m(\pi^2/u)(1+\vp_m). \end{equation}

Thus, \begin{equation} S_{m;n,s}<S_{n,s}<S_{m;n,s}(1+\vp_m), \tag{$\ast$} \end{equation} where \begin{align*} S_{m;n,s}&:=\frac{1}{\Gamma(s/2)}\,\int_\pi^\infty du\, u^{s/2-1}e^{-u}\vpi_m(u)^n \\ &+\frac{\pi^{n/2}}{\Gamma(s/2)}\,\int_0^\pi du\, u^{s/2-1-n/2}e^{-u}\vpi_m(\pi^2/u)^n, \end{align*} so that now we only have to integrate elementary functions.

E.g., using $(\ast)$ with $m=2$, in $0.014$ sec we get the approximate value $12.602759835$ for $S_{2,2.5}$, which agrees with Henri Cohen's Pari/GP calculation.

$\newcommand{\vpi}{\varphi} \newcommand{\vp}{\varepsilon}$ We have \begin{align*} S_{n,s}&=\sum_{k\in \mathbb Z^{n}}\frac{1}{\Gamma(s/2)}\int_0^\infty u^{s/2-1} e^{-(1+|k|^2)u}\,du \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \sum_{k\in \mathbb Z^{n}}e^{-|k|^2u} \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \Big(\sum_{k\in \mathbb Z}e^{-k^2u}\Big)^n \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u}\, \vpi(u)^n, \end{align*} where $\vpi(u):=\vartheta_3(0,e^{-u})$ and $\vartheta_a(u,q)$ is the elliptic theta function.

So, instead of an $n$-fold sum, we now only need to compute an ordinary integral of a special function.


E.g., it takes the Mathematica command NSum[] 22 sec to output the value $12.6028$ for the double sum $S_{2,2.5}$ computed according to its definition. In comparison, it takes Mathematica command NIntegrate[] only 0.054 sec to output the value $12.6001$ for the integral expression of this double sum, and only 0.023 sec to output the value $22.0645$ for the integral expression of the triple sum $S_{3,3.5}$. (I have not attempted an evaluation of a triple sum using NSum[]. Even for $n=2$, I tend to believe NIntegrate[] more than NSum[], which latter lacks in accuracy and speed even for ordinary sums.)

Here is a copy of the corresponding Mathematica notebook:

enter image description here


Added: As pointed out in the comments and answer by Henri Cohen, the Mathematica calculations of the above integral expression for $S_{n,s}$ are probably faulty. This can be helped as follows. Note that the series \begin{equation} \vpi(u)=\sum_{k\in \mathbb Z}e^{-k^2u} \end{equation} converges very fast if $u>0$ is bounded away from $0$. In particular, for any natural $m$ and all $u\ge\pi$ \begin{equation} \vpi_m(u)<\vpi(u)<\vpi_m(u)(1+\vp_m), \end{equation} where \begin{equation} \vpi_m(u):=1+2\sum_{k=1}^{m-1}e^{-k^2u},\quad \vp_m:=\frac{2e^{-m^2\pi}}{1-e^{-5\pi}}<2.000001e^{-m^2\pi}; \end{equation} here we used the inequality $\sum_{k=m}^\infty e^{-k^2u}\le\sum_{k=m}^\infty e^{-k^2\pi}$ and bounded the latter sum by the sum of a geometric series.

Using the Jacobi identity $\vpi(u)=\pi^{1/2}u^{-1/2}\vpi(\pi^2/u)$ for $u>0$ (which is an instance of Poisson summation formula), we now represent $\vpi(u)$ as the sum of a series that converges very fast if $u>0$ is bounded away from $\infty$. In particular, for any natural $m$ and all $u\in(0,\pi]$ \begin{equation} \pi^{1/2}u^{-1/2}\vpi_m(\pi^2/u)<\vpi(u)<\pi^{1/2}u^{-1/2}\vpi_m(\pi^2/u)(1+\vp_m). \end{equation}

Thus, \begin{equation} S_{m;n,s}<S_{n,s}<S_{m;n,s}(1+\vp_m), \tag{$\ast$} \end{equation} where \begin{align*} S_{m;n,s}&:=\frac{1}{\Gamma(s/2)}\,\int_\pi^\infty du\, u^{s/2-1}e^{-u}\vpi_m(u)^n \\ &+\frac{\pi^{n/2}}{\Gamma(s/2)}\,\int_0^\pi du\, u^{s/2-1-n/2}e^{-u}\vpi_m(\pi^2/u)^n, \end{align*} so that now we only have to integrate elementary functions.

E.g., using $(\ast)$ with $m=2$, in 0.014 sec we get the approximate value $12.602759835$ for $S_{2,2.5}$, which agrees with Henri Cohen's Pari/GP calculation.

added 1931 characters in body
Source Link
Iosif Pinelis
  • 127.9k
  • 8
  • 107
  • 229

We$\newcommand{\vpi}{\varphi} \newcommand{\vp}{\varepsilon}$ We have \begin{align*} S_{n,s}&=\sum_{k\in \mathbb Z^{n}}\frac{1}{\Gamma(s/2)}\int_0^\infty u^{s/2-1} e^{-(1+|k|^2)u}\,du \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \sum_{k\in \mathbb Z^{n}}e^{-|k|^2u} \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \Big(\sum_{k\in \mathbb Z}e^{-k^2u}\Big)^n \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u}\, \vartheta_3(0,e^{-u})^n, \end{align*}\begin{align*} S_{n,s}&=\sum_{k\in \mathbb Z^{n}}\frac{1}{\Gamma(s/2)}\int_0^\infty u^{s/2-1} e^{-(1+|k|^2)u}\,du \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \sum_{k\in \mathbb Z^{n}}e^{-|k|^2u} \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \Big(\sum_{k\in \mathbb Z}e^{-k^2u}\Big)^n \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u}\, \vpi(u)^n, \end{align*} where $\vpi(u):=\vartheta_3(0,e^{-u})$ and $\vartheta_a(u,q)$ is the elliptic theta function.

So, instead of an $n$-fold sum, we now only need to compute an ordinary integral of a special function.


E.g., it takes the Mathematica command NSum[] 22 sec to output the value $12.6028$ for the double sum $S_{2,2.5}$ computed according to its definition. In comparison, it takes Mathematica command NIntegrate[] only 0.054 sec to output the value $12.6001$ for the integral expression of this double sum, and only 0.023 sec to output the value $22.0645$ for the integral expression of the triple sum $S_{3,3.5}$. (I have not attempted an evaluation of a triple sum using NSum[]. Even for $n=2$, I tend to believe NIntegrate[] more than NSum[], which latter lacks in accuracy and speed even for ordinary sums.)

Here is a copy of the corresponding Mathematica notebook:

enter image description here


Added: As pointed out in the comments and answer by Henri Cohen, the Mathematica calculations of the above integral expression for $S_{n,s}$ are probably faulty. This can be helped as follows. Note that the series \begin{equation} \vpi(u)=\sum_{k\in \mathbb Z}e^{-k^2u} \end{equation} converges very fast if $u>0$ is bounded away from $0$. In particular, for any natural $m$ and all $u\ge\pi$ \begin{equation} \vpi_m(u)<\vpi(u)<\vpi_m(u)(1+\vp_m), \end{equation} where \begin{equation} \vpi_m(u):=1+2\sum_{k=1}^{m-1}e^{-k^2u},\quad \vp_m:=\frac{2e^{-m^2\pi}}{1-e^{-5\pi}}<2.000001e^{-m^2\pi}; \end{equation} here we used the inequality $\sum_{k=m}^\infty e^{-k^2u}\le\sum_{k=m}^\infty e^{-k^2\pi}$ and bounded the latter sum by the sum of a geometric series.

Using the Jacobi identity $\vpi(u)=\pi^{1/2}u^{-1/2}\vpi(\pi^2/u)$ for $u>0$ (which is an instance of Poisson summation formula), we now represent $\vpi(u)$ as the sum of a series that converges very fast if $u>0$ is bounded away from $\infty$. In particular, for any natural $m$ and all $u\in(0,\pi]$ \begin{equation} \pi^{1/2}u^{-1/2}\vpi_m(\pi^2/u)<\vpi(u)<\pi^{1/2}u^{-1/2}\vpi_m(\pi^2/u)(1+\vp_m). \end{equation}

Thus, \begin{equation} S_{m;n,s}<S_{n,s}<S_{m;n,s}(1+\vp_m), \tag{$\ast$} \end{equation} where \begin{align*} S_{m;n,s}&:=\frac{1}{\Gamma(s/2)}\,\int_\pi^\infty du\, u^{s/2-1}e^{-u}\vpi_m(u)^n \\ &+\frac{\pi^{n/2}}{\Gamma(s/2)}\,\int_0^\pi du\, u^{s/2-1-n/2}e^{-u}\vpi_m(\pi^2/u)^n, \end{align*} so that now we only have to integrate elementary functions.

E.g., using $(\ast)$ with $m=2$, in $0.014$ sec we get the approximate value $12.602759835$ for $S_{2,2.5}$, which agrees with Henri Cohen's Pari/GP calculation.

We have \begin{align*} S_{n,s}&=\sum_{k\in \mathbb Z^{n}}\frac{1}{\Gamma(s/2)}\int_0^\infty u^{s/2-1} e^{-(1+|k|^2)u}\,du \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \sum_{k\in \mathbb Z^{n}}e^{-|k|^2u} \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \Big(\sum_{k\in \mathbb Z}e^{-k^2u}\Big)^n \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u}\, \vartheta_3(0,e^{-u})^n, \end{align*} where $\vartheta_a(u,q)$ is the elliptic theta function.

So, instead of an $n$-fold sum, we now only need to compute an ordinary integral of a special function.


E.g., it takes the Mathematica command NSum[] 22 sec to output the value $12.6028$ for the double sum $S_{2,2.5}$ computed according to its definition. In comparison, it takes Mathematica command NIntegrate[] only 0.054 sec to output the value $12.6001$ for the integral expression of this double sum, and only 0.023 sec to output the value $22.0645$ for the integral expression of the triple sum $S_{3,3.5}$. (I have not attempted an evaluation of a triple sum using NSum[]. Even for $n=2$, I tend to believe NIntegrate[] more than NSum[], which latter lacks in accuracy and speed even for ordinary sums.)

Here is a copy of the corresponding Mathematica notebook:

enter image description here

$\newcommand{\vpi}{\varphi} \newcommand{\vp}{\varepsilon}$ We have \begin{align*} S_{n,s}&=\sum_{k\in \mathbb Z^{n}}\frac{1}{\Gamma(s/2)}\int_0^\infty u^{s/2-1} e^{-(1+|k|^2)u}\,du \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \sum_{k\in \mathbb Z^{n}}e^{-|k|^2u} \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u} \Big(\sum_{k\in \mathbb Z}e^{-k^2u}\Big)^n \\ &=\frac{1}{\Gamma(s/2)}\,\int_0^\infty du\, u^{s/2-1}e^{-u}\, \vpi(u)^n, \end{align*} where $\vpi(u):=\vartheta_3(0,e^{-u})$ and $\vartheta_a(u,q)$ is the elliptic theta function.

So, instead of an $n$-fold sum, we now only need to compute an ordinary integral of a special function.


E.g., it takes the Mathematica command NSum[] 22 sec to output the value $12.6028$ for the double sum $S_{2,2.5}$ computed according to its definition. In comparison, it takes Mathematica command NIntegrate[] only 0.054 sec to output the value $12.6001$ for the integral expression of this double sum, and only 0.023 sec to output the value $22.0645$ for the integral expression of the triple sum $S_{3,3.5}$. (I have not attempted an evaluation of a triple sum using NSum[]. Even for $n=2$, I tend to believe NIntegrate[] more than NSum[], which latter lacks in accuracy and speed even for ordinary sums.)

Here is a copy of the corresponding Mathematica notebook:

enter image description here


Added: As pointed out in the comments and answer by Henri Cohen, the Mathematica calculations of the above integral expression for $S_{n,s}$ are probably faulty. This can be helped as follows. Note that the series \begin{equation} \vpi(u)=\sum_{k\in \mathbb Z}e^{-k^2u} \end{equation} converges very fast if $u>0$ is bounded away from $0$. In particular, for any natural $m$ and all $u\ge\pi$ \begin{equation} \vpi_m(u)<\vpi(u)<\vpi_m(u)(1+\vp_m), \end{equation} where \begin{equation} \vpi_m(u):=1+2\sum_{k=1}^{m-1}e^{-k^2u},\quad \vp_m:=\frac{2e^{-m^2\pi}}{1-e^{-5\pi}}<2.000001e^{-m^2\pi}; \end{equation} here we used the inequality $\sum_{k=m}^\infty e^{-k^2u}\le\sum_{k=m}^\infty e^{-k^2\pi}$ and bounded the latter sum by the sum of a geometric series.

Using the Jacobi identity $\vpi(u)=\pi^{1/2}u^{-1/2}\vpi(\pi^2/u)$ for $u>0$ (which is an instance of Poisson summation formula), we now represent $\vpi(u)$ as the sum of a series that converges very fast if $u>0$ is bounded away from $\infty$. In particular, for any natural $m$ and all $u\in(0,\pi]$ \begin{equation} \pi^{1/2}u^{-1/2}\vpi_m(\pi^2/u)<\vpi(u)<\pi^{1/2}u^{-1/2}\vpi_m(\pi^2/u)(1+\vp_m). \end{equation}

Thus, \begin{equation} S_{m;n,s}<S_{n,s}<S_{m;n,s}(1+\vp_m), \tag{$\ast$} \end{equation} where \begin{align*} S_{m;n,s}&:=\frac{1}{\Gamma(s/2)}\,\int_\pi^\infty du\, u^{s/2-1}e^{-u}\vpi_m(u)^n \\ &+\frac{\pi^{n/2}}{\Gamma(s/2)}\,\int_0^\pi du\, u^{s/2-1-n/2}e^{-u}\vpi_m(\pi^2/u)^n, \end{align*} so that now we only have to integrate elementary functions.

E.g., using $(\ast)$ with $m=2$, in $0.014$ sec we get the approximate value $12.602759835$ for $S_{2,2.5}$, which agrees with Henri Cohen's Pari/GP calculation.

added 7 characters in body
Source Link
Iosif Pinelis
  • 127.9k
  • 8
  • 107
  • 229
Loading
added 871 characters in body
Source Link
Iosif Pinelis
  • 127.9k
  • 8
  • 107
  • 229
Loading
Source Link
Iosif Pinelis
  • 127.9k
  • 8
  • 107
  • 229
Loading