I am trying to calculate the $n^{\text{th}}$ term of the following polynomial:
$$\, _2F_1\left(-n,n+3;\frac{3}{2};x\right)$$
To do this I calculate:
c[k_] = SeriesCoefficient[
Hypergeometric2F1[-n, n+3, 3/2, x], {x, 0, k},
Assumptions -> k >= 0
];
and get:
c[k] //TeXForm
$\frac{\sqrt{\pi } (k-n-1)! (k+n+2)!}{2 k! \left(k+\frac{1}{2}\right)! (-n-1)! (n+2)!}$
and the problem is when I try to calculate for $n=10$:
Block[{n = 10}, Sum[c[k] x^k, {k, 0, 10}]]
Infinity::indet: Indeterminate expression (0 2 Sqrt[π] ComplexInfinity)/Sqrt[π] encountered.
Infinity::indet: Indeterminate expression (0 4 Sqrt[π] ComplexInfinity)/(3 Sqrt[π]) encountered.
Infinity::indet: Indeterminate expression (0 8 Sqrt[π] ComplexInfinity)/(15 Sqrt[π]) encountered.
General::stop: Further output of Infinity::indet will be suppressed during this calculation.
Indeterminate
I get error messages and an incorrect answer. The correct result is:
Hypergeometric2F1[-n, n+3, 3/2, x] /. n->10
1/33 (33 - 2860 x + 72072 x^2 - 823680 x^3 + 5125120 x^4 - 19009536 x^5 + 43868160 x^6 - 63504384 x^7 + 56033280 x^8 - 27525120 x^9 + 5767168 x^10)
Other manifestations of problems with c
:
Block[{n=10}, c[k]]
Block[{n=10}, c[5]]
0
Infinity::indet: Indeterminate expression -((128 0 64 316234143225 Sqrt[π] Sqrt[π] ComplexInfinity)/(135135 10395 4096 Sqrt[π] Sqrt[π])) encountered.
Indeterminate
c
does not give a useful symbolic result for the $k^{\text{th}}$ term of the series.
I try to use assumptions but it does not help.
Sum
first (withn
left undefined, then substitute
n->10` in the result. This will avoid the indeterminate forms. $\endgroup$%/.n->10
) doesn't solve your problem, when using a fresh kernel as suggested by bbgodfrey, then it's not clear what you are asking. Please edit your question to clarify. $\endgroup$