Skip to content

Wrong integrate(log(cot(x)-1),x,0,pi/4) (regression) #30389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sagetrac-tmonteil mannequin opened this issue Aug 19, 2020 · 7 comments
Open

Wrong integrate(log(cot(x)-1),x,0,pi/4) (regression) #30389

sagetrac-tmonteil mannequin opened this issue Aug 19, 2020 · 7 comments

Comments

@sagetrac-tmonteil
Copy link
Mannequin

sagetrac-tmonteil mannequin commented Aug 19, 2020

Upgrading Maxima to 5.44.0 (see #30063) leads to the following regression:

sage: a = integral(log(cot(x) - 1), x, 0, pi/4); a
1/4*pi*(I*pi + log(2)) - 1/2*pi*log(2) - 1/2*I*dilog(I + 1) + 1/2*I*dilog(-I + 1) + 1/2*I*dilog(1/2*I + 1/2) - 1/2*I*dilog(-1/2*I + 1/2)

Whose numerical value is 2.467401100272339*I+0.2721982612879502 while it should be 0.2721982612879502.

This integral had previously been wrong for a different reason and had been fixed upstream in https://sourceforge.net/p/maxima/bugs/2501/; the doctest was added in #13733.

The bug is doctested and marked as # known bug in src/sage/symbolic/integration/integral.py (once #30063 is merged).

The bug is reported upstream as https://sourceforge.net/p/maxima/bugs/3649/

Upstream: Reported upstream. Developers acknowledge bug.

CC: @kiwifb

Component: symbolics

Keywords: integral, maxima

Issue created by migration from https://trac.sagemath.org/ticket/30389

@sagetrac-tmonteil sagetrac-tmonteil mannequin added this to the sage-9.2 milestone Aug 19, 2020
@sagetrac-tmonteil
Copy link
Mannequin Author

sagetrac-tmonteil mannequin commented Aug 19, 2020

Upstream: Reported upstream. No feedback yet.

@pjbruin
Copy link
Contributor

pjbruin commented Aug 19, 2020

comment:2

I found this commit message in the Maxima Git log; the first integral mentioned is exactly the regression in Sage.

commit 47a6afd1d4691b83bedd197dea322dfd64f4f0f9
Author: Dan Gildea <dgildea>
Date:   Fri Dec 28 15:50:26 2018 -0500

    add series expansion for expintegral_si and gamma_incomplete

    remove fallback to unevaluated derivative - this was a mistake

    unfortunately 3 integrals from the test suite now fail, due
    to the singularity at li[2](1):
     integrate(log(cot(x) - 1), x, 0, %pi/4);           /* rtest16  524 */
     integrate(log(cos(x)), x, 0, %pi/2);                   /* rtest16  525 */
     integrate((log((2-x)/2)+log(2))/(1-x), x, 0, 1);   /* rtestint 232 */
    marked as expected failures.

    Fixes #3484

@pjbruin
Copy link
Contributor

pjbruin commented Aug 20, 2020

comment:3

Similar bug (numerical integral of sin(x)/x is off by π): #11164

@pjbruin
Copy link
Contributor

pjbruin commented Aug 20, 2020

Changed upstream from Reported upstream. No feedback yet. to Reported upstream. Developers acknowledge bug.

@pjbruin

This comment has been minimized.

@fchapoton
Copy link
Contributor

Changed keywords from none to integral, maxima

@mkoeppe mkoeppe modified the milestones: sage-9.2, sage-9.3 Oct 24, 2020
@mkoeppe
Copy link
Contributor

mkoeppe commented May 10, 2021

comment:8

Moving to 9.4, as 9.3 has been released.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 May 10, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Aug 22, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 18, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 May 3, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants