# expressing a rising factorial as a polynomial

I have an equation in $x$ as follows:

$f(x)=\prod\limits_{j=0}^{k}(j+x)=x(1+x)(2+x)\cdots(k+x)$

I want to express this as a polynomial in $x$, i.e., as $a_0x^0+a_1x^1+\cdots+a_kx^k$

I tried doing the following:

Collect[Product[j + x, {j, 0, k}], x]


However, I get the result as $x (x+1)_k$ where $(a)_n$ is the Pochhammer symbol (rising factorial) which is equivalent to $(1+x).(2+x)\cdots(k+x)$ which is not quite what I was looking for.

Please help me obtain the above function as a polynomial in powers of $x$.

• Your code seems a mixture of TeX and Mathematica, so it's not exactly clear what input you've given. Mathematica won't/can't expand the product with an indeterminate limit k. Are you looking for a formula for $a_n$? – Michael E2 Apr 27 '16 at 11:49
• I wanted to expand the product for indeterminate limit $k$, but as you say, it seems to be impossible with mathematica – Priya P Apr 27 '16 at 11:50
• You can get a definite number of terms of the expansion with Series[Pochhammer[x, k+1], {x, 0, 3}], but you have specify a numeric degree like 3 at which to truncate the series. (Use something like @MichaelE2 to ensure a commenter gets notified of a reply. The author of a post is always notified.) – Michael E2 Apr 27 '16 at 12:08
• @MichaelE2 Thank you – Priya P Apr 30 '16 at 3:48

The expressions for the coefficients of the Pochhammer symbol are in fact well-known (see e.g. Concrete Mathematics):

$$\prod_{k=0}^{n-1}(x+k)=\sum_{k=0}^n \left[{n}\atop{k}\right]x^k$$

where $\left[{n}\atop{k}\right]$ is a Stirling cycle number. In Mathematica, this corresponds to (-1)^(n - k) StirlingS1[n, k].

Table[Product[x + k, {k, 0, n - 1}] ==
Sum[(-1)^(n - k) StirlingS1[n, k] x^k, {k, 0, n}], {n, 0, 10}]
{True, True, x (1 + x) == x + x^2,
x (1 + x) (2 + x) == 2 x + 3 x^2 + x^3,
x (1 + x) (2 + x) (3 + x) == 6 x + 11 x^2 + 6 x^3 + x^4,
x (1 + x) (2 + x) (3 + x) (4 + x) ==
24 x + 50 x^2 + 35 x^3 + 10 x^4 + x^5}

And @@ Expand[%]
True


For completeness, here is the corresponding formula for factorial powers:

And @@ Expand[Table[Product[x - k, {k, 0, n - 1}] ==
Sum[StirlingS1[n, k] x^k, {k, 0, n}], {n, 0, 5}]]
True

• Awesome!! Thank you :) – Priya P May 7 '16 at 9:47
f[n_, x_] := Expand[Fold[(#2 + x - 2) #1 & , Range[n + 1]]]


e.g.

Grid[{f[#, t], CoefficientList[f[#, t], t]} & /@ Range[0, 10]]


Just to illustrate unexpanded polynomial:

g[n_, x_] := Fold[(#2 + x - 2) #1 & , Range[n + 1]]
TableForm[{#, g[#, u], g[#, 1], #!} & /@ Range[0, 5],
TableHeadings -> {None, {"n", "p(u)", "p(1)", "n!"}}]


f = Expand[# Denominator@FunctionExpand@FactorialPower[#, -#2 + 1]] &;

f[t, 3]


Grid[{#, f[x, #], Rest@CoefficientList[f[x, #], x]} & /@ Range[5],
Alignment -> Left]


Or

f2 = Expand[FunctionExpand[FactorialPower[#, #2]] /. i_Integer :> -i] &;
Grid[{#, f2[x, #]} & /@ Range[5], Alignment -> Left]


• I actually wanted the expansion for an indeterminate (denoted by $C$) number of terms, but I suppose I have to adjust with this. Thank you! – Priya P Apr 30 '16 at 3:50