TITLE: Is there a precise mathematical connection between hypergeometric functions and modular forms
QUESTION [9 upvotes]: I've been playing around with Gauss' hypergeometric series $F(a,b,c,z)$ these days and I was wondering if there is some relation with the theory of modular forms.

REPLY [7 votes]: A modular form $f$ of weight $1$ with respect to some discrete
subgroup $\Gamma$ of $\operatorname{SL}(2,\mathbb{R})$ fulfills
a linear second-order differential equation, if the independent
variable of that equation is chosen to be a suitable modular function
with respect to $\Gamma$. That is, if we express $f$ locally
not as a function of $\tau\in\mathbb{H}$ but as a function of $t$
where $t$ is a modular function of $\tau$,
then $f$, $\frac{\mathrm{d}f}{\mathrm{d}t}$,
$\frac{\mathrm{d}^2f}{\mathrm{d}t^2}$ are linearly dependent
with coefficients that are algebraic in $t$.
In some cases, the differential equation turns out to be the
hypergeometric one, and if the initial conditions match,
$f$ can be expressed directly as $f = {}_2F_1(a,b;c;t)$.
Of course, this only works locally because $t$ is invariant under $\Gamma$
whereas $f$ is not, but the linearity and familiarity of the resulting
differential equation compensates for that.
As a corollary, this approach yields values of modular forms
at certain points as a power product of several Gamma function values.
This subject is treated in section 5.4 around proposition 21 in

Don Zagier: Elliptic modular forms and their applications.
In: Kristian Ranestad (ed.): The 1-2-3 of modular forms. Springer 2008,
DOI: 10.1007/978-3-540-74119-0.

with three different and interesting proofs.
Two examples are given there as well, they result in
$$\begin{align}
 \varTheta_{00}^2 &=
 {}_2F_1\left(\tfrac{1}{2},\tfrac{1}{2};1;k^2\right)
\\ \sqrt[4]{\operatorname{E}_4} &=
 {}_2F_1\left(\tfrac{1}{12},\tfrac{5}{12};1;\tfrac{1728}{j}\right)
\end{align}$$
where $\varTheta_{00}$ is a Jacobi thetanull function,
$k^2 = \frac{\varTheta_{10}^4}{\varTheta_{00}^4}$
is the parameter of the standard elliptic integrals,
$\operatorname{E}_4$ is a normalized Eisenstein series,
and $j$ is Klein's absolute invariant.
All these entities are considered functions of the period ratio
$\tau\in\mathbb{H}$ here,
and as such you might know $k^2$ better as the elliptic lambda function
$\lambda$.
Note that the exponent of the left-hand side is the reciprocal of the
underlying modular form's weight, so the result has (formally) weight $1$.
The main argument of the ${}_2F_1$ on the right-hand side is the chosen
modular function $t$;
for $f=\varTheta_{00}^2$, it is $t=k^2=\lambda$,
and for $f=\sqrt[4]{\operatorname{E}_4}$, it is $t=\tfrac{1728}{j}$.
In both examples, the initial values have been set to match as $t\to0$,
i.e. $\Im\tau\to\infty$; and the periodicity (in $\tau$) of both sides matches
as well, so the identities hold as long as $\Im\tau$ is large enough.
I am deliberately vague here because the precise set of admissible
$\tau\in\mathbb{H}$ depends on the example,
and I am going to give additional examples:
$$\begin{align}
 \varTheta_{00}^2
 &= {}_2F_1\left(\tfrac{1}{4},\tfrac{1}{4};1;
 \tfrac{64}{\mathfrak{f}^{24}}\right)
\\ \varTheta_{01}^2
 &= {}_2F_1\left(\tfrac{1}{2},\tfrac{1}{2};1;
 -\tfrac{k^2}{k'^2}\right)
 = {}_2F_1\left(\tfrac{1}{4},\tfrac{1}{4};1;
 -\tfrac{64}{\mathfrak{f}_1^{24}}\right)
\\ \sqrt[6]{\operatorname{E}_6}
 &= {}_2F_1\left(\tfrac{1}{12},\tfrac{7}{12};1;
 \tfrac{1728}{1728-j}\right)
\end{align}$$
where $\varTheta_{01}$ is another Jacobi thetanull function;
$k'^2=1-k^2$; furthermore, $\mathfrak{f}$, $\mathfrak{f}_1$ are
Weber functions;
and $\operatorname{E}_6$ is the normalized Eisenstein series of weight $6$
with respect to the full modular group.
From the above,
it is easy to derive representations of related functions such as
$$\begin{align}
 \varTheta_{10}^2
 &= k\,\varTheta_{00}^2
 = k\,{}_2F_1\left(\tfrac{1}{2},\tfrac{1}{2};1;k^2\right)
\\ \eta^2
 &= \sqrt[3]{\frac{\varTheta_{00}^2\varTheta_{01}^2\varTheta_{10}^2}{4}}
 = \sqrt[3]{\frac{k'k}{4}}\ \varTheta_{00}^2
 = \sqrt[3]{\frac{k'k}{4}}
 \ {}_2F_1\left(\tfrac{1}{2},\tfrac{1}{2};1;k^2\right)
\\ &= \frac{\varTheta_{00}^2}{\mathfrak{f}^4}
 = \frac{1}{\mathfrak{f}^4}{}_2F_1\left(\tfrac{1}{4},\tfrac{1}{4};1;
 \tfrac{64}{\mathfrak{f}^{24}}\right)
\\ &= \frac{\varTheta_{01}^2}{\mathfrak{f}_1^4}
 = \frac{1}{\mathfrak{f}_1^4}{}_2F_1\left(\tfrac{1}{4},\tfrac{1}{4};1;
 -\tfrac{64}{\mathfrak{f}_1^{24}}\right)
\\ &= \sqrt[4]{\frac{\operatorname{E}_4}{\gamma_2}}
 = \frac{1}{\sqrt[4]{\gamma_2}}
 {}_2F_1\left(\tfrac{1}{12},\tfrac{5}{12};1;
 \tfrac{12^3}{\gamma_2^3}\right)
\\ &= \sqrt[6]{\frac{\operatorname{E}_6}{\gamma_3}}
 = \frac{1}{\sqrt[6]{\gamma_3}}
 {}_2F_1\left(\tfrac{1}{12},\tfrac{7}{12};1;
 -\tfrac{12^3}{\gamma_3^2}\right)
\end{align}$$
Here $\varTheta_{10}$ is the remaining member of the triplet of
standard Jacobi thetanull functions,
$\eta$ is the Dedekind eta function,
and $\gamma_2$, $\gamma_3$ are another couple of Weber functions.
Note that in these "derived" examples, the appropriate choice of root branch
depends on $\tau$.
Further occurences of ${}_2F_1$ can be found when
inverting Klein's $j$-invariant
and in the context of
other modular functions.
The latter example shows an aspect that I have not covered thus far:
What if you want to express a modular function $f$ (weight zero)
locally in terms of another modular function $t$, supposing their
corresponding automorphy groups are commensurable? Then $f$ and $t$
are algebraically related, and in some cases those algebraic relations
can again be solved with hypergeometric functions.