0
$\begingroup$

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?

$\endgroup$
1
  • $\begingroup$ 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}] $\endgroup$
    – RungeC
    Commented Nov 2, 2021 at 9:42

1 Answer 1

1
$\begingroup$

You could try something like

C2[l_, s_, w_, m_, a_] := Block[{Gamma = myGamma}, 
  FullSimplify[((-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]))]
];
C2[1, 0, w, m, a]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.