On Tue, Apr 09, 2024 at 08:24:35PM -0700, 'Nasser M. Abbasi' via FriCAS - computer algebra system wrote:
> I found problem integrating many problems using sagemath calling Fricas to
> do the integration when using exponential integral function. These are
> problems from Rubi test files.
>
> It works OK with other CAS systems supported by sagemath (Maxima and GIAC)
> but sagemath 10.3 does not seem to correctly translate the call to Fricas.
>
> I am having hard time finding what the exponential integral function is
> called before I ask at sagemath forum. I looked at the Fricas book and do
> not see anything,. I tried Ei but this does not work. (i.e. does not give
> same answer as other cas systems).
Well, 'Ei' is "true exponential integral". Other systems ofer you
variants, in FriCAS it is just 'Ei'. Some variants are equivalent
to incomplete gamma function, in such case FriCAS gives you
incomplete gamma.
'Ei' takes a single argument. If you need relations between various
functions look into Abramowitz and Stegun, FriCAS Ei is exactly as
defined in Abramowitz and Stegun.
>
> Here is an example, using sagemath trying to integrate. It works OK with
> maxima and giac but gives error with Fricas. I am using
>
> >fricas --version
> FriCAS 1.3.10
> based on sbcl 2.3.11
>
> with sagemath
> >sage --version
> SageMath version 10.3, Release Date: 2024-03-19
>
> Starting sagemath and typing:
>
> sage: var('x a b')
> (x, a, b)
>
> sage: integrate(exp_integral_e(1,b*x),x,algorithm="giac")
> integrate(exp_integral_e(1, b*x), x)
>
> sage: integrate(exp_integral_e(1,b*x),x,algorithm="maxima")
> -exp_integral_e(2, b*x)/b
>
> sage: integrate(exp_integral_e(1,b*x),x,algorithm="fricas")
> RuntimeError Traceback (most recent call last)
> TypeError: An error occurred when FriCAS evaluated
> 'exp_integral_e(((1)::EXPR INT),(b)*(x))':
> There are no library operations named exp_integral_e
>
> So clearly sagemath did not translate the exp_integral_e to Fricas
> correctly.
>
> What should the translation look like?
Maple page says:
Ei(a, z) = z^(a-1)*GAMMA(1-a, z)
In FriCAS that would be
Ei(a, z) == z^(a-1)*Gamma(1 - a, z)
I am not sure if Maple is right, example above leads to Gamma(0, x)
which is undefined.
--
Waldek Hebisch