Skip to content
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

Bug with definite integral #22671

Open
rwst opened this issue Mar 22, 2017 · 5 comments
Open

Bug with definite integral #22671

rwst opened this issue Mar 22, 2017 · 5 comments

Comments

@rwst
Copy link

rwst commented Mar 22, 2017

Two similar integrals, differing by an exponent 1/3 vs 1/5, behave differently.

Here, three ways to compute an integral agree:

sage: q = 1/3
sage: g = (1 + x)^q / (1 - x)
sage: a = g.integrate(x, 2., 3., hold=True)  # hold
sage: b = g.integrate(x, 2., 3.)  # no hold
sage: c = g.nintegral(x, 2., 3.)  # numerical
sage: print(f'  a ≈ {a.n()}\n  b ≈ {b.n()}\n  c ≈ {c[0]}')
  a ≈ -1.045820326411141
  b ≈ -1.04582032641114
  c ≈ -1.045820326411141

Here they do not:

sage: Q = 1/5
sage: G = (1 + x)^Q / (1 - x)
sage: A = G.integrate(x, 2., 3., hold=True)  # hold
sage: B = G.integrate(x, 2., 3.)  # no hold  # long time!
sage: C = G.nintegral(x, 2., 3.)  # numerical
sage: print(f'  A ≈ {A.n()}\n  B ≈ {B.n()}\n  C ≈ {C[0]}')
  A ≈ -0.8870832386197556
  B ≈ -0.963974668699275 - 0.0295059317724807*I
  C ≈ -0.8870832386197555

CC: @slel

Component: calculus

Keywords: integral

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

@rwst rwst added this to the sage-8.0 milestone Mar 22, 2017
@slel

This comment has been minimized.

@slel

This comment has been minimized.

@slel slel modified the milestones: sage-8.0, sage-9.4 Mar 25, 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
@fchapoton
Copy link
Contributor

Changed keywords from none to integral

@fchapoton
Copy link
Contributor

comment:6

This may be an issue with the maxima result

sage: B = G.integrate(x, 2., 3., algorithm="mathematica_free")
sage: B.n()
-0.887083000000000
sage: B = G.integrate(x, 2., 3., algorithm="giac")
sage: B.n()
-0.887083238620000

@slel
Copy link
Member

slel commented Feb 25, 2022

comment:7

Perhaps the integration engine

  • uses a dedicated "real cube root" function in one case
  • lacks a "real fifth root" function for the other case

@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

4 participants