Opened 5 years ago

Last modified 2 years ago

#15504 new enhancement

Missing dilog(2) simplification

Reported by: ppurka Owned by:
Priority: major Milestone: sage-6.4
Component: calculus Keywords:
Cc: jakobkroeker, kcrisman, rws Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by rws)

From google spreadsheet which no one reads X-(

sage: integrate(log(1+x)/x,x)
 log(x + 1)*log(-x) + polylog(2, x + 1)
sage: integrate(log(1+x)/x,x,0,1) 
 -1/6*pi^2 + I*pi*log(2) + polylog(2, 2)

Since dilog(2) = -pi^2/4+log(2)^2/2-1/2*(log(2)+I*pi)^2 the result is simply pi^2/12.

Change History (12)

comment:1 Changed 5 years ago by ppurka

  • Description modified (diff)

comment:2 Changed 5 years ago by kcrisman

(%i6) integrate(log(1+x)/x,x,0,1);
                                                      2
                                                   %pi
(%o6)                   log(- 1) log(2) + li (2) - ----
                                            2       6
(%i7) integrate(log(1+x)/x,x);
(%o7)                  log(- x) log(x + 1) + li (x + 1)
                                               2

Apparently in Maxima.

comment:3 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:4 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:5 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:6 Changed 4 years ago by rws

For completeness, sympy has

In [1]: integrate(log(1+x)/x)
Out[1]: 
        ⎛      ⅈ⋅π⎞
-polylog⎝2, x⋅ℯ   ⎠

In [2]: integrate(log(1+x)/x,(x,0,1))
Out[2]: 
        ⎛    ⅈ⋅π⎞
-polylog⎝2, ℯ   ⎠

while Wolfram says integral (log(1+x))/x dx = -Li_2(-x)+constant. The sympy solution will also only be available with sympy-0.7.8 because of a missing polylog._sage_ method in earlier versions.

comment:7 Changed 3 years ago by rws

sage: integrate(log(1+x)/x,x,algorithm='sympy')
-polylog(2, -x)

comment:8 Changed 2 years ago by jakobkroeker

  • Cc jakobkroeker kcrisman rws added

If this answer is wrong, mark it for a stopgap or even create one

comment:9 Changed 2 years ago by mforets

as of v8.0.beta3, Maxima is correct:

sage: integrate(log(1+x)/x, x, 0, 1, algorithm='maxima')
-1/6*pi^2 + I*pi*log(2) + dilog(2)
sage: _.n()
0.822467033424113
sage: N(pi^2/12)
0.822467033424113

see W|A

the imaginary part vanishes because of the identity dilog(2) = -pi^2/4+log(2)^2/2-1/2*(log(2)+I*pi)^2, which doesn't seem to be recognised.

comment:10 Changed 2 years ago by rws

  • Description modified (diff)
  • Summary changed from Possible integration error to Missing dilog(2) simplification
  • Type changed from defect to enhancement

So I think we can at least relabel this. As the answer is correct it becomes a mere enhancement ticket.

comment:11 follow-up: Changed 2 years ago by kcrisman

What does giac do, out of curiosity?

comment:12 in reply to: ↑ 11 Changed 2 years ago by mforets

Replying to kcrisman:

What does giac do, out of curiosity?

  • giac returns unevaluated
  • sympy returns the correct + reduced answer

.. it's quite fun. in that list in github i started to evaluate the integral tickets with different algorithms.

Note: See TracTickets for help on using tickets.