MathGroup Archive 1999

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

Search the Archive

Select peculiarity

  • To: mathgroup at smc.vnet.net
  • Subject: [mg16384] Select peculiarity
  • From: Jack Goldberg <jackgold at math.lsa.umich.edu>
  • Date: Thu, 11 Mar 1999 02:16:52 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Group,

I have an expression  f[x] from which I want to pick out 
polynomials in  x.  Consider this method:

	test[f_,x_] := Select[ f, PolynomialQ[#,x]& ] 

Now  f  need not be a list as the following examples show.

Ex 1.   test[x^2+2x -1 + g[x],x]  returns  x^2+2x+1

Ex2.    test[(x^2+x-1)*g[x],x]    returns  x^2+2x+1

Exactly what I expected.  One more successful example.

Ex3.    test[(x+1)(x-1)g[x],x]  returns (x+1)(x-1)

Here is the puzzle.

Ex4.   	test[g[x]*h[x],x]  	returns  1

Anyone know what's going on?

I am using Version 3.0 on both a Sun unix machine and a PowerMac.

Jack



  • Prev by Date: the simplest way?
  • Next by Date: HELP
  • Previous by thread: Re: the simplest way?
  • Next by thread: HELP