Ask Your Question
0

computation of an integral

asked 2024-03-21 14:43:55 +0200

user111 gravatar image

How to compute the integral from a>0 to infinity of (x-a)^(-1/2)*x^(-3/4) ?

integrate(1/((x-a)^(1/2)*x^(3/4)),x,a,oo);

leads to : unsigned oo times smaller number not defined

Thanks

edit retag flag offensive close merge delete

Comments

Are you using an old version of sage ? On a recent one, the result is

sage: integrate(1/((x-a)^(1/2)*x^(3/4)),x,a,oo)
No checks were made for singular points of antiderivative 0 for definite integration in [sageVARa,+infinity]
integrate(1/(sqrt(-a + x)*x^(3/4)), x, a, +Infinity)

which means that none of our integration engines can find a closed expression.

FrédéricC gravatar imageFrédéricC ( 2024-03-21 19:48:30 +0200 )edit

I am using the online version SageMath 9.1 at http://127.0.0.1:8888/notebooks... The value of the integral is a^(-1/4)*B(1/2,1/4) (with B the beta function, and a>0). The link with the beta function is straightforward by a change of variable.

user111 gravatar imageuser111 ( 2024-03-22 07:46:29 +0200 )edit

sage 9.1 is very obsolete, but recent sage cannot do this integral

FrédéricC gravatar imageFrédéricC ( 2024-03-22 08:04:20 +0200 )edit

I may be wrong but it seems Sage 9.1 is the only version available on Jupyter.

user111 gravatar imageuser111 ( 2024-03-22 08:36:47 +0200 )edit

Sage 10.3 (just released) runs without problem on Linux and on Windows>=10 nder WSL2. The recommended way to intall it is still compliing the source tarball (or, better, the git tree), but large progress have been made towards using Conda.

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2024-03-22 18:27:43 +0200 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2024-03-22 19:27:35 +0200

Emmanuel Charpentier gravatar image

FWIW :

sage: var("a")
a
sage: foo=1/((x-a)^(1/2)*x^(3/4))
sage: foo.integrate((x, 0, oo))
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)

[ Snip... ]

ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(a>0)', see `assume?` for more details)
Is a positive, negative or zero?` arguments fails

Well...

sage: with assuming(real(a)<0): gee=foo.integrate((x, 0, oo)) ; gee
beta(1/4, 1/4)/(-a)^(1/4)
sage: gee.simplify_factorial()
gamma(1/4)^2/(sqrt(pi)*(-a)^(1/4))

Following Sage's suggestion gives us an usable result for a<0 (and fails for a>=0, BTW).

Let's try someting else. Adding algorithm="sympy" to `integrate arguments fails, because the result cannot (yet) be translated back to Sage. Try it manually :

sage: import sympy
sage: sympy.integrate(*map(sympy.sympify, (foo, (x, 0, oo))))
Piecewise((-a*exp(3*I*pi/4)*gamma(1/4)**2/(sqrt(pi)*polar_lift(a)**(5/4)), (Abs(arg(a) + pi) < pi) | (Ne(1/a, 0) & (Abs(arg(a) + pi) < pi) & Ne(Abs(arg(a) + pi), pi))), (Integral(1/(x**(3/4)*sqrt(-a + x)), (x, 0, oo)), True))

which ultimately means $ \frac{a e^{\frac{3 i \pi}{4}} \Gamma^{2}\left(\frac{1}{4}\right)}{\sqrt{\pi} \operatorname{polar_lift}^{\frac{5}{4}}{\left(a \right)}} $ if abs(arg+pi)<pi, the latter reducing to real(a)<0 in I'm not confused.

Sympy fails to simplify the complicated expressions it uses (and cannot be translated to sage). But, FWIW :

sage: foo._mathematica_().Integrate((x, 0, oo))
ConditionalExpression[Gamma[1/4]^2/((-a)^(1/4)*Sqrt[Pi]), Re[a] < 0]

The real situation is therefore a tad moree complex than described.

  • Sage's can find an explicit form of the integral under a condition which it cannot find.

  • Sympy cannot find simplified expressions of its solution.

  • Mathematica agrees with Sage's integratin and seems to agree to Sympy's condition.

HTH,

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2024-03-21 14:43:55 +0200

Seen: 163 times

Last updated: Mar 22