# How does Mathematica evaluate these sum and integral?

How does Mathematica internally evaluate the following (interrelated) sum and integral, and how does it do the subsequent simplification? (I mean, based on what mathematical facts?)

Sum[1 /(4^(3 m))  Binomial[2 m, m]^3, {m, 0, ∞}]


π/Gamma[3/4]^4

Integrate[1/Sqrt[1 - Sin[t]^2 Sin[s]^2], {s, 0, Pi/2}, {t, 0, Pi/2}]


EllipticK[1/2]^2

EllipticK[1/2]^2/((8 Gamma[5/4]^2)/Sqrt[π])^2 // FullSimplify


1/4

I did not find these details in tutorial/SomeNotesOnInternalImplementation.

• FunctionExpand[EllipticK[1/2]] yields an expression in terms of gamma functions, which presumably gets used in the simplification. Feb 16, 2021 at 22:22
• @J.M.: Thank you for your comment. My question then, concerning the simplification, is this: how does FunctionExpand[EllipticK[1/2]] do it? As I wrote, I am interested in the mathematical facts on which these interrelated results are based. Feb 16, 2021 at 22:26
• I would guess the results of Borwein and Zucker are somehow involved. Feb 16, 2021 at 22:33
• Just wondering: Why do you ask this question? What difference does it make to you? You should know, for instance, that the internal algorithms for performing even rather simple integrals are frequently unrelated to the techniques we learned in high school and college. Again: Why ask? The "facts" used may be extremely non-intuitive and non-obvious... but are used because they are computationally efficient. (Please... no vacuous "just wondering" answer.) Feb 16, 2021 at 22:47
• @J.M.: Thank you for the references. Feb 17, 2021 at 1:53

a partial answer: From the defining integral for EllipticK[1/2]

Integrate[1/(Sqrt[1 - t^2]*Sqrt[1 - t^2/2]), {t, 0, 1}]


you get (along Borweins reasoning) with the (clever) substitution

Sqrt[u] == t^2/(2 - t^2)


to

(Sqrt[2]/4)*Integrate[1/(u^(3/4)*(1 - u)^2^(-1)), {u, 0, 1}]


which is equal per definition to

(Sqrt[2]/4)*Beta[1/4, 1/2]


and can then be expressed through Gamma functions.

Edit:

Another bit...

The binomials in the sum can be expressed (FunctionExpand) as gamma functions. The resulting sum can be seen as series expansion of

HypergeometricPFQ[{1/2, 1/2, 1/2}, {1, 1}, 1]


like given in http://functions.wolfram.com/07.27.06.0002.01 again after function expanding the Pochhammer symbols.

This special value of the hypergeometric function is connected to EllipticK[1/2]^2 through its integral representation, but I did not succeed in fully understanding the result of the double integral

(1/Pi^2)*Integrate[
(1/Sqrt[(1 - t)*t])*(1/(Sqrt[(1 - s)*s]*Sqrt[1 - s*t])), {t, 0, 1}, {s, 0, 1}]


which Mathematica is able to calculate in two steps (first t, then s).

• Thank you for this nice answer. Feb 17, 2021 at 21:57