# Riemann–Siegel theta function

In mathematics, the Riemann–Siegel theta function is defined in terms of the gamma function as
    $\theta (t)=\arg \left(\Gamma \left({\frac {1}{4}}+{\frac {it}{2}}\right)\right)-{\frac {\log \pi }{2}}t$
for real values of t. Here the argument is chosen in such a way that a continuous function is obtained and $\theta (0)=0$ holds, i.e., in the same way that the principal branch of the log-gamma function is defined.
It has an asymptotic expansion
    $\theta (t)\sim {\frac {t}{2}}\log {\frac {t}{2\pi }}-{\frac {t}{2}}-{\frac {\pi }{8}}+{\frac {1}{48t}}+{\frac {7}{5760t^{3}}}+\cdots$
which is not convergent, but whose first few terms give a good approximation for $t\gg 1$. Its Taylor-series at 0 which converges for $|t|<1/2$ is
    $\theta (t)=-{\frac {t}{2}}\log \pi +\sum _{k=0}^{\infty }{\frac {(-1)^{k}\psi ^{(2k)}\left({\frac {1}{4}}\right)}{(2k+1)!}}\left({\frac {t}{2}}\right)^{2k+1}$
where $\psi ^{(2k)}$ denotes the polygamma function of order $2k$. The Riemann–Siegel theta function is of interest in studying the Riemann zeta function, since it can rotate the Riemann zeta function such that it becomes the totally real valued Z function on the critical line $s=1/2+it$ .

## Curve discussion

The Riemann–Siegel theta function is an odd real analytic function for real values of $t$ with three roots at $0$ and $\pm 17.8455995405\ldots$. It is an increasing function for $|t|>6.29$, and has local extrema at $\pm 6.289835988\ldots$, with value $\mp 3.530972829\ldots$. It has a single inflection point at $t=0$ with $\theta ^{\prime }(0)=-{\frac {\ln \pi +\gamma +\pi /2+3\ln 2}{2}}=-2.6860917\ldots$, which is the minimum of its derivative.

## Theta as a function of a complex variable

We have an infinite series expression for the log-gamma function
    $\log \Gamma \left(z\right)=-\gamma z-\log z+\sum _{n=1}^{\infty }\left({\frac {z}{n}}-\log \left(1+{\frac {z}{n}}\right)\right),$
where γ is Euler's constant. Substituting $(2it+1)/4$ for z and taking the imaginary part termwise gives the following series for θ(t)
    $\theta (t)=-{\frac {\gamma +\log \pi }{2}}t-\arctan 2t+\sum _{n=1}^{\infty }\left({\frac {t}{2n}}-\arctan \left({\frac {2t}{4n+1}}\right)\right).$
For values with imaginary part between −1 and 1, the arctangent function is holomorphic, and it is easily seen that the series converges uniformly on compact sets in the region with imaginary part between −1/2 and 1/2, leading to a holomorphic function on this domain. It follows that the Z function is also holomorphic in this region, which is the critical strip.
We may use the identities
    $\arg z={\frac {\log z-\log {\bar {z}}}{2i}}\quad {\text{and}}\quad {\overline {\Gamma (z)}}=\Gamma ({\bar {z}})$
to obtain the closed-form expression
    $\theta (t)={\frac {\log \Gamma \left({\frac {2it+1}{4}}\right)-\log \Gamma \left({\frac {-2it+1}{4}}\right)}{2i}}-{\frac {\log \pi }{2}}t=-{\frac {i}{2}}\left(\ln \Gamma \left({\frac {1}{4}}+{\frac {it}{2}}\right)-\ln \Gamma \left({\frac {1}{4}}-{\frac {it}{2}}\right)\right)-{\frac {\ln(\pi )t}{2}}$
which extends our original definition to a holomorphic function of t. Since the principal branch of log Γ has a single branch cut along the negative real axis, θ(t) in this definition inherits branch cuts along the imaginary axis above i/2 and below −i/2.
Riemann–Siegel theta function in the complex plane :
| $-1<\Re (t)<1$ | $-5<\Re (t)<5$ | $-40<\Re (t)<40$ |

