MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: PolynomialQ (wrong) behavior ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg19280] Re: [mg19199] PolynomialQ (wrong) behavior ?
  • From: "Tomas Garza" <tgarza at mail.internet.com.mx>
  • Date: Thu, 12 Aug 1999 01:24:30 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

Drago Ganic [drago.ganic at in2.hr] wrote:

> f = 2x +1
>
> PolynomialQ [ f, x ]
> True
>
> That's OK. But why the following
>
> PolynomialQ [ f, y ]
> True
>
> PolynomialQ [ f, Sin[x] ]
> True

I guess you're trying to substitute Sin[x} in your f so as to obtain 2
Sin[x] + 1 which is certainly not a polynomial in x. But what you are asking
is whether it is a polynomial in Sin[x], so that the test gives True, as it
should. I think you can avoid the problem by being more precise, for
example:

 In[1]:=
f[x_] := 2 x + 1
In[2]:=
PolynomialQ[f[x], x]
Out[2]=
True
In[3]:=
PolynomialQ[f[Sin[x]], x]
Out[3]=
False

But, of course:

In[4]:=
PolynomialQ[f[x], Sin[x]]
Out[4]=
True

which roughly corresponds to what you had in your question. Bear in mind
that Sin is a symbol.

Tomas Garza
Mexico City



  • Prev by Date: RE: Automatic Display in MatrixForm
  • Next by Date: Re: "LOLLIPOP" PLOTS FOR DISCRETE SEQUENCES
  • Previous by thread: Re: PolynomialQ (wrong) behavior ?
  • Next by thread: Re: PolynomialQ (wrong) behavior ?