I. Theoretical Analysis

Gamma Function is defined in the following,

Using integration by parts, one sees that:

From the above calculation,and note that

where .

If is a positive integer, one can obtain:


Integral calculus(

If it meets a condition , obviously given that,

Calculate quadratic ,

Using integration by polar coordinates, , and,

then, one sees that


II. Numerical analysis

Evaluate Gamma function in matlab.

1.Evaluate the gamma function with a scalar and a vector.

>> y = gamma(0.5)

y =

>> y = gamma(-pi:pi)

y = 

    1.0157   -3.1909    6.8336   -7.8012    1.1046    0.9482    1.7621

2.Plot the gamma function and its inverse.

% PlotGammaFunctionExample.m
hold on
fplot(@(x) 1./gamma(x))
hold off
grid on


alt text

In addition, the domain of the gamma function extends to negative real numbers by analytic continuation, with simple poles at the negative integers. This extension arises from repeated application of the recursion relation

More information see here.

Related article maybe useful to you: