# How can I calculate the sum of this series?

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]$$

• 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. Mar 14, 2022 at 9:14
• wolframalpha.com/… is pretty close to N[Log[Sinh[Pi]/Pi]]. Jul 4, 2022 at 1:39

Exponentiation followed by logarithm works, really fast:

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


Internal method works:

SumSumInfiniteLogarithmicSeries[
Log[1 + 1/n^2], {n, 1, Infinity}] // FullSimplify
(*  Log[Sinh[π]/π  *)

• FYI: Sum[Log[1 + 1/n^2], {n, 1, Infinity}, Method -> SumSumInfiniteLogarithmicSeries] calls the internal method that succeeds. Mar 14, 2022 at 5:21
• Awesome!!! I am not familiar with that way of performing the sums. Mar 14, 2022 at 5:22
• @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 -> SumSumInfiniteLogarithmicSeries] normally, but I forgot. Mar 14, 2022 at 5:30
• @lotus2019 ? Sum* is one way. (~180 symbols). Mar 14, 2022 at 16:00
• @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.) Mar 14, 2022 at 16:02

It's a backslide. v9.0.1 handles the problem without difficulty: 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[π]/π]}} *)

• (+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. Mar 14, 2022 at 5:15
• @kcr (+1) Now it answers OP's question. :) Mar 14, 2022 at 5:17
• Thanks! It's weird, though, that there's a backslide in such an elementary sum. Nice catch!!! Mar 14, 2022 at 5:18
• Great! Thank you for your help! @xzczd Mar 14, 2022 at 6:55

Do it for a bunch of values

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


{Log, 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


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.

• 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}] Mar 14, 2022 at 4:29
• one line Table[Sum[Log[1 + 1/n^2], {n, 1, xx}], {xx, 1, 17}] // FullSimplify // Map[First] // FindSequenceFunction // #[n-1]& // FullSimplify Mar 14, 2022 at 4:32
• @AsukaMinato a fine one-liner!!! Mar 14, 2022 at 4:41
• @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 Mar 14, 2022 at 4:42
• Very good method! Thank you! @kcr Mar 14, 2022 at 6:53