I want to find the closed form of:
$\displaystyle \tag*{} \sum \limits _{n=1}^{\infty}\frac{(-1)^n (H_{2n}-H_{n})}{n(2)^n \binom{2n}{n}}$
Where $H_{k}$ is $k^{\text{th}}$ harmonic number
Can anyone tell me the value of the sum using Mathematica?
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It only takes a minute to sign up.
Sign up to join this communityI want to find the closed form of:
$\displaystyle \tag*{} \sum \limits _{n=1}^{\infty}\frac{(-1)^n (H_{2n}-H_{n})}{n(2)^n \binom{2n}{n}}$
Where $H_{k}$ is $k^{\text{th}}$ harmonic number
Can anyone tell me the value of the sum using Mathematica?
Clear["Global`*"]
f[n_] := (-1)^
n (HarmonicNumber[2 n] - HarmonicNumber[n])/(n*2^n*Binomial[2 n, n])
The terms of the sum converge to zero rapidly
DiscretePlot[Abs[f[n]], {n, 1, 25},
ScalingFunctions -> "Log"]
The partial sums are
(tab = Join[
{{nmax, TraditionalForm@Inactive[Sum][f[n], {n, 1, nmax}]}},
Table[{nmax, Sum[f[n], {n, 1, nmax}]}, {nmax, 1, 28}] /.
r_Rational :> N[r, 25]]) //
Grid[#, Frame -> All] &
The partial sum expressed as a DifferenceRoot
is
psum[nmax_] = Sum[f[n], {n, 1, nmax}]
Using AskConstants
to identify a constant with this approximate numeric value
(sum = (Log[2]^2 - Pi^2/12)/3) // TraditionalForm
Checking,
Block[{$MaxExtraPrecision = 500},
Join[
{{nmax, TraditionalForm[sum - Inactive[Sum][f[n], {n, 1, nmax}]]}},
Table[{nmax, N[sum - Sum[f[n], {n, 1, nmax}], nmax + 20] // N},
{nmax, 20, 200, 20}]] // Grid[#, Frame -> All] &]
EDIT: An alternate approach
(sum2 = FullSimplify@
Total[Sum[#, {n, 1, Infinity}] & /@
Assuming[n ∈ PositiveIntegers,
(List @@ (f[n] // FunctionExpand // Simplify //
Expand))]]) // TraditionalForm
N[sum2, 20]
(* -0.11400467316863726452 *)
Checking that sum
and sum2
are equivalent
Block[{$MaxExtraPrecision = 500},
N[sum - sum2, 200]]
(* N::meprec: Internal precision limit $MaxExtraPrecision = 500.` reached while evaluating 1/3 (-(π^2/12)+Log[2]^2)+1/72 (7 π^2-3 (9 Log[<<1>>]^2+8 PolyLog[2,Power[<<2>>]]-8 PolyLog[2,Times[<<2>>]])). *)
(* 0.*10^-699 *)
AskConstants
so many thanks for demonstrating its use
$\endgroup$
f[n_] := (((-1)^n (HarmonicNumber[2 n] - HarmonicNumber[n]))/(
n 2^n Binomial[2 n, n]))
First, we check the sum convergence
SumConvergence[f[n], n]
Doing the sum analytically:
Sum[f[n], {n, 1, Infinity}]
that takes too long for the time I can spare. So, let's do a couple of values and take it from there.
Table[Sum[f[n], {n, 1, xx}], {xx, 1, 21}]
You can try to find an analytic formula for the numerator and denominator of the above data, either by using FindSequenceFunction
or OEIS
. Neither leads to an answer.
So, finally we resort to numerics
Table[Sum[f[n], {n, 1, xx}], {xx, 1, 21}] // N
and we see that it quickly converges to -0.114005
Let $$a_n=\frac{ H_{2n}-H_{n}}{n\,2^n\, \binom{2n}{n}}\implies \frac{a_{n+1}}{a_n}=\frac{n \left(H_{n+1}-H_{2 n+2}\right)}{4 (2 n+1) \left(H_n-H_{2 n}\right)}$$ Using asymptotics $$\frac{a_{n+1}}{a_n}=\frac{1}{8}-\frac{1}{16 n}+\frac{1+\log (2)}{32 n^2 \log (2)}+O\left(\frac{1}{n^3}\right)$$ So, we can expect a quite fast convergence.
Facing an alternating series,
$$\sum_{n=1}^\infty (-1)^n a_n=\sum_{n=1}^p (-1)^n a_n+\sum_{n=p+1}^\infty (-1)^n a_n$$ consider $a_{p+1}$ $$H_{2(p+1)}-H_{p+1}=\log (2)-\frac{1}{4 n}+\frac{5}{16 n^2}-\frac{3}{8 n^3}+O\left(\frac{1}{n^4}\right)$$
$$\log\big[H_{2(p+1)}-H_{p+1}\big]=\log (\log (2))-\frac{1}{4p \log (2)}+\frac{10 \log (2)-1}{32 p^2 \log ^2(2)}+O\left(\frac{1}{p^3}\right)$$ $$\log\Bigg[2^{p+1} (p+1) \binom{2 p+2}{p+1}\Bigg]=3p \log (2)+\frac{1}{2} \log \left(\frac{64 p}{\pi }\right)+\frac{3}{8 p}-\frac{1}{8 p^2}+O\left(\frac{1}{p^3}\right)$$
$$\log(a_{p+1})=-3p \log (2)+\left(\log (\log (2))-\frac{1}{2} \log \left(\frac{64 p}{\pi }\right)\right)+O\left(\frac{1}{p}\right)$$ So, if we want $$a_{p+1} \leq \epsilon \quad \implies \quad p \geq \frac{W(t)}{6 \log (2)} \qquad \text{where} \qquad t=\frac{3 \pi \log ^3(2)}{32 \epsilon ^2}$$ $W(t)$ being Lambert function.
Suppose $\epsilon=10^{-16}$, this gives as a real $p=16.1471$ (notice that the exact solution is $16.1263$.
Computing for $p=17$ gives for the summation $$-\frac{6773770929644673431621962072907}{59416607594890592064865566720000}$$ which, in decimal, is $-0.11400467316863727867$.
Now,being lazy, I went here; click the last button ("Integer Relation Algorithms") and you will see the result already given
After writing the answer below I found from suggestions that an analytical answer was already found here.
A well-known method to compute integrals is to replace the integrand by a series and to integrate term by term. We will do the opposite here. We will replace the terms in the series with an integral.
The Wikipedia page on harmonic numbers gives an integral representation which we will use:
$$ H_n=\int_{0}^{1} \frac{1-t^{n}}{1-t} d t $$
Hence, the series above can be written as:
$$ \sum \limits _{n=1}^{\infty}\frac{(-1)^n (H_{2n}-H_{n})}{n(2)^n \binom{2n}{n}}=\int_{0}^{1}\frac{1}{1-t}\sum \limits _{n=1}^{\infty} \frac{(-1)^n(t^n-t^{2n})}{n2^n \binom{2n}{n}} d t $$
An intermediate problem is then how to compute:
$$f(t)=\sum \limits _{n=1}^{\infty} \frac{t^n}{n\binom{2n}{n}} $$
Mathematica shows that this function is :
$$ f(t)=\frac{2 \sqrt{t} \operatorname{ArcSin}\left[\frac{\sqrt{t}}{2}\right]}{\sqrt{4-t}} $$
Substituting $t$ for $t^2$ one could probably verify this by showing that both expressions verify the same linear differential equation of order 2 (I used Mathematica's DifferentialRootReduce to find the differential equation from the explicit ArcSin form), however, that sounds a bit tedious. Instead, I will derive a different representation for $f$ using the following integral representation given on the Wikipedia page for the beta function :
$$ \frac{1}{\binom{2n}{n}} =\frac{n}{2} \operatorname{Beta}(n,n) = \frac{n}{2} \int_0^1 (1-x)^{n-1} x^{n-1} \mathrm{d} x $$
The function f above is then represented by :
$$f(t)=\int_0^1\frac{t}{2} \sum \limits _{n=1}^{\infty} \left(tx(1-x)\right)^{n-1} \mathrm{d} x =\int_0^1 \frac{t}{2(1-(xt(1-x)))} \mathrm{d} x$$
This integral can be computed by obtaining the canonical form of the second-degree polynomial in the denominator and then using a change of variables to obtain an ArcTan function. I suppose that using trigonometry there is a way to go from the ArcTan version to the ArcSin version of Mathematica.
The original sum involving harmonic numbers can be written as:
$$ \sum \limits _{n=1}^{\infty}\frac{(-1)^n (H_{2n}-H_{n})}{n(2)^n \binom{2n}{n}}=\int_{0}^{1}\frac{1}{1-t}\left(f(-t/2)-f(-t^2/2)\right) \mathrm{d} t $$
The singularity at $t=1$ in the denominator is canceled by $f(-1/2)$-$f(-1/2)$ in the numerator.
Using the definition of $f$ in terms of the ArcSin function, Mathematica seems to be able to compute such integrals (Mathematica seems to have trouble when the boundaries are specified so I took an indefinite integral and computed limits using Series).
I have been trying to compute the integral on my own but the computation seems quite tedious.
Rewrite $f(-t/2)$ and $f(-t^2/2)$ in terms of Arcsinh instead of ArcSin
Compute the two terms containing $f(-t/2)$ and $f(-t^2/2)$ separately
Change of variables $t=4b^2$ to remove the Sqrt in ArcSinh in $f(-t/2)$
Notice that after the substitution $t=b^2$, $f$ looks like $\frac{d}{db}\operatorname{ArcSin}(b)^2$ and use that in an integration by parts.
Remove the ArcSinh by using the change of variables $b=\operatorname{Sinh}(a)$
Write Cosh and Sinh in terms of Exp and do a change of variables $\operatorname{Exp}(a)=c$
The integral will look like a rational function time the square of Logarithm for both the $f(-t/2)$ and $f(-t^2/2)$ if I remember well (I might be wrong)
Try to use integral representations of the dilograrithm to obtain the final result. Integration by parts might be needed where one of the logarithms in $\log(g)^2$ is differentiated. I did not try this last step and maybe one of the integral representations of the dilogarithm is close to the integral from the step before. I do not remember if other polylogarithms are needed.
Wikipedia
Wolfram Alpha (write the function in the search box, you might have to click on the link above the result from the search where it is written "Use as a math function instead" ). You might have to click on more to see more representations of the function.
NIST Digital Library of Mathematical Functions