0
$\begingroup$

Gamma Function is known to be : Source

enter image description here

first i plot the function

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

enter image description here

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. enter image description here

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

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]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.