Incomplete gamma function
Template:Short description Template:Use dmy dates
In mathematics, the upper and lower incomplete gamma functions are types of special functions which arise as solutions to various mathematical problems such as certain integrals.
Their respective names stem from their integral definitions, which are defined similarly to the gamma function but with different or "incomplete" integral limits. The gamma function is defined as an integral from zero to infinity. This contrasts with the lower incomplete gamma function, which is defined as an integral from zero to a variable upper limit. Similarly, the upper incomplete gamma function is defined as an integral from a variable lower limit to infinity.
DefinitionEdit
The upper incomplete gamma function is defined as: <math display="block"> \Gamma(s,x) = \int_x^{\infty} t^{s-1}\,e^{-t}\, dt ,</math> whereas the lower incomplete gamma function is defined as: <math display="block"> \gamma(s,x) = \int_0^x t^{s-1}\,e^{-t}\, dt .</math> In both cases Template:Mvar is a complex parameter, such that the real part of Template:Mvar is positive.
PropertiesEdit
By integration by parts we find the recurrence relations <math display="block"> \Gamma(s+1,x) = s\Gamma(s,x) + x^{s} e^{-x}</math> and <math display="block"> \gamma(s+1,x) = s\gamma(s,x) - x^{s} e^{-x}.</math> Since the ordinary gamma function is defined as <math display="block"> \Gamma(s) = \int_0^{\infty} t^{s-1}\,e^{-t}\, dt</math> we have <math display="block"> \Gamma(s) = \Gamma(s,0) = \lim_{x \to \infty} \gamma(s,x)</math> and <math display="block"> \gamma(s,x) + \Gamma(s,x) = \Gamma(s).</math>
Continuation to complex valuesEdit
The lower incomplete gamma and the upper incomplete gamma function, as defined above for real positive Template:Mvar and Template:Mvar, can be developed into holomorphic functions, with respect both to Template:Mvar and Template:Mvar, defined for almost all combinations of complex Template:Mvar and Template:Mvar.<ref name="auto3">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Complex analysis shows how properties of the real incomplete gamma functions extend to their holomorphic counterparts.
Lower incomplete gamma functionEdit
Holomorphic extensionEdit
Repeated application of the recurrence relation for the lower incomplete gamma function leads to the power series expansion: <ref name="auto2">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> <math display="block">\gamma(s, x) = \sum_{k=0}^\infty \frac{x^s e^{-x} x^k}{s(s+1)\cdots(s+k)} = x^s \, \Gamma(s) \, e^{-x} \sum_{k=0}^\infty\frac{x^k}{\Gamma(s+k+1)}.</math> Given the rapid growth in absolute value of Template:Math when Template:Math, and the fact that the [[Reciprocal Gamma function|reciprocal of Template:Math]] is an entire function, the coefficients in the rightmost sum are well-defined, and locally the sum converges uniformly for all complex Template:Mvar and Template:Mvar. By a theorem of Weierstrass,<ref name="class notes">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> the limiting function, sometimes denoted as Template:Nowrap<ref name="auto1">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> <math display="block">\gamma^*(s, z) := e^{-z}\sum_{k=0}^\infty\frac{z^k}{\Gamma(s+k+1)}</math> is entire with respect to both Template:Mvar (for fixed Template:Mvar) and Template:Mvar (for fixed Template:Mvar),<ref name="auto3"/> and, thus, holomorphic on Template:Math by Hartog's theorem.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Hence, the following decomposition<ref name="auto3"/> <math display="block">\gamma(s,z) = z^s \, \Gamma(s) \, \gamma^*(s,z),</math> extends the real lower incomplete gamma function as a holomorphic function, both jointly and separately in Template:Mvar and Template:Mvar. It follows from the properties of <math>z^s</math> and the Γ-function, that the first two factors capture the singularities of <math>\gamma(s,z)</math> (at Template:Math or Template:Mvar a non-positive integer), whereas the last factor contributes to its zeros.
Multi-valuednessEdit
The complex logarithm Template:Math is determined up to a multiple of Template:Math only, which renders it multi-valued. Functions involving the complex logarithm typically inherit this property. Among these are the complex power, and, since Template:Math appears in its decomposition, the Template:Math-function, too.
The indeterminacy of multi-valued functions introduces complications, since it must be stated how to select a value. Strategies to handle this are:
- (the most general way) replace the domain Template:Math of multi-valued functions by a suitable manifold in Template:Math called Riemann surface. While this removes multi-valuedness, one has to know the theory behind it;<ref>{{#invoke:citation/CS1|citation
|CitationClass=web }}</ref>
- restrict the domain such that a multi-valued function decomposes into separate single-valued branches, which can be handled individually.
The following set of rules can be used to interpret formulas in this section correctly. If not mentioned otherwise, the following is assumed:
SectorsEdit
Sectors in Template:Math having their vertex at Template:Math often prove to be appropriate domains for complex expressions. A sector Template:Mvar consists of all complex Template:Mvar fulfilling Template:Math and Template:Math with some Template:Mvar and Template:Math. Often, Template:Mvar can be arbitrarily chosen and is not specified then. If Template:Mvar is not given, it is assumed to be Template:Pi, and the sector is in fact the whole plane Template:Math, with the exception of a half-line originating at Template:Math and pointing into the direction of Template:Math, usually serving as a branch cut. Note: In many applications and texts, Template:Mvar is silently taken to be 0, which centers the sector around the positive real axis.
BranchesEdit
In particular, a single-valued and holomorphic logarithm exists on any such sector D having its imaginary part bound to the range Template:Open-open. Based on such a restricted logarithm, Template:Math and the incomplete gamma functions in turn collapse to single-valued, holomorphic functions on Template:Mvar (or Template:Math), called branches of their multi-valued counterparts on D. Adding a multiple of Template:Math to Template:Mvar yields a different set of correlated branches on the same set Template:Mvar. However, in any given context here, Template:Mvar is assumed fixed and all branches involved are associated to it. If Template:Math, the branches are called principal, because they equal their real analogues on the positive real axis. Note: In many applications and texts, formulas hold only for principal branches.
Relation between branchesEdit
The values of different branches of both the complex power function and the lower incomplete gamma function can be derived from each other by multiplication of <math>e^{2\pi iks}</math>,<ref name="auto3"/> for Template:Mvar a suitable integer.
Behavior near branch pointEdit
The decomposition above further shows, that γ behaves near Template:Math asymptotically like: <math display="block">\gamma(s, z) \asymp z^s \, \Gamma(s) \, \gamma^*(s, 0) = z^s \, \Gamma(s)/\Gamma(s+1) = z^s/s.</math>
For positive real Template:Mvar, Template:Mvar and Template:Mvar, Template:Math, when Template:Math. This seems to justify setting Template:Math for real Template:Math. However, matters are somewhat different in the complex realm. Only if (a) the real part of Template:Mvar is positive, and (b) values Template:Math are taken from just a finite set of branches, they are guaranteed to converge to zero as Template:Math, and so does Template:Math. On a single branch of Template:Math is naturally fulfilled, so there Template:Math for Template:Mvar with positive real part is a continuous limit. Also note that such a continuation is by no means an analytic one.
Algebraic relationsEdit
All algebraic relations and differential equations observed by the real Template:Math hold for its holomorphic counterpart as well. This is a consequence of the identity theorem, stating that equations between holomorphic functions valid on a real interval, hold everywhere. In particular, the recurrence relation <ref name="auto2"/> and Template:Math <ref name="auto2"/> are preserved on corresponding branches.
Integral representationEdit
The last relation tells us, that, for fixed Template:Mvar, Template:Mvar is a primitive or antiderivative of the holomorphic function Template:Math. Consequently, for any complex Template:Math, <math display="block">\int_u^v t^{s-1}\,e^{-t}\, dt = \gamma(s,v) - \gamma(s,u)</math> holds, as long as the path of integration is entirely contained in the domain of a branch of the integrand. If, additionally, the real part of Template:Mvar is positive, then the limit Template:Math for Template:Math applies, finally arriving at the complex integral definition of Template:Math<ref name="auto3"/> <math display="block">\gamma(s, z) = \int_0^z t^{s-1}\,e^{-t}\, dt, \, \Re(s) > 0. </math>
Any path of integration containing 0 only at its beginning, otherwise restricted to the domain of a branch of the integrand, is valid here, for example, the straight line connecting Template:Math and Template:Mvar.
Limit for Template:MathEdit
Real valuesEdit
Given the integral representation of a principal branch of Template:Math, the following equation holds for all positive real Template:Mvar, Template:Mvar:<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> <math display="block">\Gamma(s) = \int_0^\infty t^{s-1}\,e^{-t}\, dt = \lim_{x \to \infty} \gamma(s, x)</math>
s complexEdit
This result extends to complex Template:Mvar. Assume first Template:Math and Template:Math. Then <math display="block">\left|\gamma(s, b) - \gamma(s, a)\right| \le \int_a^b \left|t^{s-1}\right| e^{-t}\, dt = \int_a^b t^{\Re s-1} e^{-t}\, dt \le \int_a^b t e^{-t}\, dt</math> where<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> <math display="block">\left|z^s\right| = \left|z\right|^{\Re s} \, e^{-\Im s\arg z}</math> has been used in the middle. Since the final integral becomes arbitrarily small if only Template:Mvar is large enough, Template:Math converges uniformly for Template:Math on the strip Template:Math towards a holomorphic function,<ref name="class notes" /> which must be Γ(s) because of the identity theorem. Taking the limit in the recurrence relation Template:Math and noting, that lim Template:Math for Template:Math and all Template:Mvar, shows, that Template:Math converges outside the strip, too, towards a function obeying the recurrence relation of the Γ-function. It follows <math display="block">\Gamma(s) = \lim_{x \to \infty} \gamma(s, x)</math> for all complex Template:Mvar not a non-positive integer, Template:Mvar real and Template:Math principal.
Sectorwise convergenceEdit
Now let Template:Mvar be from the sector Template:Math with some fixed Template:Mvar (Template:Math), Template:Math be the principal branch on this sector, and look at <math display="block">\Gamma(s) - \gamma(s, u) = \Gamma(s) - \gamma(s, |u|) + \gamma(s, |u|) - \gamma(s, u).</math>
As shown above, the first difference can be made arbitrarily small, if Template:Math is sufficiently large. The second difference allows for following estimation: <math display="block">\left|\gamma(s, |u|) - \gamma(s, u)\right| \le \int_u^{|u|} \left|z^{s-1} e^{-z}\right| dz = \int_u^{|u|} \left|z\right|^{\Re s - 1} \, e^{-\Im s\,\arg z} \, e^{-\Re z} \, dz,</math> where we made use of the integral representation of Template:Math and the formula about Template:Math above. If we integrate along the arc with radius Template:Math around 0 connecting Template:Mvar and Template:Math, then the last integral is <math display="block">\le R \left|\arg u\right| R^{\Re s - 1}\, e^{\Im s\,|\arg u|}\,e^{-R\cos\arg u} \le \delta\,R^{\Re s}\,e^{\Im s\,\delta}\,e^{-R\cos\delta} = M\,(R\,\cos\delta)^{\Re s}\,e^{-R\cos\delta}</math> where Template:Math is a constant independent of Template:Mvar or Template:Mvar. Again referring to the behavior of Template:Math for large Template:Mvar, we see that the last expression approaches 0 as Template:Mvar increases towards Template:Math. In total we now have: <math display="block">\Gamma(s) = \lim_{|z| \to \infty} \gamma(s, z), \quad \left|\arg z\right| < \pi/2 - \epsilon,</math> if Template:Mvar is not a non-negative integer, Template:Math is arbitrarily small, but fixed, and Template:Math denotes the principal branch on this domain.
OverviewEdit
<math>\gamma(s, z)</math> is:
- entire in Template:Mvar for fixed, positive integer Template:Mvar;
- multi-valued holomorphic in Template:Mvar for fixed Template:Mvar not an integer, with a branch point at Template:Math;
- on each branch meromorphic in Template:Mvar for fixed Template:Math, with simple poles at non-positive integers s.
Upper incomplete gamma functionEdit
As for the upper incomplete gamma function, a holomorphic extension, with respect to Template:Mvar or Template:Mvar, is given by<ref name="auto3"/> <math display="block">\Gamma(s,z) = \Gamma(s) - \gamma(s, z)</math> at points Template:Math, where the right hand side exists. Since <math>\gamma</math> is multi-valued, the same holds for <math>\Gamma</math>, but a restriction to principal values only yields the single-valued principal branch of <math>\Gamma</math>.
When Template:Mvar is a non-positive integer in the above equation, neither part of the difference is defined, and a limiting process, here developed for Template:Math, fills in the missing values. Complex analysis guarantees holomorphicity, because <math>\Gamma(s,z)</math> proves to be bounded in a neighbourhood of that limit for a fixed Template:Mvar.
To determine the limit, the power series of <math>\gamma^*</math> at Template:Math is useful. When replacing <math>e^{-x}</math> by its power series in the integral definition of <math>\gamma</math>, one obtains (assume Template:Mvar,Template:Mvar positive reals for now): <math display="block">\gamma(s, x) = \int_0^x t^{s-1} e^{-t} \, dt = \int_0^x \sum_{k=0}^\infty \left(-1\right)^k \, \frac{t^{s+k-1}}{k!} \, dt = \sum_{k=0}^\infty \left(-1\right)^k \, \frac{x^{s+k}}{k!(s+k)} = x^s\,\sum_{k=0}^\infty \frac{(-x)^k}{k!(s+k)}</math> or<ref name="auto1"/> <math display="block">\gamma^*(s,x) = \sum_{k=0}^\infty \frac{(-x)^k}{k!\,\Gamma(s)(s+k)},</math> which, as a series representation of the entire <math>\gamma^*</math> function, converges for all complex Template:Mvar (and all complex Template:Mvar not a non-positive integer).
With its restriction to real values lifted, the series allows the expansion: <math display="block">\gamma(s, z) - \frac{1}{s} = - \frac{1}{s} + z^s\,\sum_{k=0}^\infty \frac{(-z)^k}{k!(s+k)} = \frac{z^s-1}{s} + z^s\, \sum_{k=1}^\infty \frac{\left(-z\right)^k}{k!(s+k)},\quad \Re(s) > -1, \,s \ne 0.</math>
When Template:Math:<ref>see last eq.</ref> <math display="block">\frac{z^s-1}{s} \to \ln(z),\quad \Gamma(s) - \frac{1}{s} = \frac{1}{s} - \gamma + O(s) - \frac{1}{s} \to -\gamma,</math> (<math>\gamma</math> is the Euler–Mascheroni constant here), hence, <math display="block">\Gamma(0,z) = \lim_{s \to 0}\left(\Gamma(s) - \tfrac{1}{s} - (\gamma(s, z) - \tfrac{1}{s})\right) = -\gamma - \ln(z) - \sum_{k=1}^\infty \frac{(-z)^k}{k\,(k!)}</math> is the limiting function to the upper incomplete gamma function as Template:Math, also known as the exponential integral Template:Nowrap<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>
By way of the recurrence relation, values of <math>\Gamma(-n, z)</math> for positive integers Template:Mvar can be derived from this result,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> <math display="block">\Gamma(-n, z) = \frac{1}{n!} \left(\frac{e^{-z}}{z^n} \sum_{k = 0}^{n - 1} (-1)^k (n - k - 1)! \, z^k + \left(-1\right)^n \Gamma(0, z)\right)</math> so the upper incomplete gamma function proves to exist and be holomorphic, with respect both to Template:Mvar and Template:Mvar, for all Template:Mvar and Template:Math.
<math>\Gamma(s, z)</math> is:
- entire in Template:Mvar for fixed, positive integral Template:Mvar;
- multi-valued holomorphic in Template:Mvar for fixed Template:Mvar non zero and not a positive integer, with a branch point at Template:Math;
- equal to <math>\Gamma(s)</math> for Template:Mvar with positive real part and Template:Math (the limit when <math>(s_i,z_i) \to (s, 0)</math>), but this is a continuous extension, not an analytic one (does not hold for real Template:Math!);
- on each branch entire in Template:Mvar for fixed Template:Math.
Special valuesEdit
- <math>\Gamma(s+1,1) = \frac{\lfloor e s! \rfloor}{e} </math> if Template:Mvar is a positive integer,
- <math>\Gamma(s,x) = (s-1)!\, e^{-x} \sum_{k=0}^{s-1} \frac{x^k}{k!}</math> if Template:Mvar is a positive integer,<ref>Template:Mathworld (equation 2)</ref>
- <math> \Gamma(s,0) = \Gamma(s), \Re(s) > 0</math>,
- <math>\Gamma(1,x) = e^{-x}</math>,
- <math>\gamma(1,x) = 1 - e^{-x}</math>,
- <math>\Gamma(0,x) = -\operatorname{Ei}(-x)</math> for <math>x > 0</math>,
- <math>\Gamma(s,x) = x^s \operatorname{E}_{1-s}(x)</math>,
- <math>\Gamma\left(\tfrac{1}{2}, x\right) = \sqrt\pi \operatorname{erfc}\left(\sqrt x\right)</math>,
- <math>\gamma\left(\tfrac{1}{2}, x\right) = \sqrt\pi \operatorname{erf}\left(\sqrt x\right)</math>.
Here, <math>\operatorname{Ei}</math> is the exponential integral, <math>\operatorname{E}_n</math> is the generalized exponential integral, <math>\operatorname{erf}</math> is the error function, and <math>\operatorname{erfc}</math> is the complementary error function, <math>\operatorname{erfc}(x) = 1 - \operatorname{erf}(x)</math>.
Asymptotic behaviorEdit
- <math>\frac{\gamma(s,x)}{x^s} \to \frac{1}{s}</math> as <math>x \to 0</math>,
- <math>\frac{\Gamma(s,x)}{x^s} \to -\frac{1}{s}</math> as <math>x \to 0</math> and <math>\Re (s) < 0</math> (for real Template:Math, the error of Template:Math is on the order of Template:Math if Template:Math and Template:Math if Template:Math),
- <math>\Gamma(s,x) \sim \Gamma(s) - \sum_{n=0}^\infty (-1)^n \frac{x^{s+n}}{n!(s+n)}</math> as an asymptotic series where <math>x\to0^+</math> and <math>s\neq 0,-1,-2,\dots</math>.<ref name="auto">Template:Cite book</ref>
- <math>\Gamma(-N,x) \sim C_N + \frac{(-1)^{N+1}}{N!} \ln x - \sum_{n=0,n\ne N}^\infty (-1)^n \frac{x^{n-N}}{n!(n-N)}</math> as an asymptotic series where <math>x \to 0^+</math> and <math>N = 1, 2, \dots</math>, where <math display="inline">C_N = \frac{(-1)^{N+1}}{N!} \left( \gamma - \displaystyle\sum_{n=1}^N \frac{1}{n} \right)</math>, where <math>\gamma</math> is the Euler-Mascheroni constant.<ref name="auto"/>
- <math>\gamma(s,x) \to \Gamma(s)</math> as <math>x \to \infty</math>,
- <math>\frac{\Gamma(s,x)}{x^{s-1} e^{-x}} \to 1</math> as <math>x \to \infty</math>,
- <math>\Gamma(s,z) \sim z^{s-1} e^{-z} \sum_{k=0} \frac {\Gamma(s)} {\Gamma(s-k)} z^{-k}</math> as an asymptotic series where <math>|z| \to \infty</math> and <math>\left|\arg z\right| < \tfrac{3}{2} \pi</math>.<ref>{{#invoke:citation/CS1|citation
|CitationClass=web }}</ref>
Evaluation formulaeEdit
The lower gamma function can be evaluated using the power series expansion:<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> <math display="block">\gamma(s, z) = \sum_{k=0}^\infty \frac{z^s e^{-z} z^k}{s (s+1) \dots (s+k)}=z^s e^{-z}\sum_{k=0}^\infty\dfrac{z^k}{s^{\overline{k+1}}}</math> where <math>s^{\overline{k+1}}</math> is the Pochhammer symbol.
An alternative expansion is <math display="block">\gamma(s,z)= \sum_{k=0}^\infty \frac{(-1)^k}{k!} \frac{z^{s+k}}{s+k}= \frac{z^s}{s} M(s, s+1,-z),</math> where Template:Math is Kummer's confluent hypergeometric function.
Connection with Kummer's confluent hypergeometric functionEdit
When the real part of Template:Mvar is positive, <math display="block">\gamma(s,z) = s^{-1} z^s e^{-z} M(1,s+1,z)</math> where <math display="block"> M(1, s+1, z) = 1 + \frac{z}{(s+1)} + \frac{z^2}{(s+1)(s+2)} + \frac{z^3}{(s+1)(s+2)(s+3)} + \cdots</math> has an infinite radius of convergence.
Again with confluent hypergeometric functions and employing Kummer's identity, <math display="block">\begin{align} \Gamma(s,z) &= e^{-z} U(1-s,1-s,z) = \frac{z^s e^{-z}}{\Gamma(1-s)} \int_0^\infty \frac{e^{-u}}{u^s (z+u)} du \\ &= e^{-z} z^s U(1,1+s,z) = e^{-z} \int_0^\infty e^{-u} (z+u)^{s-1} du = e^{-z} z^s \int_0^\infty e^{-z u} (1+u)^{s-1} du. \end{align}</math>
For the actual computation of numerical values, Gauss's continued fraction provides a useful expansion: <math display="block"> \gamma(s, z) = \cfrac{z^s e^{-z}}{s - \cfrac{s z}{s+1 + \cfrac{z}{s+2 - \cfrac{(s+1)z} {s+3 + \cfrac{2z}{s+4 - \cfrac{(s+2)z}{s+5 + \cfrac{3z}{s+6 - \ddots}}}}}}}. </math>
This continued fraction converges for all complex Template:Mvar, provided only that Template:Mvar is not a negative integer.
The upper gamma function has the continued fraction<ref>Abramowitz and Stegun p. 263, 6.5.31</ref> <math display="block"> \Gamma(s, z) = \cfrac{z^s e^{-z}}{z+\cfrac{1-s}{1 + \cfrac{1}{z + \cfrac{2-s} {1 + \cfrac{2}{z+ \cfrac{3-s}{1+ \ddots}}}}}} </math> andTemplate:Citation needed <math display="block"> \Gamma(s, z)= \cfrac{z^s e^{-z}}{1+z-s+ \cfrac{s-1}{3+z-s+ \cfrac{2(s-2)}{5+z-s+ \cfrac{3(s-3)} {7+z-s+ \cfrac{4(s-4)}{9+z-s+ \ddots}}}}} </math>
Multiplication theoremEdit
The following multiplication theorem holds trueTemplate:Citation needed: <math display="block">\Gamma(s,z) = \frac 1 {t^s} \sum_{i=0}^{\infty} \frac{\left(1-\frac 1 t \right)^i}{i!} \Gamma(s+i,t z) = \Gamma(s,t z) -(t z)^s e^{-t z} \sum_{i=1}^{\infty} \frac{\left(\frac 1 t-1 \right)^i}{i} L_{i-1}^{(s-i)}(t z).</math>
Software implementationEdit
The incomplete gamma functions are available in various of the computer algebra systems.
Even if unavailable directly, however, incomplete function values can be calculated using functions commonly included in spreadsheets (and computer algebra packages). In Excel, for example, these can be calculated using the gamma function combined with the gamma distribution function.
- The lower incomplete function: <math> \gamma(s, x) </math>
= EXP(GAMMALN(s))*GAMMA.DIST(x,s,1,TRUE)
. - The upper incomplete function: <math> \Gamma(s, x) </math>
= EXP(GAMMALN(s))*(1-GAMMA.DIST(x,s,1,TRUE))
.
These follow from the definition of the gamma distribution's cumulative distribution function.
In Python, the Scipy library provides implementations of incomplete gamma functions under <syntaxhighlight lang="text" class="" style="" inline="1">scipy.special</syntaxhighlight>, however, it does not support negative values for the first argument. The function <syntaxhighlight lang="text" class="" style="" inline="1">gammainc</syntaxhighlight> from the mpmath library supports all complex arguments.
Regularized gamma functions and Poisson random variablesEdit
Two related functions are the regularized gamma functions: <math display="block">\begin{align} P(s,x) &= \frac{\gamma(s,x)}{\Gamma(s)}, \\[1ex] Q(s,x) &= \frac{\Gamma(s,x)}{\Gamma(s)} = 1 - P(s,x). \end{align}</math> <math>P(s,x)</math> is the cumulative distribution function for gamma random variables with shape parameter <math>s</math> and scale parameter 1.
When <math>s</math> is an integer, <math>Q(s+1, \lambda)</math> is the cumulative distribution function for Poisson random variables: If <math>X</math> is a <math>\mathrm{Poi}(\lambda)</math> random variable then <math display="block"> \Pr(X \leq s) = \sum_{i \leq s} e^{-\lambda} \frac{\lambda^i}{i!} = \frac{\Gamma(s+1,\lambda)}{\Gamma(s+1)} = Q(s+1,\lambda).</math>
This formula can be derived by repeated integration by parts.
In the context of the stable count distribution, the <math> s </math> parameter can be regarded as inverse of Lévy's stability parameter <math> \alpha</math>: <math display="block"> Q(s,x) = \int_0^\infty e^{\left( -{x^s}/{\nu} \right)} \, \mathfrak{N}_{{1}/{s}}\left(\nu\right) \, d\nu , \quad (s > 1)</math> where <math>\mathfrak{N}_{\alpha}(\nu)</math> is a standard stable count distribution of shape <math> \alpha = 1/s < 1</math>.
<math>P(s,x)</math> and <math>Q(s, x)</math> are implemented as gammainc
<ref>{{#invoke:citation/CS1|citation
|CitationClass=web
}}</ref> and gammaincc
<ref>{{#invoke:citation/CS1|citation
|CitationClass=web
}}</ref> in scipy.
DerivativesEdit
Using the integral representation above, the derivative of the upper incomplete gamma function <math> \Gamma (s,x) </math> with respect to Template:Mvar is <math display="block"> \frac{\partial \Gamma (s,x) }{\partial x} = - x^{s-1} e^{-x}</math> The derivative with respect to its first argument <math>s</math> is given by<ref>K.O. Geddes, M.L. Glasser, R.A. Moore and T.C. Scott, Evaluation of Classes of Definite Integrals Involving Elementary Functions via Differentiation of Special Functions, AAECC (Applicable Algebra in Engineering, Communication and Computing), vol. 1, (1990), pp. 149–165, [1] </ref> <math display="block">\frac{\partial \Gamma (s,x) }{\partial s} = \ln x \Gamma (s,x) + x\,T(3,s,x)</math> and the second derivative by <math display="block">\frac{\partial^2 \Gamma (s,x) }{\partial s^2} = \ln^2 x \Gamma (s,x) + 2 x \left[\ln x\,T(3,s,x) + T(4,s,x) \right]</math> where the function <math>T(m,s,x)</math> is a special case of the Meijer G-function <math display="block">T(m,s,x) = G_{m-1,\,m}^{\,m,\,0} \!\left( \left. \begin{matrix} 0, 0, \dots, 0 \\ s-1, -1, \dots, -1 \end{matrix} \; \right| \, x \right).</math> This particular special case has internal closure properties of its own because it can be used to express all successive derivatives. In general, <math display="block">\frac{\partial^m \Gamma (s,x) }{\partial s^m} = \ln^m x \Gamma (s,x) + m x\,\sum_{n=0}^{m-1} P_n^{m-1} \ln^{m-n-1} x\,T(3+n,s,x)</math> where <math> P_j^n </math> is the permutation defined by the Pochhammer symbol: <math display="block">P_j^n = \binom{n}{j} j! = \frac{n!}{(n-j)!}.</math> All such derivatives can be generated in succession from: <math display="block">\frac{\partial T (m,s,x) }{\partial s} = \ln x ~ T(m,s,x) + (m-1) T(m+1,s,x)</math> and <math display="block">\frac{\partial T (m,s,x) }{\partial x} = -\frac{T(m-1,s,x) + T(m,s,x)}{x}</math> This function <math>T(m,s,x)</math> can be computed from its series representation valid for <math> |z| < 1 </math>, <math display="block">T(m,s,z) = - \frac{\left(-1\right)^{m-1} }{(m-2)! } \left.\frac{d^{m-2} }{dt^{m-2} } \left[\Gamma (s-t) z^{t-1}\right]\right|_{t=0} + \sum_{n=0}^{\infty} \frac{\left(-1\right)^n z^{s-1+n}}{n! \left(-s-n\right)^{m-1} }</math> with the understanding that Template:Mvar is not a negative integer or zero. In such a case, one must use a limit. Results for <math> |z| \ge 1 </math> can be obtained by analytic continuation. Some special cases of this function can be simplified. For example, <math>T(2,s,x)=\Gamma(s,x)/x</math>, <math>x\,T(3,1,x) = \mathrm{E}_1(x)</math>, where <math>\mathrm{E}_1(x)</math> is the Exponential integral. These derivatives and the function <math>T(m,s,x)</math> provide exact solutions to a number of integrals by repeated differentiation of the integral definition of the upper incomplete gamma function.<ref>Template:Cite journal</ref><ref>Template:Cite arXiv, App B</ref> For example, <math display="block"> \int_{x}^{\infty} \frac{t^{s-1} \ln^m t}{e^t} dt= \frac{\partial^m}{\partial s^m} \int_{x}^{\infty} \frac{t^{s-1}}{e^t} dt = \frac{\partial^m}{\partial s^m} \Gamma (s,x)</math> This formula can be further inflated or generalized to a huge class of Laplace transforms and Mellin transforms. When combined with a computer algebra system, the exploitation of special functions provides a powerful method for solving definite integrals, in particular those encountered by practical engineering applications (see Symbolic integration for more details).
Indefinite and definite integralsEdit
The following indefinite integrals are readily obtained using integration by parts (with the constant of integration omitted in both cases): <math display="block">\begin{align} \int x^{b-1} \gamma(s,x) \, dx &= \frac{1}{b} \left( x^b \gamma(s,x) - \gamma(s+b,x) \right), \\[1ex] \int x^{b-1} \Gamma(s,x) \, dx &= \frac{1}{b} \left( x^b \Gamma(s,x) - \Gamma(s+b,x) \right). \end{align}</math> The lower and the upper incomplete gamma function are connected via the Fourier transform: <math display="block">\int_{-\infty}^\infty \frac {\gamma\left(\frac s 2, z^2 \pi \right)} {(z^2 \pi)^\frac s 2} e^{-2 \pi i k z} dz = \frac {\Gamma\left(\frac {1-s} 2, k^2 \pi \right)} {(k^2 \pi)^\frac {1-s} 2}.</math> This follows, for example, by suitable specialization of Template:Harv.
NotesEdit
<references/>
ReferencesEdit
- Template:AS ref {{#invoke:citation/CS1|citation
|CitationClass=web }} §6.5.
- Template:Cite journal
- Template:Cite journal
- G. Arfken and H. Weber. Mathematical Methods for Physicists. Harcourt/Academic Press, 2000. (See Chapter 10.)
- Template:Cite journal
- Template:Cite journal
- Template:Cite journal
- Template:Cite journal
- Template:Cite journal (See also www.netlib.org/toms/654).
- Template:Cite journal
- Template:Cite journal
- Template:Cite journal
- Template:Cite book
- Template:Cite journal
- Template:Springer
- Template:Cite journal
- Template:Cite journal
- Template:Dlmf
- Template:Cite journal
- Template:Cite book
- Template:Cite journal
- Template:Cite journal
- Template:Cite journal
- Template:Cite journal
- Template:Cite journal
- Template:Cite journal
- Template:Cite conference
- {{#invoke:Template wrapper|{{#if:|list|wrap}}|_template=cite web
|_exclude=urlname, _debug, id |url = https://mathworld.wolfram.com/{{#if:IncompleteGammaFunction%7CIncompleteGammaFunction.html}} |title = Incomplete Gamma Function |author = Weisstein, Eric W. |website = MathWorld |access-date = |ref = Template:SfnRef }} Template:Refend
External linksEdit
- <math>P(a,x)</math> — Regularized Lower Incomplete Gamma Function Calculator
- <math>Q(a,x)</math> — Regularized Upper Incomplete Gamma Function Calculator
- <math>\gamma(a,x)</math> — Lower Incomplete Gamma Function Calculator
- <math>\Gamma(a,x)</math> — Upper Incomplete Gamma Function Calculator
- formulas and identities of the Incomplete Gamma Function functions.wolfram.com