# Gamma Function

1. Jul 20, 2009

### S_David

Hello all,

Is there any way to make the Gamma function $$\Gamma[z]$$ defined at z=0? Because in my calculations, I have a single case among many other cases where the argument of the gamma function equals zero.

Regards

2. Jul 20, 2009

### Santa1

How did you arrive at Gamma(0) in your calculations?

3. Jul 20, 2009

### S_David

I used table of integrals for a specific form where it has the condidtion $$\mu>v$$, but I have a case when $$\mu=v$$, so I guess because of this I got Gamma[0].

4. Jul 20, 2009

### g_edgar

$$\Gamma$$ has a pole at $$0$$. So maybe you need to do some residue calculation taking into account a zero in some other factor?

5. Jul 20, 2009

### S_David

How? Give me a simple example, if possible, please?

6. Jul 20, 2009

### Mute

It would probably be easier if you posted the integral. From what you've posted so far it's not clear if

a) the gamma function appears in the integrand or

b) as part of the solution of the integral.

I would guess it's case b), in which case since the solution of the integral is only valid for u > v, you would need to redo the integral for the case u = v - if the integral is even finite, that is. It could also be the case that the integral diverges for u = v, in which case Gamma(0) diverging gives the correct result.

If case a), then either you need something else in the integrand that can kill the divergence of the Gamma function a la L'Hopital's rule, or the derivation of the integral itself needs to be redone as you might get a different integral to evaluate if u = v.

7. Jul 20, 2009

### S_David

Your guess was right, the Gamma function appears as a part of the solution of the integral. I used this integral from the table of integrals:

$$\int_0^{\infty}x^{\mu-1}\text{e}^{-\alpha\,x}K_v\left(\beta\,x\right)\,dx=\frac{\sqrt{\pi}(2\beta)^v}{(\alpha+\beta)^{\mu+v}}\frac{\Gamma(\mu+v)\Gamma(\mu-v)}{\Gamma(\mu+0.5)}F\left(\mu+v,v+0.5;\mu+0.5;\frac{\alpha-\beta}{\alpha+\beta}\right)$$

The conditions are: $$\text{Re}\{\mu\}>\text{Re}\{v\}\text{ and }\text{Re}\{\alpha+\beta\}>0$$

where $$K_v(.)$$ is the modified Bessel function of the second kind and $$v^{th}$$ order, and $$F(,;;)$$ is the Gauss hypergeometric function. But in my case, I have a situation where $$\mu=v$$. Can anything be done to overcome this problem?

Regards

8. Jul 21, 2009

### g_edgar

Say you want $$z\Gamma(z)$$ at $$z=0$$ ... In this case you could use L'Hopital's rule, but let me do it another way to illustrate what I was talking about.
The Laurent series of $$\Gamma(z)$$ at $$0$$ is:
$$\Gamma(z) = \frac{1}{z}-\gamma+ \left( 1/12\,{\pi }^{2}+1/2\,{\gamma}^{2} \right) z+\dots$$
where $$\gamma$$ is Euler's constant. The first numerator $$1$$ is the residue calculation that is important here. Therefore $$z\Gamma(z)$$ looks like $$1 - \gamma z + \dots$$, so you know how it behaves at $$0$$.

9. Jul 21, 2009

### S_David

But, how can I do that in my case? I mean I have $$\Gamma[z]$$ which can be re-written as: $$z\Gamma[z-1]$$ , so the pole is now at z=1. How to solve this?

Regards

10. Jul 21, 2009

### g_edgar

$$\Gamma(z-1)$$ has a simple pole at $$1$$ with residue $$1$$, and $$z$$ has value $$1$$ at $$z=1$$, so $$z\Gamma(z-1)$$ has a pole at $$z=1$$ with residue $$1$$.

But you are wrong ... $$\Gamma(z) \ne z\Gamma(z-1)$$. If you want $$\Gamma(z) = (z-1)\Gamma(z-1)$$, note that $$z-1$$ has a zero at $$z=1$$ so do what I did before to conclude that $$\Gamma(z)$$ is regular at $$z=1$$ with value $$1$$

11. Jul 22, 2009

### S_David

Yes you are right, $$\Gamma[z]=(z-1)!=(z-1)\Gamma[z-1]$$. So, if we re-write $$\Gamma[z]$$ as $$(z-1)\Gamma[z-1]$$, then we eliminate the problem mathematically, don't we?

