Greetings,
I've found that SageMath (8.3 and 8.6) gives me incorrect results when
integrating the simple integrand sqrt(1-x^2-y^2). The code that follows
illustrates the issue:
banner()
(x,y) = var('x y')
eps = var('eps',latex_name='\\epsilon')
assume(abs(x)<0.1, abs(y) < 0.1, abs(eps) < 0.1, eps > 0)
z = sqrt(1-x^2-y^2)
print(z)
print('Integrating directly')
int1 = z.integrate(x,-eps,eps).integrate(y,-eps,eps)
print(N(int1.substitute(eps==1e-4))) # Should be about 4e-8
print(taylor(int1,(eps,0),4))
print('Integrating via Taylor series')
int2 = taylor(z,(x,0),(y,0),8).integrate(x,-eps,eps).integrate(y,-eps,eps)
print(N(int2.substitute(eps==1e-4)))
print(taylor(int2,(eps,0),4))
Which prints (on sagecell.sagemath.org, to ensure a new version is being
tested):
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.6, Release Date: 2019-01-15 │
│ Using Python 2.7.15. Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sqrt(-x^2 - y^2 + 1)
Integrating directly
1.99999998666667e-8
-4/3*eps^4 + 2*eps^2
Integrating via Taylor series
3.99999998666667e-8
-4/3*eps^4 + 4*eps^2
Note the factor of 2 difference in the lowest-order term.
This may be an issue in one of the libraries called by Sage, but I'm not
experienced enough with the ecosystem to know which one (if any) could be at
fault.
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.