## Gram points

The Riemann zeta function on the critical line can be written
    $\zeta \left({\frac {1}{2}}+it\right)=e^{-i\theta (t)}Z(t),$
    $Z(t)=e^{i\theta (t)}\zeta \left({\frac {1}{2}}+it\right).$
If $t$ is a real number, then the Z function $Z(t)$ returns real values.
Hence the zeta function on the critical line will be real either at a zero, corresponding to $Z(t)=0$, or when $\sin \left(\,\theta (t)\,\right)=0$. Positive real values of $t$ where the latter case occurs are called Gram points, after J. P. Gram, and can of course also be described as the points where ${\frac {\theta (t)}{\pi }}$ is an integer.
A Gram point is a solution $g_{n}$ of
    $\theta (g_{n})=n\pi .$
These solutions are approximated by the sequence:
    $g'_{n}={\frac {2\pi \left(n+1-{\frac {7}{8}}\right)}{W\left({\frac {1}{e}}\left(n+1-{\frac {7}{8}}\right)\right)}},$
where $W$ is the Lambert W function.
Here are the smallest non negative Gram points
| $n$ | $g_{n}$ | $\theta (g_{n})$ |
| −3 | 0 | 0 |
| −2 | 3.4362182261... | −π |
| −1 | 9.6669080561... | −π |
| 0 | 17.8455995405... | 0 |
| 1 | 23.1702827012... | π |
| 2 | 27.6701822178... | 2π |
| 3 | 31.7179799547... | 3π |
| 4 | 35.4671842971... | 4π |
| 5 | 38.9992099640... | 5π |
| 6 | 42.3635503920... | 6π |
| 7 | 45.5930289815... | 7π |
| 8 | 48.7107766217... | 8π |
| 9 | 51.7338428133... | 9π |
| 10 | 54.6752374468... | 10π |
| 11 | 57.5451651795... | 11π |
| 12 | 60.3518119691... | 12π |
| 13 | 63.1018679824... | 13π |
| 14 | 65.8008876380... | 14π |
| 15 | 68.4535449175... | 15π |
The choice of the index n is a bit crude. It is historically chosen in such a way that the index is 0 at the first value which is larger than the smallest positive zero (at imaginary part 14.13472515 ...) of the Riemann zeta function on the critical line. Notice, this $\theta$-function oscillates for absolute-small real arguments and therefore is not uniquely invertible in the interval [−24,24]. Thus the odd theta-function has its symmetric Gram point with value 0 at index −3. Gram points are useful when computing the zeros of $Z\left(t\right)$. At a Gram point $g_{n},$
    $\zeta \left({\frac {1}{2}}+ig_{n}\right)=\cos(\theta (g_{n}))Z(g_{n})=(-1)^{n}Z(g_{n}),$
and if this is positive at two successive Gram points, $Z\left(t\right)$ must have a zero in the interval.
According to Gram’s law, the real part is usually positive while the imaginary part alternates with the Gram points, between positive and negative values at somewhat regular intervals.
    $(-1)^{n}Z(g_{n})>0$
The number of roots, $N(T)$, in the strip from 0 to T, can be found by
    $N(T)={\frac {\theta (T)}{\pi }}+1+S(T),$
where $S(T)$ is an error term which grows asymptotically like $\log T$.
Only if $g_{n}$ would obey Gram’s law, then finding the number of roots in the strip simply becomes
    $N(g_{n})=n+1.$
Today we know, that in the long run, Gram's law fails for about 1/4 of all Gram-intervals to contain exactly 1 zero of the Riemann zeta-function. Gram was afraid that it may fail for larger indices (the first miss is at index 126 before the 127th zero) and thus claimed this only for not too high indices. Later Hutchinson coined the phrase Gram's law for the (false) statement that all zeroes on the critical line would be separated by Gram points.