Regards

12. Jul 22, 2009

### uart

David I think the integral just diverges for $\mu \leq v$ and that's it.

The convergence problems all happen as x goes to zero (the "x goes to infinity" end is no problem for this integrand). I'm pretty sure that if you look at the limiting behaviour of $K_v(x)$ as x goes to zero you'll find it approaches ${\rm const} / x^v$. So the part that's causing the problem basically reduces to something like,

$${\rm const} \, \int_{x=0}^{+\epsilon} x^{(u-v)-1} \, dx$$.

It just diverges for $\mu \leq v$.

13. Jul 23, 2009

### S_David

I am not deeply involved in mathematics, but what if I write $$\Gamma[0]$$ as $$\Gamma[0^+]$$, where $$0<0^+<10^{-12}$$? Is this a valid step?

Regards

14. Jul 23, 2009

### Mute

As uart said, the integral appears to diverge as x -> 0 if $\mu \leq \nu$, so no amount of playing tricks like replacing 0 with $0^+$ is going to save it from diverging. "$\Gamma(0^+)$" is still arbitrarily large.

If you were actually deriving something that led to the integral

$$\int_0^\infty dx~x^{-\mu-1}e^{-\alpha x}K_\mu(\beta x)$$

then it looks like either you need to doublecheck the derivation that lead to that integral to make sure you didn't make any mistakes which gave you a divergent integral, or there needs to be some sort of cutoff imposed at the lower end of the integral to keep it finite (but taking that cutoff to zero after doing the integral would again lead to an infinite result).

15. Jul 23, 2009

### S_David

I am almost sure about the derivation 98%, but I will check again later to make it 100%. But can you explain to me what do you mean by "cutoff"? and can not we simply discard the case when the integral diverges? Since I have multiple sums inside each others, whose indices are involved in the integral, and just one case of all possible combinations is not satisfied.

Regards

16. Jul 24, 2009

### Mute

By cutoff I meant replacing the lower limit of integration with a finite lower bound, which would prevent the integral from diverging but gives you this odd cutoff there that you don't really want in your calculations.

Now, since you say that the integral in question occurs inside a multiple sum where the indices, this raises some other possibilities. I suppose for some reason the divergent case could be thrown out, but it can't legitimately be thrown out on the basis of it diverging. You could leave it out and see if the results you get match what you should be getting.

i) You're absolutely sure you should be getting a finite result?

ii) Is there anything in your derivation that should have restricted $\mu > \nu$, thus preventing the problem entirely?

iii) At any point in your derivation, did you interchange the order of integration and summation?

This last point could be very important, as it is not always valid to do so! If you did that, then you may need to carefully check whether or not that was a valid move. Typically in many physical problems there's no trouble doing that, but in principle such a move could potentially be the source of the diverging term.

17. Jul 24, 2009

### S_David

Dear Mute,

I have the following integral:

$$\int_0^{\infty}\gamma^{N_A+k-1}\,\text{e}^{-\gamma(\sigma_{A,j}-s)} \,K_{(n+1)}\left(2\,\alpha_{j}\,\gamma\right)\,d\gamma$$
Based on the table of integrals
$$N_A+k\text{ must be greater than }n+1$$
where
$$n=0,1,\ldots,N_A+k-1$$
So, in all cases, except for max of n, the condition is satisfied.

By the way, I tried to include the divergence case by replacing the 0 in the Gamma function by $$0^+$$, and I compared it with the result when I completely excluded the divergence case, they were the same, at least for the first 6-7 digits (the default precision in Mathematica).

The results are as expected, decaying smoothely, and between 0 and 1.

Based on these information, is it valid to exclude the divergence case?

Best regards

18. Jul 27, 2009

### Mute

What exactly is the sum you're trying to compute? And not just the sum - any terms multiplying the sum if you used those in the computation you did on mathematica. It's hard to tell what could be causing your problems if we don't have enough information. Given only the divergent integral we can only really say the integral diverges.

You say you have a sum over this general integral and it looks like one of the terms diverges, but yet when you compute it numerically the divergent term doesn't seem to matter? That seems odd, and I'd be hesitant to just toss the term out and continue without being fairly sure of why I'm getting the results I'm getting.

19. Jul 27, 2009

### S_David

Actually, all the sums appear are from binomial and multinomial expansions.