Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

problems with symbolic integration and then numerical evaluating

can anyone explain this: sage: integrate(legendre_P(64,x)sin((1+x)pi/2),x,-1,1).n() 1.16508247725542e79

from approximation one know's that the legendre coefficients converge exponentially to zero and not to infinity!

and indeed with mpmath I get a better answer: sage: import sage.libs.mpmath.all as mpmath sage: mpmath.call(mpmath.quad,lambda x: mpmath.legendre(64,x)mpmath.sin(pi/2(x+1)),[-1,1]) -5.04684703543649e-25

Is there an overhead happening, when I numerically evaluate large rationals or something???

Thanks in advance, maldun

click to hide/show revision 2
fixed math typesetting.

problems with symbolic integration and then numerical evaluating

can anyone explain this: this:

sage: integrate(legendre_P(64,x)sin((1+x)pi/2),x,-1,1).n()
1.16508247725542e79

integrate(legendre_P(64,x)*sin((1+x)*pi/2),x,-1,1).n() 1.16508247725542e79

from approximation one know's that the legendre coefficients converge exponentially to zero and not to infinity!

and indeed with mpmath I get a better answer: answer:

sage: import sage.libs.mpmath.all as mpmath
sage: mpmath.call(mpmath.quad,lambda x: mpmath.legendre(64,x)mpmath.sin(pi/2(x+1)),[-1,1])
-5.04684703543649e-25

mpmath.legendre(64,x)*mpmath.sin(pi/2*(x+1)),[-1,1]) -5.04684703543649e-25

Is there an overhead happening, when I numerically evaluate large rationals or something???

Thanks in advance, maldun