Asymptotic expansion by repeated integration by parts (source code)

= Asymptotic expansion by repeated integration by parts

For fixed real $a$ and $z>0$, <integration by parts> in the upper <incomplete gamma function> gives
$$
\Gamma(a,z)=z^{a-1}e^{-z}+(a-1)\Gamma(a-1,z).
$$
Repeating $N$ times yields the exact identity
$$
\Gamma(a,z)=z^{a-1}e^{-z}\sum_{k=0}^{N-1}\frac{c_k}{z^k}+c_N\Gamma(a-N,z),\quad c_0=1,\quad c_k=\prod_{j=1}^k(a-j).
$$
For fixed $a,N$ as $z\to+\infty$, the last term is $O(z^{a-1-N}e^{-z})$, giving an <asymptotic expansion> in inverse endpoint powers.<NIST Digital Library of Mathematical Functions>[section8.11(i), equations8.11.1–8.11.3]{ref}

This is an exact remainder formula before it becomes an asymptotic statement. If $a$ is a positive integer, a coefficient eventually vanishes and the expansion terminates. For instance $\Gamma(3,z)=e^{-z}(z^2+2z+2)$. For noninteger $a$, the expansion need not converge as an infinite <series>; its purpose is controlled finite truncation.