Simplifying special functions via substitution

We have a well-known identity $$B(a,b) = \frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}$$ between beta function and gamma function.

I have a complicated expression involving the terms in the form $$\frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}$$. I want to simplify by replacing it to $$B(a,b)$$. How can I do this?

The following is the example that I want to simplify:

(2^(-3 + 4/m)
E^(-((3 I \[Pi])/m)) (-1 + E^((2 I \[Pi])/m))^3 Gamma[(-2 + m)/
m] Gamma[(-1 + m)/m] Gamma[
1/m + (I w3)/
2] (Beta[(-1 + m)/m, 1/(2 m) + 1/4 I (w1 + w3)] Gamma[
1/4 (4 - 2/m - 2 I w1 + I w3)] Gamma[(2 + 2 I m w1 - I m w3)/(
4 m)] - Beta[(-1 + m)/m, 1/(2 m) - 1/4 I (w1 + w3)] Gamma[
1/4 (4 - 2/m + 2 I w1 - I w3)] Gamma[(2 - 2 I m w1 + I m w3)/(
4 m)]))/(Gamma[1 - 1/m + (I w3)/2] Gamma[
1/4 (4 - 2/m + 2 I w1 - I w3)] Gamma[
1/4 (4 - 2/m - 2 I w1 + I w3)])

(Looking carefully, one can see that the above simplification is possible.)

• Should the B[(-1 + m)/m, 1/(2 m) - 1/4 I (w1 + w3)]read Beta[(-1 + m)/m, 1/(2 m) - 1/4 I (w1 + w3)]? Oct 2 '21 at 3:31
• @BobHanlon Yes you are right. I modified the question. Oct 3 '21 at 2:22

This may give you what you want.

expr = (2^(-3 + 4/m) E^(-((3 I \[Pi])/m)) (-1 +
E^((2 I \[Pi])/m))^3 Gamma[(-2 + m)/m] Gamma[(-1 + m)/
m] Gamma[
1/m + (I w3)/
2] (Beta[(-1 + m)/m, 1/(2 m) + 1/4 I (w1 + w3)] Gamma[
1/4 (4 - 2/m - 2 I w1 + I w3)] Gamma[(2 + 2 I m w1 -
I m w3)/(4 m)] -
Beta[(-1 + m)/m, 1/(2 m) - 1/4 I (w1 + w3)] Gamma[
1/4 (4 - 2/m + 2 I w1 - I w3)] Gamma[(2 - 2 I m w1 +
I m w3)/(4 m)]))/(Gamma[1 - 1/m + (I w3)/2] Gamma[
1/4 (4 - 2/m + 2 I w1 - I w3)] Gamma[
1/4 (4 - 2/m - 2 I w1 + I w3)]) // ExpandAll

expr //. Gamma[a_ + b_] -> (Gamma[a] Gamma[b])/Beta[a, b]

% // Simplify

You still get a complicated expression, but I think all the terms involving Gammas are single values rather than sums.

I initially used ExpandAll on your expression so that there was no factor with the sum values in the Gamma arguments. My second statement would not work if there were.

• Thanks. Although not completely general, I think it is a nice trick! Oct 3 '21 at 10:55