5
$\begingroup$

I would like to plot the following function

$$ f(m)=-2 \sum_{k=0}^{\infty}\binom{1/2}{k} \left(2^{2(k-1)}-1\right)\zeta(2 (k-1))\left(m^2-\frac{1}{4}\right)^k $$

I am only interested in $m$ between 0 and 1. I can't plot it with infinity as an upper bound; it appears as an error message:

This computation has exceeded the time limit for your plan.

So I must truncate it. Would there be a way to plot the entire function?

Because then my function is not what I expect and I guess it is a consequence of not considering all the terms.

Here is my simple code for that:

Plot[-2Sum[Binomial[1/2, n](2^(2(n-1))-1) Zeta[2(n-1)] (m^2-1/4)^n, 
  {n, 0, 200}], {m, 0, 1}, PlotRange -> {0, 0.2}]
$\endgroup$

4 Answers 4

7
$\begingroup$

This is a tricky sum because for $m>\frac{1}{\sqrt{2}}$ we need analytic continuation or regularization to compute it.

A simplified version of the sum approximates $\zeta[2(k-1)]\approx 1$ and

$$ f(m)=-2\sum_{k=0}^{\infty}\binom{1/2}{k}\left(2^{2(k-1)}-1\right)\zeta\left[2(k-1)\right]\left(m^2-\frac14\right)^k\\ \approx-2\sum_{k=2}^{\infty}\binom{1/2}{k}\left(2^{2(k-1)}-1\right)\left(m^2-\frac14\right)^k\\ = \sqrt{4 m^2+3}-m-\frac{3}{2}. $$ The last step is only strictly correct when the exponential term is smaller than 1 in magnitude: $\left(2^{2k-1}-1\right)\left(m^2-\frac14\right)^k\approx\frac12\left(4m^2-1\right)^k$ and the sum only converges if $\left|4m^2-1\right|\le1$, meaning $|m|\le\frac{1}{\sqrt{2}}$. For larger $m$ the sum converges only after regularization.

You can see the effect of this in @UlrichNeumann's solution: for $m>\frac{1}{\sqrt{2}}$ explicit summing no longer works, and regularization is required.

However, I don't know how to use regularization in a numerical sum. Better ask at the math StackExchange.

update: numerical summing that works

Expand the Riemann ζ-function by its definition: $\zeta[2(n-1)]=\sum_{k=1}^{\infty}\frac{1}{k^{2(n-1)}}$, from which

$$ f(m)=-2\sum_{n=0}^{\infty}\binom{1/2}{n}\left(2^{2(n-1)}-1\right)\zeta\left[2(n-1)\right]\left(m^2-\frac14\right)^n\\ =-2\sum_{n=2}^{\infty}\binom{1/2}{n}\left(2^{2(n-1)}-1\right)\left(m^2-\frac14\right)^n\sum_{k=1}^{\infty}\frac{1}{k^{2(n-1)}} $$ (the lower limit on $n$ can be set to 2 because for $n=0$ and $n=1$ the summand is zero).

Interchange the order of summation: (this is the "renormalization step" that maybe some mathematicians will take issue with; but it works in practice) $$ f(m)=-2\sum_{k=1}^{\infty}\sum_{n=2}^{\infty}\binom{1/2}{n}\left(2^{2(n-1)}-1\right)\left(m^2-\frac14\right)^n\frac{1}{k^{2(n-1)}} $$ Now we can do the $n$-summation exactly:

