4
$\begingroup$

Backslide introduced after 9.0.1, persisting through 13.0.


How can I calculate the sum of this series?

$\sum_{n=1}^{\infty} \ln \left(1+\frac{1}{n^{2}}\right)$

The sum of this series has been proved to be convergent.

SumConvergence[Log[1 + 1/n^2], n]

True

However, the results cannot be obtained with Sum.

Sum[Log[1 + 1/n^2], {n, 1, Infinity}]

$\sum_{n=1}^{\infty} \log \left[1+\frac{1}{n^{2}}\right]$

$\endgroup$
2
  • $\begingroup$ DiscreteLimit[Sum[Log[1 + 1/n^2], {n, 1, k}], k -> Infinity] is running without any result in 13 on Windows during dozens minutes. Likely an infinite loop is formed as in many, many other commands of Mathematica. $\endgroup$
    – user64494
    Commented Mar 14, 2022 at 9:14
  • $\begingroup$ wolframalpha.com/… is pretty close to N[Log[Sinh[Pi]/Pi]]. $\endgroup$ Commented Jul 4, 2022 at 1:39

3 Answers 3

10
$\begingroup$

Exponentiation followed by logarithm works, really fast:

Log@Product[1 + 1/n^2, {n, 1, Infinity}] // AbsoluteTiming
(*  {0.139728, Log[Sinh[π]/π]}  *)

Internal method works:

