# Real roots of an infinite series consisting of Harmonic number

I know that the following equation, as a function of $$s$$, has two real roots: $$\sum_{n=1}^{\infty}e^{s(1-s)H[n]}=\frac{1-r}{r}e^{s^2}-1$$ for $$0. Is there any simple way to find these real roots for a given $$r$$? Mathematica takes a long long time to solve it using NSolve, FindRoot, etc. Even worse, for example:

r = 0.8;
FindRoot[(Exp[s^2] (1 - r))/r - 1 == Sum[Exp[s (1 - s) HarmonicNumber[n]], {n, 1, Infinity}], {s, 1.6}]


gives "the sum diverges" which does not.

• Show what have you tried in terms of Mathematica codes. Jan 21, 2021 at 16:38
• I've forwarded parts of your question to the math stackexchange for clarification. Jan 22, 2021 at 12:01

Using this Math.SE solution to construct a fast approximation of $$f(x)=\sum_{n=1}^{\infty} e^{x\cdot H_n}$$ as $$f(x) \approx f_m(x) = \sum_{n=1}^m e^{x\cdot H_n} + \sum_{n=m+1}^{\infty} e^{x\cdot[\gamma+\log(n)]} = \sum_{n=1}^m e^{x\cdot H_n} + e^{\gamma x}\zeta(-x,m+1)$$ for a large integer $$m$$:

f[x_ /; x < -1, m_Integer /; m >= 1] :=
Total[Exp[Accumulate[x/Range[m]]]] +
Exp[EulerGamma*x]*HurwitzZeta[-x, m + 1]


we can find the desired roots very fast and accurately:

With[{r = 0.8, m = 10^4},
FindRoot[f[s*(1-s), m] == (1-r)/r*Exp[s^2] - 1, {s, -1}]]
(*    {s -> -1.2183}    *)

With[{r = 0.8, m = 10^4},
FindRoot[f[s*(1-s), m] == (1-r)/r*Exp[s^2] - 1, {s, 1.7}]]
(*    {s -> 1.68535}    *)

• This is wonderful. Thank you so much. @Roman Jan 23, 2021 at 12:18

SumConvergence indicates you sum converges for s greater than the Golden Ratio, which s = 1.6 is not. Use a slightly larger initial value for FindRoot:

r = 0.8;
sol = FindRoot[(Exp[s^2] (1 - r))/r - 1 ==
Sum[Exp[s (1 - s) HarmonicNumber[n]], {n, 1, ∞}],
{s, 2}]
(*  {s -> 1.68535}  *)


FindRoot now seems to find a root:

N[
(Exp[s^2] (1 - r))/r - 1 -
Sum[Exp[s (1 - s) HarmonicNumber[n]], {n, 1, ∞}] /. sol
]
(*  9.76996*10^-15  *)


The other root, which @user64494 kindly pointed out, occurs in the other interval of convergence, where s is less than the conjugate of the golden section.

sol = FindRoot[(Exp[s^2] (1 - r))/r - 1 ==
Sum[Exp[s (1 - s) HarmonicNumber[n]], {n, 1, ∞}],
{s, -1}]
(*  {s -> -1.2183}  *)

• Another real root is s == -1.21830031520808. Jan 21, 2021 at 18:19
• Yeah, you get convergence for s less than the conjugate of the golden section, too. I guess my focus locked in on the OP's code and the problem with it. Thanks. Jan 21, 2021 at 18:27
• FindRoot[(Exp[s^2] (1 - r))/r - 1 == Sum[Exp[s (1 - s) HarmonicNumber[n]], {n, 1, \[Infinity]}], {s, -2}] finds it. When RealAbs[s] is big, then there is no real root there. Jan 21, 2021 at 18:47
• Thank you all. It means that the starting point has to be in the convergence radius??? I did not know the logic behind it. @ user64494 @ Michael E2 Jan 21, 2021 at 19:35
• @Farhad If you start FindRoot at a point where the function doesn't return a number, FindRoot will quit. So your starting point has to be a value of s for which the series converges. Jan 21, 2021 at 20:26