Lower and upper incomplete gamma function

조회 수: 11 (최근 30일)
Shashibhushan Sharma
Shashibhushan Sharma 2018년 11월 3일
댓글: David Goodmanson 2018년 11월 4일
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;
<<
>>
  댓글 수: 2
John D'Errico
John D'Errico 2018년 11월 3일
Please learn to format your pasted in code so it is readable. I did it for you here.
Shashibhushan Sharma
Shashibhushan Sharma 2018년 11월 3일
Thank you, sir.

댓글을 달려면 로그인하십시오.

채택된 답변

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
Shashibhushan Sharma 2018년 11월 3일
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