Am Freitag, den 29.01.2010, 20:19 +0100 schrieb Dieter Kaiser:
> Am Freitag, den 29.01.2010, 14:03 -0500 schrieb Raymond Toy:
> > On 1/29/10 12:58 PM, Dieter Kaiser wrote:
> > > Because of some additional checks in 2f1polys we can get results in
> > > terms of unsimplified polynomials:
> > >
> > > (%i18) hgfred([-1,1],[1/2],x);
> > > (%o18) chebyshev_t(1,1-2*x)
> > > (%i19) ev(%),nouns;
> > > (%o19) 1-2*x
> > >
> > > (%i20) hgfred([-1,3],[3/2],x);
> > > (%o20) ultraspherical(1,1,1-2*x)/2
> > > (%i21) ev(%),nouns;
> > > (%o21) 1-2*x
> > >
> > > Especially, when we have a number as an argument I think it is of
> > > interest to get the most simple result immediately. Now we have to do an
> > > extra evaluation:
> > >
> > I kind of like it returning the special orthogonal polynomials. Yes,
> > it's sometimes annoying when the result is so simple, as you show above,
> > but it might be nice to know that it was a special polynomial before it
> > gets simplified.
>
> OK, I see that it is of interest to get the more general expression
> too.
>
> To get both, the most simple result if desired and the more general
> expression I would like to suggest to trigger the expansion with an user
> flag, e.g. $expand_polynomials.
>
> To get it all consistent we have in addition to revert some already done
> expansions of polynomials. Furthermore, we have to decide what the
> default value should be.
>
> Remark: Especially in longer and complex calculations or in algorithm
> like specint it might be preferable to simplify immediately to the most
> simple result by default.
This could be the implementation with a default value of T for
expand_polynomials:
(%i4) hgfred([-1,b],[c],x);
(%o4) 1-b*x/c
(%i5) hgfred([-1,b],[c],x),expand_polynomials:false;
(%o5) jacobi_p(1,c-1,-c+b-1,1-2*x)/c
(%i6) hgfred([-1,1],[1/2],x);
(%o6) 1-2*x
(%i8) hgfred([-1,1],[1/2],x),expand_polynomials:false;
(%o8) chebyshev_t(1,1-2*x)
(%i9) hgfred([-1,3],[3/2],x);
(%o9) 1-2*x
(%i10) hgfred([-1,3],[3/2],x),expand_polynomials:false;
(%o10) ultraspherical(1,1,1-2*x)/2
Dieter Kaiser