On Fri, Mar 10, 2023 at 12:16:41AM -0800, 'Martin R' via FriCAS - computer 
algebra system wrote:
> > During integration FriCAS tries as much as it can preserve structure of 
> user input.
> 
> I think that this is not true with respect to polynomials: these are always 
> expanded, right?
> 
> sage: fricas("(x+y)^5")
>  5        4       2 3       3 2      4     5
> y  + 5 x y  + 10 x y  + 10 x y  + 5 x y + x
> sage: fricas("(x+sin(y))^5")
>       5             4       2      3       3      2      4          5
> sin(y)  + 5 x sin(y)  + 10 x sin(y)  + 10 x sin(y)  + 5 x sin(y) + x
> sage: fricas("(1+x+sin(y))^3")
>       3                  2       2                     3      2
> sin(y)  + (3 x + 3)sin(y)  + (3 x  + 6 x + 3)sin(y) + x  + 3 x  + 3 x + 1

Well:

a) As Ralf noted polynomial are expanded before they reach integrator,
b) Integration changes coefficients of polynomials in a way which
   does not play nice with factor structure.  So even if we spent
   more effort it seem that we have to expand.

To comment more on "as much as it can": FriCAS code is currently
oriented to have normal form of expressions which forces normalization
and expansion.  Normalization means that internally integrator
may use different kernels than what is in user input, and preservation
is currently limited to kernels.  I have some ideas to how to preserve
more but that needs new code and effect will be limited.

-- 
                              Waldek Hebisch

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/20230310135340.zleewsfjqhwna57u%40fricas.math.uni.wroc.pl.

Reply via email to