Message Boards Message Boards

0
|
3107 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Coefficient command

Posted 11 years ago
Dear,

I have tried to use the command Coefficient in the following polynomial: (x+y+z)^3 but it did not work as showed below:
 In[144]:= poly = (x + y + z)^3;
 Coefficient[poly, xyz]
 Out[145]= 0
 
 In[107]:= Expand[(x + y + z)^3]
 Out[107]= x^3 + 3 x^2 y + 3 x y^2 + y^3 + 3 x^2 z + 6 x y z +
  3 y^2 z + 3 x z^2 + 3 y z^2 + z^3
 
 In[148]:= poly = (x + y + z)^3;

Coefficient[poly, x*y*z]
Out[149]= 6

As you can see above the right coefficient for xyz is 6 and not 0. This command just worked when I used x*y*z instead of xyz. Could you help me to understand this failure?

Thank you
POSTED BY: Ana Squadri
2 Replies
The spaces are necessary so that the product x y z is not interpreted as the single symbol xyz.
In[1]:= Coefficient[(x + y + z)^3, x y z]

Out[1]= 6
POSTED BY: Ilian Gachevski
Posted 11 years ago
Thank you
POSTED BY: Ana Squadri
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract