|
From: Barton W. <wi...@un...> - 2022-07-21 03:06:30
|
First waffle:
(%i122) load("opsubst")$
(%i123) gamma_product_simp(e):=block([a : map('first, gatherargs(e,'gamma))],
for ak in a do (
if not featurep(ak,'integer) then e : ratsubst(%pi/sin(%pi*ak),gamma(ak)*gamma(1-ak),e)),
a : map('first, gatherargs(e,'gamma)),
for ak in a do (
e : ratsubst(gamma(2*ak), gamma(x)*gamma((2*x+1)/2),e)),
e)$
(%i124) gamma_product_simp(gamma(2/3)*gamma(1/3));
(%o124) (2*%pi)/sqrt(3)
(%i125) gamma_product_simp(gamma(x)*gamma(x+1/2));
(%o125) gamma(2*x)
Many things to ponder—the order of the substitutions, ratsubst or fullratsubst, featurep vs askinteger vs … the Legendre triplication formula, and what else?
From: Oscar Benjamin<mailto:osc...@gm...>
Sent: Wednesday, July 20, 2022 4:29 PM
To: Raymond Toy<mailto:toy...@gm...>
Cc: <max...@li...><mailto:max...@li...>
Subject: Re: [Maxima-discuss] Simplifying gamma functions?
Non-NU Email
On Wed, 20 Jul 2022 at 06:02, Raymond Toy <toy...@gm...> wrote:
>
> Is there some builtin function to simplify a product of gamma functions?
>
> I can't simplify gamma(1/4)*gamma(3/4).
>
> For example gamma(1-z)*gamma(z) = %pi/sin(%pi*z). In this case if z = 1/4, we can see that the product is %pi/sin(%pi/4) = sqrt(2)*%pi.
>
> Or maybe note that beta(1/4,3/4) = gamma(1/4)*gamma(3/4)/gamma(1), so gamma(1/4)*gamma(3/4) = beta(1/4,3/4)*gamma(1). And maxima knows that beta(1/4,3/4) = sqrt(2)*%pi.
>
> The beta form can be useful for gamma(x)*gamma(y) where x+y is an integer or half integer.
>
> The reflection formula is useful if y = 1-x.
>
> The duplication formula gamma(z)*gamma(z+1/2) = 2^(1-2*z)*sqrt(%pi)*gamma(2*z) is also useful here when z = 1/4.
Not sure if this is useful but there is a function gammasimp in SymPy
that handles the cases described above:
>>> gammasimp(gamma(z)*gamma(1-z))
pi/sin(pi*z)
>>> gammasimp(gamma(S(1)/4)*gamma(S(3)/4))
sqrt(2)*pi
>>> gammasimp(gamma(z)*gamma(z + S(1)/2))
2*sqrt(2)*2**(-2*z - 1/2)*sqrt(pi)*gamma(2*z)
The code for it is here:
https://urldefense.com/v3/__https://github.com/sympy/sympy/blob/master/sympy/simplify/gammasimp.py__;!!PvXuogZ4sRB2p-tU!FBC3ZGVwsQg5hM3uLxEVQOApRjziHgp4j8F52mOELMyuw_tDI7pTUZq_PMtPfE-Pbo7zbW_yZbt7gQc5NJZYbVUgDA$<https://urldefense.com/v3/__https:/github.com/sympy/sympy/blob/master/sympy/simplify/gammasimp.py__;!!PvXuogZ4sRB2p-tU!FBC3ZGVwsQg5hM3uLxEVQOApRjziHgp4j8F52mOELMyuw_tDI7pTUZq_PMtPfE-Pbo7zbW_yZbt7gQc5NJZYbVUgDA$>
I haven't studied it in detail.
--
Oscar
_______________________________________________
Maxima-discuss mailing list
Max...@li...
https://urldefense.com/v3/__https://lists.sourceforge.net/lists/listinfo/maxima-discuss__;!!PvXuogZ4sRB2p-tU!FBC3ZGVwsQg5hM3uLxEVQOApRjziHgp4j8F52mOELMyuw_tDI7pTUZq_PMtPfE-Pbo7zbW_yZbt7gQc5NJZ6QFyxSQ$<https://urldefense.com/v3/__https:/lists.sourceforge.net/lists/listinfo/maxima-discuss__;!!PvXuogZ4sRB2p-tU!FBC3ZGVwsQg5hM3uLxEVQOApRjziHgp4j8F52mOELMyuw_tDI7pTUZq_PMtPfE-Pbo7zbW_yZbt7gQc5NJZ6QFyxSQ$>
|