I think x+a is a polynomial in x and a, not a polynomial in x.
Dunno about %pi. For some purposes %pi is a polynomial in the object %pi,
RJF
> -----Original Message-----
> From: maxima-bounces at math.utexas.edu
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Stavros Macrakis
> Sent: Saturday, September 22, 2007 10:41 PM
> To: Rupert Swarbrick
> Cc: maxima at math.utexas.edu
> Subject: Re: [Maxima] Bug #535363 again
>
> > I ended up writing my own polynomial test using rat which
> came to about
> > 3 lines. It's considerably simpler than those from RJF
> because the only
> > question is "Can this expression be written in powers of
> <var>" and (I
> > think) you can check this by just calling rat() on the
> expression with
> > var as the variable and then checking the resulting header.
>
> Your code is indeed considerably simpler, but incorrect in many simple
> cases. All the following are polynomials in x but your code reports
> that they are not:
>
> %pi
> a
> x+a
> a*x
> rat(x,q)
>
> Barton Willis's code is correct, I believe.
>
> -s
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>