# [GiNaC-list] bug with is_polynomial?

Jonathan Cross jacross at u.washington.edu
Wed Aug 6 10:42:19 CEST 2008

```Alexei,

I agree these are not polynomials over the field of rational numbers.

I thought that if R is any ring, then you could define the polynomial
ring R[s], where the elements are "polynomials" in the variable s
with coefficients in the ring R.  Within this framework, the examples
in my code are in the ring R[s], where
R = the ring of continuous functions in the real variable x
s = the polynomial variable.

If you need to be more restrictive than arbitrary rings for GiNaC,
that's understandable.  In which case, there's an inconsistency,
as GiNaC reports
sin(x) + 2*s     is a polynomial in s, but
pow(2,x) + 2*s   is not a polynomial in s.

I would think that (for GiNaC) these should either both be or neither
be polynomials in s.  Clearly neither is a polynomial in x.
IMHO, calling such expressions polynomials in s makes more sense
mathematically, and seems consistent with the examples in the GiNaC
tutorial, section 5.7.1.

Hope this clarifies things.  Thanks for taking the time to maintain
GiNaC (or at least the time to respond to email)!

-Jonathan

On Aug 5, 2008, at 11:58 PM, Alexei Sheplyakov wrote:

> Hello!
>
> On Tue, Aug 05, 2008 at 01:58:59PM -0700, Jonathan Cross wrote:
>
>> When there is an expression involving a non-integer power---even when
>> the expression is independent of the dummy variable of the
>> polynomial---
>> then the expression is not considered a polynomial by GiNaC.
>
> Mathematically such an expression is not a polynomial (over field of
> rational numbers). See you favourite book on the (commutative) ring
> theory for more details.
>
>>   // here are two expressions that are both polynomials with
>> respect to s.
>>   GiNaC::ex    expr1 = sin(x) + 2*s;
>>   GiNaC::ex    expr2 = pow(2,x) + 2*s;
>
> I don't quite understand why these expressions are polynomials. Could
>
>
> Best regards,
> 	Alexei
>
> --
> All science is either physics or stamp collecting.
>
> _______________________________________________
> GiNaC-list mailing list
> GiNaC-list at ginac.de
> https://www.cebix.net/mailman/listinfo/ginac-list

```