There is a formula for the hypergeometric ($_2F_1$) that expresses it as a sum of Pochhammer symbols, times something that reads
$$_2F_1(a,b,c;x) = \sum_{i=0}^{\infty} \frac{(a)_i (b)_i}{(c)_i} \frac{x^i}{i!}$$
This is a result that I easily verified.
Result1 =
Series[Hypergeometric2F1[a22, b22, c22, y], {y, 0, 10}];
Result2 =
Sum[(Pochhammer[a22, w] Pochhammer[b22, w])/Pochhammer[c22, w]*y^w/
w!, {w, 0, 10}];
Normal[Result1/Result2 // Factor // Simplify] // Timing
{1.04688, 1}
In what I need to write down I have products of hypergeometric functions but the arguments have the same structure and for each hypergeometric the value of $n$ is fixed -see below the exact form.
For now I am only interested in clarifying the following thing.
This is one of the hypergeometric functions that I have.
Hypergeometric2F1[1/2 (Δ + l) + n,
1/2 (Δ + l) + n, Δ + l + 2 n, x]
And this is how I re-wrote it
Sum[(Pochhammer[1/2 (Δ + l) + n, i] Pochhammer[
1/2 (Δ + l) + n, i])/
Pochhammer[(Δ + l + 2 n), i]*x^i/i!, {i, 0, 10}]
For my purposes, I need to sum over values of $\Delta,l$ and this is where the problem starts.
Some standard results for the Pochhammer symbol.
Pochhammer[0, 0]
1
Pochhammer[0, 1]
0
Pochhammer[0, 2]
0
This means that for certain combinations of $\Delta, l, n$ the denominator can be zero. The good thing is that the numerator comes with two zeros, and there is an exact cancellation; actually we would get zero. Mathematica does not want to handle a fraction like $\frac{0*0}{0}$, so I need to put by hand the following:
If $\Delta + l + 2n \neq 0$ give me all the terms in the sum, otherwise if $\Delta + l + 2n = 0$ and $n=0$ the corresponding term in the sum is $1$ and all the other terms in the sum are $0$ and I want to sum this.
An example with numbers just to clarify a bit more.
$\Delta = 4, l=0, n=1$, then the sum runs smoothly.
$\Delta = 4, l=0, n=-2$ then I would like to get back $1$ when $i=0$ and $0$ for the other values of $i$ and in the end sum this thing, which gives $1$.
My attempts:
First one:
ftest[x_, z_, Δ_, l_, n_] :=
If[(1/2 (Δ + l) + n != 0),
Sum[(Pochhammer[1/2 (Δ + l) + n, i] Pochhammer[
1/2 (Δ + l) + n, i])/
Pochhammer[(Δ + l + 2 n), i]*x^i/i!, {i, 0, 10}],
If[(1/2 (Δ + l) + n == 0) ∧ (i == 0),
Sum[(Pochhammer[1/2 (Δ + l) + n, i] Pochhammer[
1/2 (Δ + l) + n, i])/
Pochhammer[(Δ + l + 2 n), i]*x^i/i!, {i, 0, 10}],
0]]
Second one:
ftest[x_, z_, Δ_, l_, n_] :=
If[(1/2 (Δ + l) + n !=
0) ∨ ((1/2 (Δ + l) + n == 0) ∧ (i == 0)),
Sum[(Pochhammer[1/2 (Δ + l) + n, i] Pochhammer[
1/2 (Δ + l) + n, i])/
Pochhammer[(Δ + l + 2 n), i]*x^i/i!, {i, 0, 10}],
0]
The problem I have:
In the example with the specific numbers I gave above I have no troubles. I am showing the results using the the expression in the second effort
ftest[x, z, 4, 0, 1]
1 + (3 x)/2 + (12 x^2)/7 + (25 x^3)/14 + (25 x^4)/14 + (
7 x^5)/4 + (56 x^6)/33 + (18 x^7)/11 + (225 x^8)/143 + (
275 x^9)/182 + (132 x^10)/91
For the other example I gave, with the zero value of the Pochhammer $\Delta = 4, l=0, n=-2$ I get the following
ftest[x, z, 4, 0, -2]
If[i == 0, \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(i = 0\), \(10\)]
\*FractionBox[\(\((Pochhammer[
\*FractionBox[\(4 + 0\), \(2\)] - 2, i]\ Pochhammer[
\*FractionBox[\(4 + 0\), \(2\)] - 2, i])\)\
\*SuperscriptBox[\(x\), \(i\)]\), \(Pochhammer[
4 + 0 + 2\ \((\(-2\))\), i]\ \(i!\)\)]\), 0]
Thank you in advance for your help.