sqrt integral not working

asked 2023-09-07 19:02:47 +0100

sid gravatar image

updated 2023-09-08 00:42:22 +0100

I can't seem to integrate sqrt in SageMath -

Jupyter cells in website CoCalc

In:
x1 = var('x1')
g1 = function('g11')
s1 = sqrt(g1(x1)); s1
g0i = integral(s1,x1); g0i
Out:
+Infinity

But sqrt works fine otherwise -

In:
x1 = var('x1')
g1 = function('g11')
s1 = sqrt(g1(x1)); s1
Out:
sqrt(g11(x1))

And sqrt works in other expressions, e.g. inverse -

In:
x1 = var('x1')
g1 = function('g11')
s1 = sqrt(g1(x1)); s1
g0i = integral(s1/g1(x1),x1); g0i
Out:
integrate(1/sqrt(g11(x1)), x1) ---- note the processing of
sqrt for the output

But when the final expression depends on the first power of sqrt -

In:
x1 = var('x1')
g1 = function('g11')
s1 = sqrt(g1(x1)); s1
g0i = integral(g1(x1)/s1,x1); g0i
Out:
+Infinity

I'm interested in processing in symbolic math, not in specific numbers. I need to use this for sagemanifolds, and just need for the differentiation that occurs, ultimately, to return the original functions - sqrt and g1.

edit retag flag offensive close merge delete

Comments

1

integration is trying several engines, one of them is wrong:

sage: integral(s1,x1,algorithm="maxima")
integrate(sqrt(g11(x1)), x1)
sage: integral(s1,x1,algorithm="sympy")
integrate(sqrt(g11(x1)), x1)
sage: integral(s1,x1,algorithm="fricas")
integral(sqrt(g11(x1)), x1)
sage: integral(s1,x1,algorithm="giac")
+Infinity
FrédéricC gravatar imageFrédéricC ( 2023-09-08 08:56:48 +0100 )edit

Thanks for reporting this bug. This is now the issue #36222.

eric_g gravatar imageeric_g ( 2023-09-08 23:41:07 +0100 )edit