Message Boards Message Boards

0
|
4454 Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Expand a polynomial expression?

Posted 5 years ago

If a write Expand[(x-1)^k], for k arbitrary, the answer is the same. How can I get the complete expression of such a polynomial?

POSTED BY: Paulo Rodrigues
4 Replies

Here is a way that uses SeriesCoefficient:

polynomialExpression = (x - 1)^n;
Assuming[k >= 0, 
 Inactive[Sum][
  x^k SeriesCoefficient[polynomialExpression, {x, 0, k}],
  {k, 0, n}]]
% // Activate
POSTED BY: Gianluca Gorni

If I write Expand[(x - 1)^3] I get the polynomial - 1 + 3 x - 3 x^2 + x^3. Ok . If I write Sum[ Binomial[k, i] (x - 2)^i, {i, 0, k}] I get (-1 + x)^ k, which is the same as Expand[(x - 1)^n /. n -> k]. What I look for is the polynomial expression for arbitrary k . Note the symmetry :

-1 + 5 x - 10 x^2 + 10 x^3 - 5 x^4 + x^5, if n = 5

1 - 6 x + 15 x^2 - 20 x^3 + 15 x^4 - 6 x^5 + x^6, if n = 6

POSTED BY: Paulo Rodrigues
Posted 5 years ago

If you specify a value for k and use Expand, you'll get a polynomial expression:

Expand[(x - 1)^k /. k -> 3] (* -1 + 3 x - 3 x^2 + x^3 *)

Or are you looking for something like $\sum _{i=0}^k \binom{k}{i} x^i (-1)^{k-i} $ ?

POSTED BY: Jim Baldwin

I am very curious about the correct answer?

POSTED BY: Mariusz Iwaniuk
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