On the approximate of an infinite series

approximationcalculusprobability theorysequences-and-seriestime series

So we already know that the following series converges for all parameter range:

$$F_{U_i}(y)=\sum_{n=0}^\infty \frac {2(-1)^nR^{k\alpha+n\alpha}y^{k+n}}{\Gamma(k)n!\theta^{k+n}(k+n)(k\alpha+n\alpha+2)}$$

where $k$, $R$, $\alpha$, and $\theta$ are positive real.

However, I got strange result while trying to to approximate the above infinite series by only the first $K+1$ terms so the sum becomes from 0 to $K$ instead of $\infty$.

I've done a Matlab code to test my infinite series and I've got strange result for the following parameters:
$k=20, \alpha=2, y=100, R=10, \theta=55$

enter image description here

which shows that the series does not converge. Why did that happen? How can I figure the value of $K$ that best approximate the series.

Best Answer

Considering $$S_p=2\sum_{n=0}^p(-1)^n\frac {R^{(k+n)\alpha}y^{k+n}}{\Gamma(k)\,n!\,\theta^{k+n}(k+n)\,((k+n)\alpha+2)}$$ let $x=\frac{y }{\theta }R^{\alpha }$ to make $$S_p=\frac 2{\Gamma(k) }\sum_{n=0}^p(-1)^n\frac {x^{(k+n)}}{\,n!\,(k+n)\,((k+n)\alpha+2)}$$ which make $$S_\infty=1-\frac{\Gamma (k,x)}{\Gamma (k)}+\frac{\Gamma \left(k+\frac{2}{\alpha },x\right)-\Gamma \left(k+\frac{2}{\alpha }\right)}{\Gamma (k)}\,x^{-2/\alpha }$$ Using your numbers, this give $S_\infty=0.89$ (with $55$ trailing $0$'s).

Now, $S_p$ write in terms of $\, _2F_2(.)$ hypergeometric functions and probably this is the difficulty from a numerical point of view. The terms are extremely oscillating from the beginning (they are negative for odd values of $p$ and positive for even values of $p$). For the first ones $$\left( \begin{array}{cc} p & S_p \\ 0 & +3.05072\times 10^{25} \\ 1 & -5.01200\times 10^{27} \\ 2 & +4.13536\times 10^{29} \\ 3 & -2.28392\times 10^{31} \\ 4 & +9.49546\times 10^{32} \\ 5 & -3.16900\times 10^{34} \\ 6 & +8.84121\times 10^{35} \\ 7 & -2.12041\times 10^{37} \\ 8 & +4.46180\times 10^{38} \\ 9 & -8.36644\times 10^{39} \\ 10 & +1.41526\times 10^{41} \end{array} \right)$$

Continuing with even values of $p$, we shall notice that they start to decrease $$\left( \begin{array}{cc} 10 & 1.41526\times 10^{41} \\ 20 & 4.48410\times 10^{51} \\ 30 & 9.94112\times 10^{59} \\ 40 & 8.48485\times 10^{66} \\ 50 & 6.33071\times 10^{72} \\ 60 & 6.71603\times 10^{77} \\ 70 & 1.39937\times 10^{82} \\ 80 & 7.21169\times 10^{85} \\ 90 & 1.09282\times 10^{89} \\ 100 & 5.57116\times 10^{91} \\ 110 & 1.06427\times 10^{94} \\ 120 & 8.32196\times 10^{95} \\ 130 & 2.86727\times 10^{97} \\ 140 & 4.63325\times 10^{98} \\ 150 & 3.70455\times 10^{99} \\ 160 & 1.53530\times 10^{100} \\ 170 & 3.43503\times 10^{100} \\ 180 & 4.30083\times 10^{100} \\ 190 & 3.11128\times 10^{100} \\ 200 & 1.33820\times 10^{100} \\ 300 & 1.19093\times 10^{86} \\ 400 & 2.52084\times 10^{57} \\ 500 & 6.78163\times 10^{17} \\ 600 & 0.89000 \end{array} \right)$$

To explain that,we need, for your numbers, to compute $p$ such that $$Q_{p+1}=\frac{\left(\frac{2000}{11}\right)^{p+21}}{20! (p+21) (p+22) (p+1)!} \leq \epsilon$$

The $Q_{p+1}$ term goes through a maximum at $p=179.5$ (have a look at the table !) and for this value $Q_{p+1}=8.61902\times 10^{100}$.

For $\epsilon=10^{-20}$,we need $p=581$ (even for $\epsilon=10^{-2}$, $p=544$).

A crude estimate of $p$ is given by $$p=-\frac{\log (\epsilon )}{W\left(-\frac{11 }{2000 e}\log (\epsilon )\right)}$$ where $W(.)$ is Lambert function.

For the most general case and a better approximation, taking logarithms and using Stirling approximation for the very first term, we end with the equation $$\color{blue}{p \log (ex)- \left( p+\frac32\right) \log (p)=K} \qquad\text{where} \quad \color{blue}{K=\log \left(\frac{\sqrt{{\pi }} \,\epsilon \, x^{-(k+1)}\, \Gamma (k)}{\alpha \,\sqrt 2}\right)}$$ Since $p$ is large, we could approximate the equation by $$\color{blue}{\left(p+\frac{3}{2}\right) \log (e x)-\left(p+\frac{3}{2}\right) \log \left(p+\frac{3}{2}\right)=K}$$ for which the solution is given in terms of Lambert function $$\color{blue}{p=-\frac{K}{W\left(-\frac{K}{e x}\right)}-\frac 32}$$ Applied to the working case, this gives $p=599$ for $\epsilon=10^{-20}$.

I think that all is explained.

Edit

Considering the general term $$a_n=\frac {x^{(k+n)}}{\,n!\,(k+n)\,((k+n)\alpha+2)}$$ and using logarithmic differentiation we have $\frac{\partial a_n}{\partial n}=0$ if $$-2 \alpha (k+n)-(k+n) \psi (n+1) (\alpha (k+n)+2)+(k+n) \log (x) (\alpha (k+n)+2)-2=0$$ Assuming that $n$ is large, the expansion of the above quantity is $$\alpha \log \left(\frac{x}{n}\right)n^2 + \left(2 (\alpha k+1) \log \left(\frac{x}{n}\right)-\frac{5 \alpha }{2}\right)n+\cdots$$ So $a_n$ is maximized for $n \sim x$.

Using your numbers, a rigorous maximization of $a_n$ shows that it happens at $n=179.5$ (remember that $x=\frac{2000}{11}=181.8$) for which $a_n=5.24\times 10^{117}$.

Related Question