MathGroup Archive 2009

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

Search the Archive

Re: Coefficient Question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104046] Re: Coefficient Question
  • From: Thomas Dowling <thomasgdowling at gmail.com>
  • Date: Sat, 17 Oct 2009 07:01:18 -0400 (EDT)
  • References: <200910161104.HAA00732@smc.vnet.net>

Hello,

A few  examples (of many possibilities?):

expr = Expand[8 (3 + 5 k + 4 x1 + 6 x2 + 45 x3)]

Select[expr, NumericQ]
or
Select[expr, IntegerQ]
or
Select[expr, FreeQ[#, k | x1 | x2 | x3] &]

Tom Dowling

On Fri, Oct 16, 2009 at 12:04 PM, Scott <sguthery at gmail.com> wrote:

> I've got the expression
>
> 8(3+5k+4x1+6x2+45x3)
>
> and I want to extract the constant 24.
>
> Yes, I can define a function and then set k and x1 and x2 and x3 to 0
> but there has to be easier way, no?
>
> Any suggestions?
>
> Thanks much.
>
> Cheers, Scott
>
>


  • Prev by Date: Re: Coefficient Question
  • Next by Date: Re: Coefficient Question
  • Previous by thread: Coefficient Question
  • Next by thread: Coefficient Question