Mathwords logoMathwords

Theta Function — Definition, Formula & Example

A theta function is a Fourier series whose coefficients shrink like qn2q^{n^2}. Because the exponent grows as a square, the series converges extremely fast. The most common family is the four Jacobi theta functions θ1,θ2,θ3,θ4\theta_1, \theta_2, \theta_3, \theta_4.

Fix the nome q=eiπτq = e^{i\pi\tau} with Im⁡τ>0\operatorname{Im}\tau > 0, so ∣q∣<1|q| < 1. For z∈Cz \in \mathbb{C}, the Jacobi theta functions are θ1(z,q)=2∑n=0∞(−1)nq(n+1/2)2sin⁡((2n+1)z)\theta_1(z,q) = 2\sum_{n=0}^{\infty}(-1)^n q^{(n+1/2)^2}\sin((2n+1)z), θ2(z,q)=2∑n=0∞q(n+1/2)2cos⁡((2n+1)z)\theta_2(z,q) = 2\sum_{n=0}^{\infty} q^{(n+1/2)^2}\cos((2n+1)z), θ3(z,q)=1+2∑n=1∞qn2cos⁡(2nz)\theta_3(z,q) = 1 + 2\sum_{n=1}^{\infty} q^{n^2}\cos(2nz), and θ4(z,q)=1+2∑n=1∞(−1)nqn2cos⁡(2nz)\theta_4(z,q) = 1 + 2\sum_{n=1}^{\infty}(-1)^n q^{n^2}\cos(2nz). Each is an entire function of zz. Each is also quasi-periodic. For example, θ3(z+π)=θ3(z)\theta_3(z+\pi) = \theta_3(z) and θ3(z+πτ)=q−1e−2iz θ3(z)\theta_3(z+\pi\tau) = q^{-1}e^{-2iz}\,\theta_3(z). At z=0z = 0, the values satisfy Jacobi's identity θ3(0,q)4=θ2(0,q)4+θ4(0,q)4\theta_3(0,q)^4 = \theta_2(0,q)^4 + \theta_4(0,q)^4.

Key Formula

θ3(z,q)=∑n=−∞∞qn2e2inz=1+2∑n=1∞qn2cos⁡(2nz),∣q∣<1\theta_3(z,q) = \sum_{n=-\infty}^{\infty} q^{n^2} e^{2inz} = 1 + 2\sum_{n=1}^{\infty} q^{n^2}\cos(2nz), \qquad |q|<1
Where:
  • zz = Complex variable. The function has period π\pi in zz.
  • qq = The nome, q=eiπτq = e^{i\pi\tau} with Im⁡τ>0\operatorname{Im}\tau > 0, so that ∣q∣<1|q| < 1.
  • nn = Summation index running over all integers.

Worked Example

Problem: Set z=0z = 0, so that θ3(q)=∑nqn2=1+2q+2q4+2q9+⋯\theta_3(q) = \sum_{n} q^{n^2} = 1 + 2q + 2q^4 + 2q^9 + \cdots. Use θ3(q)2\theta_3(q)^2 to find r2(5)r_2(5), the number of integer pairs (m,n)(m, n) with m2+n2=5m^2 + n^2 = 5.
Step 1: Square the series. Each product qm2⋅qn2q^{m^2} \cdot q^{n^2} contributes qm2+n2q^{m^2+n^2}, so the coefficient of qNq^N counts the integer pairs with m2+n2=Nm^2 + n^2 = N.
θ3(q)2=∑m∑nqm2+n2=∑N≥0r2(N) qN\theta_3(q)^2 = \sum_{m}\sum_{n} q^{m^2+n^2} = \sum_{N \ge 0} r_2(N)\, q^N
Step 2: Only the terms with exponent at most 5 can reach q5q^5, so you can drop 2q92q^9 and everything after it. Then expand the truncated series.
(1+2q+2q4)2=1+4q+4q2+4q4+8q5+4q8(1 + 2q + 2q^4)^2 = 1 + 4q + 4q^2 + 4q^4 + 8q^5 + 4q^8
Step 3: Read off the coefficient of q5q^5. It comes only from the cross term 2⋅(2q)(2q4)2 \cdot (2q)(2q^4). As a check, the pairs are (±1,±2)(\pm1, \pm2) and (±2,±1)(\pm2, \pm1), which gives 8 pairs.
r2(5)=2⋅2⋅2=8r_2(5) = 2 \cdot 2 \cdot 2 = 8
Answer: r2(5)=8r_2(5) = 8. Exactly 8 ordered integer pairs, counting signs, satisfy m2+n2=5m^2 + n^2 = 5.

Why It Matters

Powers of θ3\theta_3 act as generating functions for sums of squares. Jacobi used θ34\theta_3^4 to prove his four-square theorem, which counts the ways to write NN as a sum of four squares. In a complex analysis or elliptic functions course, ratios of theta functions build the Jacobi elliptic functions sn⁡\operatorname{sn}, cn⁡\operatorname{cn}, and dn⁡\operatorname{dn}. In physics, theta functions give the heat kernel on a ring, and they appear in string theory partition functions.

Common Mistakes

Mistake: Mixing formulas from sources that use different theta conventions.
Correction: Some texts write θ3(z∣τ)=∑eiπτn2+2πinz\theta_3(z|\tau) = \sum e^{i\pi\tau n^2 + 2\pi i n z}, which has period 1 in zz. Others use e2inze^{2inz}, which has period π\pi. Some use q=e2πiτq = e^{2\pi i\tau} instead of eiπτe^{i\pi\tau}. Check the source's definition before you combine its identities.

Related Terms