someone wrote:
> 
> How do I teach Fricas the following simplification of
> polygamma special functions. For the input:
> 
> (5) -> polygamma(0, x+1) - polygamma(0, x)
> 
>    (5)  polygamma(0,x + 1) - polygamma(0,x)
>                                                     Type: Expression(Integer)
> this
> 
> (6) -> simplify(%)
> 
> should give me back 1/x. I'd like to have it work
> the same way as the well known example:
> 
> (7) -> sin(x)^2 + cos(x)^2       
> 
>               2         2
>    (7)  sin(x)  + cos(x)
>                                                     Type: Expression(Integer)
> (8) -> simplify(%)
> 
>    (8)  1
>                                                     Type: Expression(Integer)
> 
> Where do I need to add code? How much work
> would it be to achieve this?
> 

For sin we have:

(13) -> simplify(sin(x)^2)

                 2
   (13)  - cos(x)  + 1
                                                    Type: Expression(Integer)

Analog for 'polygamma' would be changing 'polygamma(0, 1 + x)'
into 'polygamma(0, x) + 1/x'.  However, this would work only
in trivial cases: doing this for all x would defeat the purpose
so you need a way to decide which arguments are 'x' and which
are 'x+1'.  Code doing such things is in 'normalize':

(16) -> normalize(factorial(x + 1)/factorial(x))

   (16)  x + 1
                                                    Type: Expression(Integer)
but

(17) -> simplify(factorial(x + 1)/factorial(x)) 

         (x + 1)!
   (17)  --------
            x!
                                                    Type: Expression(Integer)
(15) -> normalize(Gamma(x + 1)/Gamma(x))

         Gamma(x + 1)
   (15)  ------------
           Gamma(x)
                                                    Type: Expression(Integer)
So one would have to something like 'factdeprel', but apply
it to 'Gamma' and 'polygamma'.  AFAICS doing it just for
'polygamma' would be something like 10 lines of extra code.
OTOH a lot of functions can be simplified using recurences
between arguments and it would be nice to have a general
method for such simplifications.

Your original question was about 'simplify', to add such
functionality to 'simplify' we probably should share code
with 'normalize'.

BTW: Main main attention is 'normalize', it is used when
we want to ensure that "hidden" zeros will simplify to 0.
'simplify' is almost unused in algebra and left mostly
as user command which is doing less systematic job than
'normalize'.

-- 
                              Waldek Hebisch
[email protected] 

-- 
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.


Reply via email to