MathGroup Archive 2009

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

Search the Archive

Re: Coefficient Question

  • To: mathgroup at
  • Subject: [mg104056] Re: Coefficient Question
  • From: Bill Rowe <readnews at>
  • Date: Sat, 17 Oct 2009 07:03:08 -0400 (EDT)

On 10/16/09 at 7:19 AM, sguthery at (Scott) wrote:

>I've got the expression


>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?

Is this acceptable to you?

In[5]:= expr = 8 (3 + 5 k + 4 x1 + 6 x2 + 45 x3);
expr /. {8 (3 + b_) -> 8 b}

Out[6]= 8 (5 k+4 x1+6 x2+45 x3)

Note, using replacement rules in this fashion isn't truly a
subtraction operation. There is no mathematics being done by the
replacement rule. It is up to the user to determine the
mathematical validity of doing replacements like this.

  • Prev by Date: Point on sphere greatest distance from given points
  • Next by Date: Re: Coefficient Question
  • Previous by thread: Re: Coefficient Question
  • Next by thread: Re: Coefficient Question