Opened 8 years ago

# Missing dilog(2) simplification

Reported by: Owned by: ppurka major sage-6.4 calculus jakobkroeker, kcrisman, rws N/A

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`.

### comment:1 Changed 8 years ago by ppurka

• Description modified (diff)

### comment:2 Changed 8 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 8 years ago by vbraun_spam

• Milestone changed from sage-6.1 to sage-6.2

### comment:4 Changed 7 years ago by vbraun_spam

• Milestone changed from sage-6.2 to sage-6.3

### comment:5 Changed 7 years ago by vbraun_spam

• Milestone changed from sage-6.3 to sage-6.4

### comment:6 Changed 6 years ago by rws

For completeness, sympy has

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

In : integrate(log(1+x)/x,(x,0,1))
Out:
⎛    ⅈ⋅π⎞
-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 5 years ago by rws

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

### comment:8 Changed 4 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 4 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 4 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: ↓ 12 Changed 4 years ago by kcrisman

What does `giac` do, out of curiosity?

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

What does `giac` do, out of curiosity?