Lower and upper incomplete gamma function

7 次查看(过去 30 天)
In a book, which name is 'Table of integrals series and products' of 'I.S. Gradshteyn and I.M. Ryzhik' Seventh edition, The solution of integration has been given in Eq. (3.351.1) as:
Int = \int\limits_0^u {{x^n}{e^{ - \mu x}}dx} = \frac{{n!}}{{{\mu ^{n + 1}}}} - {e^{ - \mu u}}\sum\limits_{k = 0}^n {\frac{{n!}}{{k!}}\frac{{{u^k}}}{{{\mu ^{n - k + 1}}}} = {\mu ^{ - n - 1}}\gamma \left( {n + 1,\mu u} \right)}. [u>0, Re \mu>0, n=0,1,2,3.....]
In this solution, the integral value of the second part has two solutions, given in the 3rd and 4th part. The integral value of the second part is the exact match with its solution with the 3rd part, but it does not match with the next solution given in the 4th part in terms of the incomplete gamma function. Why does the integral solution of a 2nd part not match with the 4th part, while 4th is also a solution of a 2dn part? Please, someone, help me to solve my problem. I plot in MATLAB as:
The MATLAB code is
clearvars;
close all;
clc;
Al1=1:10;mu=2;n=5;
int1=zeros(1,length(Al1));
int2=zeros(1,length(Al1));
int3=zeros(1,length(Al1));
for a=1:length(Al1)
Al=Al1(a);
f=@(x)((x.^n).*exp(-mu*x));% f(x)=x^n*exp(-mu*x);
int1(a)=integral(f, 0, Al);
int2(a)=mu^(-n-1)*gammainc(n+1,mu*Al);D1=0;
for b=0:n
m=b;
d1=(factorial(n)/factorial(m))*((Al^m)/(mu^(n-m+1)));
D1=D1+d1;
end
int3(a)=factorial(n)/(mu^(n+1))-(exp(-mu*Al)*D1);
end
semilogy(Al1, int1, '-*k');
hold on;grid on;
semilogy(Al1, int2, '-o');
hold on;grid on;
semilogy(Al1, int3, '-^r');
hold on;grid on;
<<
>>

采纳的回答

David Goodmanson
David Goodmanson 2018-11-3
Hi Shashibhushan,
A couple of things. First, the calling variable order to gammainc needs to be reversed. Second, Matlab gammainc includes and extra factor of 1/gamma compared to G&R, see doc gammainc. The line
int2(a)=gamma(n+1)*mu^(-n-1)*gammainc(mu*Al,n+1);
works.
  2 个评论
Shashibhushan Sharma
Dear David,
A very Very thanks, sir! In your comment, what is G&R? Your given code is correctly working. I also understood the meaning of gammainc(.) in MATLAB.
David Goodmanson
David Goodmanson 2018-11-4
I was referring to Gradshteyn and Ryzhik, the book you cited.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Gamma Functions 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by