Sum`SumInfiniteLogarithmicSeries[
  Log[1 + 1/n^2], {n, 1, Infinity}] // FullSimplify
(*  Log[Sinh[π]/π  *)
$\endgroup$
8
  • 5
    $\begingroup$ FYI: Sum[Log[1 + 1/n^2], {n, 1, Infinity}, Method -> SumSumInfiniteLogarithmicSeries]` calls the internal method that succeeds. $\endgroup$
    – Michael E2
    Commented Mar 14, 2022 at 5:21
  • $\begingroup$ Awesome!!! I am not familiar with that way of performing the sums. $\endgroup$
    – user49048
    Commented Mar 14, 2022 at 5:22
  • 2
    $\begingroup$ @xzczd I looked through the Sum` context, which I know from previous experience contains many methods. I use a double backtick to format Sum[Log[1 + 1/n^2], {n, 1, Infinity}, Method -> Sum`SumInfiniteLogarithmicSeries] normally, but I forgot. $\endgroup$
    – Michael E2
    Commented Mar 14, 2022 at 5:30
  • 1
    $\begingroup$ @lotus2019 ? Sum`* is one way. (~180 symbols). $\endgroup$
    – Michael E2
    Commented Mar 14, 2022 at 16:00
  • 2
    $\begingroup$ @kcr Thanks. Another way to do the first method, although it is computationally a different path: Limit[Log@FullSimplify[Exp@Sum[Log[1 + 1/n^2], {n, 1, k}]], k -> Infinity] -- somehow it is overcautious about combining the logarithms. Perhaps it is the reason for the backslide. (Logs cannot be combined willy-nilly, but they can be combined in this case.) $\endgroup$
    – Michael E2
    Commented Mar 14, 2022 at 16:02
6
$\begingroup$

It's a backslide. v9.0.1 handles the problem without difficulty:

enter image description here

Please report this to WRI.


One possible work-around for higher version (somewhat opportunistic):

sum = Sum[Log[1 + 1/n^2], {n, 1, nn}] // Simplify
(* I π - Log[-Gamma[2 - I]] - Log[Gamma[2 + I]] - 2 Log[Gamma[1 + nn]] + 
 Log[Gamma[(1 - I) + nn]] + Log[2 Gamma[(1 + I) + nn]] *)

There's a lot of Log[…] in sum, so we try

limit = Limit[E^sum, nn -> Infinity] // FullSimplify
(* Sinh[π]/π *)

It happens to succeed! So the original summation should be

Solve[E^Σ == limit, Σ, Reals] // Simplify
(* {{Σ -> Log[Sinh[π]/π]}} *)
$\endgroup$
4
  • $\begingroup$ (+1) and many thanks for spotting this backslide, but please have a look at the updated version of my answer as I get the answer as you did with v9. $\endgroup$
    – user49048
    Commented Mar 14, 2022 at 5:15
  • 1
    $\begingroup$ @kcr (+1) Now it answers OP's question. :) $\endgroup$
    – xzczd
    Commented Mar 14, 2022 at 5:17
  • $\begingroup$ Thanks! It's weird, though, that there's a backslide in such an elementary sum. Nice catch!!! $\endgroup$
    – user49048
    Commented Mar 14, 2022 at 5:18
  • $\begingroup$ Great! Thank you for your help! @xzczd $\endgroup$
    – lotus2019
    Commented Mar 14, 2022 at 6:55
5
$\begingroup$

Do it for a bunch of values

Table[Sum[Log[1 + 1/n^2], {n, 1, xx}], {xx, 1, 17}] // FullSimplify

{Log[2], Log[5/2], Log[25/9], Log[425/144], Log[221/72], Log[8177/2592], Log[204425/63504], Log[13287625/4064256], Log[544792625/164602368], Log[2200962205/658409472], Log[134258694505/39833773056], Log[19467510703225/5736063320064], Log[9791351537125/2868031660032], Log[1928896252813625/562134205366272], Log[8718611062717585/2529603924148224], Log[2240683043118419345/647578604581945344], Log[1124218135820660225/323789302290972672]}

And now we are going to invoke a black box of Mathematica. Fingers crossed and hope it works

Log@FindSequenceFunction[{2, 5/2, 25/9, 425/144, 221/72, 8177/2592, 
204425/63504, 13287625/4064256, 544792625/164602368, 
2200962205/658409472, 134258694505/39833773056, 
19467510703225/5736063320064, 9791351537125/2868031660032, 
1928896252813625/562134205366272, 
8718611062717585/2529603924148224, 
2240683043118419345/647578604581945344, 
1124218135820660225/323789302290972672}, n] // FullSimplify

gives

Log[(Gamma[(1 - I) + n] Gamma[(1 + I) + n] Sinh[π])/(π Gamma[ 1 + n]^2)]

Does this answer your question or did I misunderstood what you wanted?

Edit: a one-liner thanks to the comment by @AsukaMinato

Table[Sum[Log[1 + 1/n^2], {n, 1, xx}], {xx, 1, 17}] // FullSimplify // Map[First] // FindSequenceFunction // #[n]& // FullSimplify

Edit 2: I am addressing the issue that @xzczd had in the comments.

We can expand out the formula the FindSequenceFunction spat out

-2 Log[Gamma[1 + n]] + Log[Gamma[(1 - I) + n]] + 
 Log[Gamma[(1 + I) + n]] + Log[ Sinh[π]/π ]

Everything is a Log of something, so we can kill the Log and do the limit

Limit[Exp[-2 Log[Gamma[1 + n]] + Log[Gamma[(1 - I) + n]] + 
   Log[Gamma[(1 + I) + n]] + Log[ Sinh[\[Pi]]/\[Pi] ]], {n -> 
   Infinity}]

which yields

Sinh[π]/π

and the Log of the above is the answer to the original sum.

$\endgroup$
6
  • 1
    $\begingroup$ OP is summing to Infinity. If the upper index isn't Infinity, Sum can handle the problem without difficulty, no need to use FindSequenceFunction: Sum[Log[1 + 1/n^2], {n, 1, nn}] $\endgroup$
    – xzczd
    Commented Mar 14, 2022 at 4:29
  • 1
    $\begingroup$ one line Table[Sum[Log[1 + 1/n^2], {n, 1, xx}], {xx, 1, 17}] // FullSimplify // Map[First] // FindSequenceFunction // #[n-1]& // FullSimplify $\endgroup$ Commented Mar 14, 2022 at 4:32
  • $\begingroup$ @AsukaMinato a fine one-liner!!! $\endgroup$
    – user49048
    Commented Mar 14, 2022 at 4:41
  • 1
    $\begingroup$ @xzczd as $n$ approaches higher and higher values you get Log[something]. FindSequenceFunction provides an analytic answer to that particular [something]. It's like doing a proof by induction $\endgroup$
    – user49048
    Commented Mar 14, 2022 at 4:42
  • $\begingroup$ Very good method! Thank you! @kcr $\endgroup$
    – lotus2019
    Commented Mar 14, 2022 at 6:53

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.