# Setting rules for Gamma functions

I have some expressions involving lots of Gamma functions. Now the arguments of the functions sometime go to zero, in which case I want to use the factorial instead of the Gamma function (since it diverges for 0). As an example:

C2 [l_, s_, w_, m_, a_] = Simplify[((-1)^(l - s) (Gamma[1 - s - 2 I Q[w, m, a]] Gamma[l] Gamma[1 - l] Gamma[1 + s + l])/(Gamma[2 + 2 l] Gamma[2 - l] Gamma[-l - 2 I Q[w, m, a]] Gamma[l - 1]))]

For the values s = 0, l = 1 I get Complex Infinity as the result because I have Gamma[0] in both the numerator and denominator. However, I want to set a rule such that Gamma[x] = 1 when x = 0. Is that possible?

• It's possible, just Unprotect the symbol Gamma you can define your rule for it. But that's a bit dangerous(may cause internal error, for example). The recommended way is defining a new function, like, myGamma[any_] := Gamma[any]; myGamma[0] = 1;. Or use Limit: Limit[C2[l, s, w, m, a], {l, s} -> {1, 0}] Commented Nov 2, 2021 at 9:42