Another problem with integral

asked 2015-06-29 15:21:52 +0100

Peter Luschny gravatar image

updated 2023-01-09 23:59:53 +0100

tmonteil gravatar image

This is a follow-up to 'Problem with integral' which is a follow-up of 'Problem with hypergeometric'. I am still trying to solve the same basic problem with Sage and I am just reporting what I am experiencing.

F = lambda z: (1/pi)*integral((x-1)^z*sqrt(1/x-1/4), x,0,4)
print F(1/2).n()

NaN

print F(3/2).n()
0.509025648974361 Exception ValueError: ValueError('negative number to a fractional power not real',) in 'sage.gsl.integration.c_ff' ignored [The error message some 20 times.]

With Maple:

F := z -> (1/Pi)*int((x-1)^z*sqrt(1/x-1/4), x=0..4);
evalf(F(1/2)); 0.3697166867 + 0.4838248688*I
evalf(F(3/2)); 0.5090256475 - 0.3669993270 I
edit retag flag offensive close merge delete

Comments

1

Note that the solution of the symbolic integration problem with z=1/2 depends on whether the roots are collected:

sage: integral(sqrt(x-1)*sqrt(1/x-1/4))
integrate(sqrt(x - 1)*sqrt(1/x - 1/4), x)

sage: integrate(sqrt(-1/4*x^2 + 5/4*x - 1)/x^2)
-sqrt(-1/4*x^2 + 5/4*x - 1)/x + 1/2*arcsin(-2/3*x + 5/3) + 5/8*arcsin(5/3*x/abs(x) - 8/3/abs(x))

This specific issue is reported as http://trac.sagemath.org/ticket/18822

However, even with the solution the limit of F(4)-F(t), t->0 can't be computed.

rws gravatar imagerws ( 2015-06-30 08:34:33 +0100 )edit

The fact that there is a workaround for a special case does not give comfort as I confined myself in the report to special cases to simplify matters. If you look behind the scene you see the continuous Lah function which should work for all real z>0 at least.

Peter Luschny gravatar imagePeter Luschny ( 2015-07-02 09:12:31 +0100 )edit