f[m_, n_, k_] = -2 (-1 + 2^(2 (-1 + n))) (-(1/4) + m^2)^n Binomial[1/2, n] 1/k^(2 (n - 1));
f[m_, k_] = Assuming[0 < m < 1 && Element[k, PositiveIntegers], 
    Sum[f[m, n, k], {n, 2, ∞}] // FullSimplify]
(*    -(1/2) k (3 k + Sqrt[-1 + k^2 + 4 m^2] - 2 Sqrt[-1 + 4 k^2 + 4 m^2])    *)

This formulation is no longer divergent and can be summed numerically for any $m$:

f[m_] = Sum[f[m, k], {k, 1, 10^3}] // Expand;
Plot[f[m], {m, 0, 1}]

enter image description here

If you need more accuracy in the sum, I'd suggest using an asymptotic expansion of the summand for large $k$ and then summing that all the way to infinity:

f∞[m_, k_] = Series[f[m, k], {k, ∞, 10}] // Normal

$$ \frac{3 \left(4 m^2-1\right)^2}{64 k^2} -\frac{15\left(4 m^2-1\right)^3}{512 k^4} +\frac{315 \left(4 m^2-1\right)^4}{16384 k^6} -\frac{1785 \left(4 m^2-1\right)^5}{131072 k^8} +\frac{21483 \left(4 m^2-1\right)^6}{2097152 k^{10}} $$

With[{kmax = 10^3},
  f[m_] = Sum[f[m, k], {k, 1, kmax}] +
          Sum[f∞[m, k], {k, kmax + 1, ∞}] // Expand];

f[1/Sqrt[2]] // N
(*    0.057067155838012695    *)
$\endgroup$
10
  • $\begingroup$ In 14.1 on Windows Simplify[(Series[ Binomial[1/2, n] (2^(2 (n - 1)) - 1) Zeta[2 (n - 1)] (m^2 - 1/4)^ n, {n, Infinity, 1}] // Normal) /. Arg[-(1/2) + n] -> 0] results in $\frac{\left(4^n-4\right) e^{\frac{11}{24 n}} \left(m^2-\frac{1}{4}\right)^n \cos (\pi n)}{8 \sqrt{\pi } n^{3/2}}$, confiming the condition on $m$. $\endgroup$
    – user64494
    Commented Oct 31 at 20:17
  • $\begingroup$ @Roman SumConvergence[] confirms your expectation m<Sqrt[2], see my modified answer! $\endgroup$ Commented Oct 31 at 20:21
  • $\begingroup$ @UlrichNeumann: Abs[1/4 - m^2] < 1 && Abs[1 - 4 m^2] < 1 only partly confirms it, not including 0 and 1/Sqrt[2] and -1/Sqrt[2]. $\endgroup$
    – user64494
    Commented Oct 31 at 20:34
  • $\begingroup$ @user64494 No that isn't correct! Try Plot[Abs[1 - 4 m^2], {m, 0, 1}, RegionFunction -> Function[m, Abs[1 - 4 m^2] < 1]] $\endgroup$ Commented Oct 31 at 20:49
  • $\begingroup$ @UlrichNeumann: Substitute m==0/m==1/Sqrt[2]/-1/Sqrt[2] in Abs[1/4 - m^2] < 1 && Abs[1 - 4 m^2] < 1 or /and look at the result of Reduce[Abs[1/4 - m^2] < 1 && Abs[1 - 4 m^2] < 1,m,Reals]. $\endgroup$
    – user64494
    Commented Oct 31 at 21:01
4
$\begingroup$

Using: $$\zeta (n)=\int_0^{\infty } \frac{x^{-1+n}}{\left(-1+e^x\right) \Gamma (n)} \, dx$$

then:

$$\sum _{n=0}^{\infty } -2 \binom{\frac{1}{2}}{n} \left(2^{2 (n-1)}-1\right) \zeta (2 (n-1)) \left(m^2-\frac{1}{4}\right)^n=\\\sum _{n=0}^{\infty } -2 \binom{\frac{1}{2}}{n} \left(2^{2 (n-1)}-1\right) \int_0^{\infty } \frac{x^{-1+2 (-1+n)} \left(m^2-\frac{1}{4}\right)^n}{\left(-1+e^x\right) \Gamma (2 (-1+n))} \, dx=\\\int_0^{\infty } \left(\sum _{n=0}^{\infty } -\frac{2 \binom{\frac{1}{2}}{n} \left(2^{2 (n-1)}-1\right) x^{-1+2 (-1+n)} \left(m^2-\frac{1}{4}\right)^n}{\left(-1+e^x\right) \Gamma (2 (-1+n))}\right) \, dx=\\\int_0^{\infty } \frac{\left(-1+4 m^2\right) \left(I_2\left(\frac{1}{2} \sqrt{1-4 m^2} x\right)-I_2\left(\sqrt{1-4 m^2} x\right)\right)}{2 \left(-1+e^x\right) x} \, dx$$

f[m_?NumericQ] := -2 Sum[Binomial[1/2, n] (2^(2 (n - 1)) - 1) Zeta[2 (n - 1)] (m^2 - 1/4)^n, {n, 0, 200}]; 
f1[m_?NumericQ] := NIntegrate[((-1 + 4 m^2) (BesselI[2, 1/2 Sqrt[1 - 4 m^2] x] - BesselI[2, Sqrt[1 - 4 m^2] x]))/(2 (-1 + E^x) x), {x, 0, Infinity}] // Quiet
g[m_] = Sum[-(1/2) k (3 k + Sqrt[-1 + k^2 + 4 m^2] - 2 Sqrt[-1 + 4 k^2 + 4 m^2]), {k, 1, 10^2}];

Plot[{f[m], f1[m], g[m], Sqrt[4 m^2 + 3] - m - 3/2}, {m, 0, 1}, 
PlotRange -> {0, 0.3}, 
PlotLabels -> {"Ulrich Neumann solution", "My solution", 
"Roman Updated solution", "Roman approximate solution"}, 
PlotStyle -> {Red, {Dashed, Black}, {DotDashed, Blue}, Green}]

enter image description here

Addendum:

 $Version
 (*"14.1.0 for Microsoft Windows (64-bit) (July 16, 2024)"*)

 Sum[-2 Binomial[1/2, n] (2^(2 (n - 1)) - 1)*
 x^(-1 + 2 (-1 + n))/((-1 + E^x) Gamma[2 (-1 + n)])*(m^2 - 1/4)^
 n, {n, 0, Infinity}]

 (*((-1 + 4 m^2) (BesselI[2, 1/2 Sqrt[1 - 4 m^2] x] + 
 BesselJ[2, Sqrt[-1 + 2 m] Sqrt[1 + 2 m] x]))/(2 (-1 + E^x) x)*)
$\endgroup$
4
  • $\begingroup$ Interesting solution (+1) ! Have concerns about swapping the order of summation and integration, it is probably only permissible if the sum is convergent! $\endgroup$ Commented Nov 1 at 10:47
  • $\begingroup$ How did you find the sum-formula in your last Latex-line? Mathematica v12.2 doesn't evaluate! $\endgroup$ Commented Nov 1 at 10:49
  • $\begingroup$ @UlrichNeumann For second question see my updated. For first question wrong address. Your question is pure math. Ask that in math forums. Is this about Wolfram Mathematica or a math question? :P $\endgroup$ Commented Nov 1 at 11:10
  • $\begingroup$ Thanks!: I am also not a mathematician, only foggy memories let me to this first statement. By the way that might be the "proof" why our two solutions match in the convergence area! $\endgroup$ Commented Nov 1 at 13:12
4
$\begingroup$

To address the time issue, evaluate the sum once. Plot is reevaluating it at each point it plots.

poly = HornerForm[-2 Sum[
     Binomial[1/2, n] (2^(2 (n - 1)) - 1) Zeta[2 (n - 1)] x^n, {n, 0, 
      200}]];
Plot[
 Block[{x}, x = m^2 - 1/4; poly],
 {m, 0, 1}, PlotRange -> {0., 0.2}, PlotRangePadding -> Scaled[.02]]

Of course, you may prefer the mathematically complete solutions given in other answers. But the answer to the time problem you're facing in the cloud should be handled by the approach above and be useful knowledge to have about using Wolfram tech. Especially if one is interested in exploring the partial sums.

$\endgroup$
1
  • $\begingroup$ Four times faster than my answer (0.016s vs. 0.065s): coeff = -2 Table[Binomial[1/2, n] (2^(2 (n - 1)) - 1) Zeta[2 (n - 1)], {n, 0, 200}] // N; Plot[Block[{x}, x = (m^2 - 0.25)^Range[0., 200.]; coeff . x], {m, 0, 1}, PlotRange -> {0., 0.2}, PlotRangePadding -> Scaled[.02]] $\endgroup$
    – Michael E2
    Commented Nov 3 at 15:48
2
$\begingroup$

modified

Try

f[m_?NumericQ] := -2 Sum[
   Binomial[1/2, n] (2^(2 (n - 1)) - 1) Zeta[2 (n - 1)] (m^2 - 1/4)^
     n, {n, 0, 200}]
Plot[f[m], {m, 0, 1}, PlotRange -> {0, 0.2}]

enter image description here

addendum

Inspired by @Roman's comment we get

cond=SumConvergence[-2 Binomial[1/2, n] (2^(2 (n - 1)) - 1) Zeta[2 (n - 1)] (m^2 - 1/4)^n, n]
(*Abs[1/4 - m^2] < 1 && Abs[1 - 4 m^2] < 1*)

Reduce[RealAbs[1/4 - m^2] < 1 && RealAbs[1 - 4 m^2] < 1 && 0 < m <1]
 (*0 < m < 1/Sqrt[2]*)

in accordance with the plot

$\endgroup$
7
  • $\begingroup$ Right, this is what I got, but around 0.7 it is strange. I was expecting something more or less quadratic. $\endgroup$ Commented Oct 31 at 16:57
  • $\begingroup$ Unfortunately, Abs[1/4 - m^2] < 1 && Abs[1 - 4 m^2] < 1 does not include m==0 and m==1/Sqrt[2] and m==-1/Sqrt[2] where the series converges (see my comment to the @Roman's answer). $\endgroup$
    – user64494
    Commented Oct 31 at 20:32
  • $\begingroup$ @user64494 No that isn't correct! Try Plot[Abs[1 - 4 m^2], {m, 0, 1}, RegionFunction -> Function[m, Abs[1 - 4 m^2] < 1]] $\endgroup$ Commented Oct 31 at 20:52
  • $\begingroup$ Substitute m==0/m==1/Sqrt[2]/-1/Sqrt[2] in Abs[1/4 - m^2] < 1 && Abs[1 - 4 m^2] < 1 or /and look at the result of Reduce[Abs[1/4 - m^2] < 1 && Abs[1 - 4 m^2] < 1,m,Reals]. $\endgroup$
    – user64494
    Commented Oct 31 at 21:00
  • $\begingroup$ @user64494 Reduce gives incorrect result in v12.2, change Abs to RealAbs (see my answer) $\endgroup$ Commented Nov 1 at 8:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.