how to do integration for gamma function with limits

clc
clear all
syms x
int(gamma(x),x,0,1)

9 Commenti

Hi M^2,
This doesn't seem likely to have an explicit solution, even with different limits of integration than 0 to 1. gamma(x) has a pole with residue 1 at x=0 and hence behaves like 1/x near the + side of the origin. So the integral from 0 to any positive x will diverge.
Thank you for giving reply but in one research paper he has applied integration and published results too. In that paper he has used matlab only. Can i send whole code to you?
It is a bit difficult to evaluate below 10^-53 as the lower bound, but in that area, the integral is increasing for each additional power of 10 that I push it.
10^-52 : 119.487730
10^-53 : 121.790316
10^-54 : 124.092901
10^-55 : 126.395486
Interesting, this is looking like a constant 2.3025851 for each additional digit -- which is log(10) . The integral is looking to be just a bit more than -log10(10^-N) for 10^-N in my test, which is log10(x) ... and since log10(0) is infinity then as you got to 0 as the lower bound, the integral would be infinite.
This is not a removable discontinuity across 0. limit(gamma(x),x=0+) is +infinity but limit(gamma(x),x=0-) is -infinity.
gamma(z) = gamma(1+z)/z
Integral(gamma(z)) = Integral(gamma(z+1)/z -1/z + 1/z)
= Integral(gamma(z+1)-1)/z) + log(z)
Taking a look at the integrand numerator: Since gamma(1) = 1, (gamma(z+1)-1) is 0 when z = 0. Consequently (gamma(z+1)-1)/z equals a constant at z = 0. The integrand is bounded, so the integral can be integrated all the way down to small z with no problem. All the singular behavior is in the log term at the end. This says that
I = Integral{small,1} gamma(z) dz = C + log(z) |{small,1}
I = C -log(small) % the result
where
C = Integral{small,1} (gamma(z+1)-1)/z)
is a slowly varying function of 'small'. So as a check it should be true that
I + log(small) = C % slowly varying
I can't integrate down as close to zero as Walter, but
C = integral(@(x) gamma(x),1e-23,1) +log(1e-23)
C = -0.246695210286852
C = integral(@(x) gamma(x),1e-22,1) +log(1e-22)
C = -0.246690599165717
Unfortunately, although the basic idea is demonstrated, the result for 1e-52 is
I = -log(1e-52) - .24669
I = 119.4877
compared to Walter's 'about 121'.
I revised after my "about 121" and gave more exact values. 119.4877 is excellent agreement.
clc
clear all
syms c0 c1 c2 c3 t g2 g3
alp=(5+sin(t))/4 % alpha(t)
f=(gamma(7/2)*t^(5/2-alp))/gamma(7/2-alp)+5/2*cos(t)*t^(3/2)+t^8-t^5*exp(t) %f(t)
C=[c0 c1 c2 c3]; % C^T
S=[1;t;t^(2+g2);t^(3+g3)];
S1=[1;t^2;t^(4+g2);t^(6+g3)];
H=[1 0 0 0;0 1 0 0;0 0 3 -3;0 0 0 1];
U=C*H*S % u(t)
D1=[0 0 0 0;0 1/t 0 0;0 0 (2+g2)/t 0;0 0 0 (3+g3)/t]
D2=t^(-alp)*[0 0 0 0;0 0 0 0;0 0 gamma(3+g2)/gamma(3-alp+g2) 0;0 0 0 gamma(4+g3)/gamma(4-alp+g3)]
eqn1=subs(U,t,0) % boundary condition
eqn2=subs(U,t,1)-1 % boundary condition
R=C*H*[D2*S+cos(t)*D1*S-exp(t)*S1]+t^3*(C*H*S)^2-f;
M=int(R^2,t,0,1)
I need to calculate the value of M can anyone help me to do this.
It is not realistic that you would be able to find a closed form integral for that. You have t to unknown powers that are not guaranteed to be positive integers or even real-valued, and you have t^(-alp) where alp is an expression involving sin(t).
It is not even possible to find a closed form expression for int(t^sin(t), t, 0, 1)

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Mathematics in Centro assistenza e File Exchange

Richiesto:

il 14 Lug 2020

Commentato:

il 25 Lug 2020

Community Treasure Hunt

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

Start Hunting!

Translated by