2
$\begingroup$

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<r<1$. 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.

$\endgroup$
2
  • 1
    $\begingroup$ Show what have you tried in terms of Mathematica codes. $\endgroup$
    – corey979
    Commented Jan 21, 2021 at 16:38
  • 1
    $\begingroup$ I've forwarded parts of your question to the math stackexchange for clarification. $\endgroup$
    – Roman
    Commented Jan 22, 2021 at 12:01

2 Answers 2

2
$\begingroup$

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}    *)
$\endgroup$
1
  • $\begingroup$ This is wonderful. Thank you so much. @Roman $\endgroup$
    – Ferhat
    Commented Jan 23, 2021 at 12:18
1
$\begingroup$

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}  *)
$\endgroup$
5
  • 1
    $\begingroup$ Another real root is s == -1.21830031520808. $\endgroup$
    – user64494
    Commented Jan 21, 2021 at 18:19
  • 1
    $\begingroup$ 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. $\endgroup$
    – Michael E2
    Commented Jan 21, 2021 at 18:27
  • 1
    $\begingroup$ 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. $\endgroup$
    – user64494
    Commented Jan 21, 2021 at 18:47
  • $\begingroup$ 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 $\endgroup$
    – Ferhat
    Commented Jan 21, 2021 at 19:35
  • 1
    $\begingroup$ @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. $\endgroup$
    – Michael E2
    Commented Jan 21, 2021 at 20:26

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.