Hi,
> > Where do we need to add code such that Fricas can transform
> > these results into Shi and Chi respectively?
>
> Look at src/algebra/integrat.spad.pamphlet. Currently hyperbolic
> functions are generated in the 'rinteg' routine. The tactic
> is very simple: if there is any hyperbolic function in
> the input, then all exponentials are converted to hyperbolics:
Ok, I'll see. Thanks for the pointer.
In principle a simple standalone function would also be sufficient.
But maybe I'm thinking too much in terms of other CAS who has a
general "simplify".
> In principle one can convert Ei to Si/Ci in the same place.
Ok, let me see.
> To say the truth, it would be good to make code a bit smarter and
> only convert exponentials and Ei-s that came from hyperbolics.
> 'normalize' sees no reason to pull 'c' out from the exponential.
> OTOH integrator has to introduce 'exp(c)' and normalize is
> content with 'exp(x)' and 'exp(a*x^2)' as separate
> exponentials. To check that to expressions are equal
> normalize their difference:
Yes, for sure. That should work otherwise there is a bug.
(Or at least some undecidable zero recognition lurking around.)
> As I wrote: complicate it enough and new code will kick in.
Indeed:
(125) -> integrate(sin(x)/x + exp(x),x)
x
(125) %e + Si(x)
(126) -> integrate(cos(x)/x+exp(x),x)
x
2%e + Ci(x) + Ci(- x)
(126) ----------------------
2
I'm a bit worried by the symmetrized Ci result,
because according to definition of branch cuts
this is only Ci(x) + i*pi/2. Of course the last
factor is a constant ...
We really need to have the new code tried earlier.
I removed in "intpm.spad" the code for Si and Ci,
but get unevaluated forms again:
(1) -> integrate(sin(x)/x, x)
x
++ sin(%A)
(1) | ------- d%A
++ %A
Type: Union(Expression(Integer),...)
(2) -> integrate(sin(x)/x + exp(x), x)
x
(2) %e + Si(x)
Type: Union(Expression(Integer),...)
After a very quick test it seems to me that we
maybe could already remove the "matcherfei" matcher.
I'll make some more tests.
Just two more success stories from our old thread about:
"Hyperbolic sine and cosine integrals":
(10) -> integrate(D(1/(1 + exp(x^2)), x) + sin(x)/x, x)
2
x
Si(x)%e + Si(x) + 1
(10) ---------------------
2
x
%e + 1
This only gave back an integral sign a year ago.
(11) -> integrate(a*exp(x)/x - b*exp(-x)/x, x)
(11) a Ei(x) - b Ei(- x)
This works now :-)
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.