Open ppurka opened 10 years ago
Description changed:
---
+++
@@ -12,3 +12,7 @@
Both of which are wrong according to 2.728 of Gradshteyn & Ryzhik. Actually the second example is obviously wrong since the integration is a real function over a real interval.
Should I report the error to Maxima? That seems to be the source.
+
+PS:
+1. The "I" above is not me (ppurka)
+2. I am done scrounging through the google spreadsheet for bugs, for now.
(%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.
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.
sage: integrate(log(1+x)/x,x,algorithm='sympy')
-polylog(2, -x)
If this answer is wrong, mark it for a stopgap or even create one
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<sup>2/4+log(2)</sup>2/2-1/2*(log(2)+I*pi)^2
, which doesn't seem to be recognised.
Description changed:
---
+++
@@ -1,6 +1,4 @@
From google spreadsheet which no one reads `X-(`
-
-A simple integration error.
sage: integrate(log(1+x)/x,x) @@ -9,10 +7,4 @@ -1/6pi^2 + Ipi*log(2) + polylog(2, 2)
-Both of which are wrong according to 2.728 of Gradshteyn & Ryzhik. Actually the second example is obviously wrong since the integration is a real function over a real interval.
-
-Should I report the error to Maxima? That seems to be the source.
-
-PS:
-1. The "I" above is not me (ppurka)
-2. I am done scrounging through the google spreadsheet for bugs, for now.
+Since `dilog(2) = -pi<sup>2/4+log(2)</sup>2/2-1/2*(log(2)+I*pi)^2` the result is simply `pi^2/12`.
So I think we can at least relabel this. As the answer is correct it becomes a mere enhancement ticket.
What does giac
do, out of curiosity?
Replying to @kcrisman:
What does
giac
do, out of curiosity?
.. it's quite fun. in that list in github i started to evaluate the integral tickets with different algorithms.
From google spreadsheet which no one reads
X-(
Since
dilog(2) = -pi<sup>2/4+log(2)</sup>2/2-1/2*(log(2)+I*pi)^2
the result is simplypi^2/12
.CC: @sagetrac-jakobkroeker @kcrisman @rwst
Component: calculus
Issue created by migration from https://trac.sagemath.org/ticket/15504