# NIntegrate[] Gamma Function

Gamma Function is known to be : Source

first i plot the function

z = 1;
f[t_] := (t^(z - 1))/Exp[-t];
gamma = Plot[Gamma[g], {g, 1.0, 5.0}]


then, i NIntegrate[] Gamma Function and ListPlot[] it

h[b_] := \!$$\*SubsuperscriptBox[\(\[Integral]$$, $$0$$, $$b$$]$$f[ t] \[DifferentialD]t$$\);
table = Table[h[b], {b, 1.0, 5.0, 0.05}]

lp = ListPlot[table];
Show[lp,gamma]


the graph should be satisfies each other but this is what i got. the lp graph is much bigger.

• Use Table[{b, h[b]}, {b, 1.0, 5.0, 0.05}] – Vaclav Kotesovec May 2 '16 at 10:21
• Please post code in input form. See this meta Q&A for help. – Michael E2 May 2 '16 at 12:15

If you trying to compare the built in Gamma function with the integral definition of $\Gamma(z)$ then first define it properly

myGamma[z_] :=
Simplify[Integrate[(t^(z - 1))*Exp[-t], {t, 0, Infinity}],
Assumptions -> Re[z] > 0];


Then we can check & see that they agree.

Clear[z];
Gamma[z] == myGamma[z]
(*True*)


If you want to see it graphically

data1 = Table[{z, myGamma[z]}, {z, 1, 5, 0.05}];
lp1 = ListPlot[data1, PlotStyle -> Red];
gamma = Plot[Gamma[g], {g, 1.0, 5.0}];
Show[{lp1, gamma},Frame -> True]