taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Exercise · Volume 1 · 1.2.9-19

Exercise 1.2.9-19

stated in Lean solution written

RatingHM32
MarkersHM (needs higher mathematics)
KindK1, prove: show that a stated fact is true from the written solution
SectionSection 1.2.9 of Volume 1. Companion chapter: Generating functions

The task

Prove Gauss's closed form for Hp/q=∑n≥1(1n−1n+p/q)H_{p/q}=\sum_{n\ge1}\bigl(\frac1n-\frac1{n+p/q}\bigr) with integers 0<p<q0<p<q.

The exact wording is in your copy of the book.

Hints

Open one hint at a time. Try the exercise again after each.

Hint 1

Follow the hint: insert the factor xp+nqx^{p+nq}, write the sum as a combination of ln⁡11−xq\ln\frac1{1-x^q} and a series in the powers xNx^N with N≡p(modq)N\equiv p\pmod q.

Hint 2

Use (13) with ω=e2πi/q\omega=e^{2\pi i/q} on −ln⁡(1−x)=∑xN/N-\ln(1-x)=\sum x^N/N. Split off the term k=0k=0.

Hint 3

Let x→1x\to1. For k≠0k\ne0 use ln⁡(1−eiθ)=ln⁡(2sin⁡θ2)+iθ−π2\ln(1-e^{i\theta})=\ln(2\sin\frac\theta2)+i\frac{\theta-\pi}2 for 0<θ<2π0<\theta<2\pi. Add the terms for kk and q−kq-k.

Solution

Show the solution

Let ω=e2πi/q\omega=e^{2\pi i/q} and S(x)=∑n≥1(1n−qnq+p)xnq+pS(x)=\sum_{n\ge1}\bigl(\frac1n-\frac q{nq+p}\bigr)x^{nq+p} for 0<x<10<x<1. The series ∑n(1n−1n+p/q)\sum_n(\frac1n-\frac1{n+p/q}) converges, since its terms are O(1/n2)O(1/n^2). By Abel's theorem applied to the series in y=xqy=x^q, and because xp→1x^p\to1, the value of Hp/qH_{p/q} is lim⁡x→1−S(x)\lim_{x\to1^-}S(x).

Step 1. The first part is ∑n≥1xnq+p/n=xpln⁡11−xq\sum_{n\ge1}x^{nq+p}/n=x^p\ln\frac1{1-x^q}. For the second part let Φ(x)=∑N≥1, N≡p (q)xN/N\Phi(x)=\sum_{N\ge1,\,N\equiv p\ (q)}x^N/N. It contains the term N=pN=p, and the terms of the second part are those with N≥p+qN\ge p+q. So the second part is q(Φ(x)−xp/p)q\bigl(\Phi(x)-x^p/p\bigr) and

S(x)=xpln⁡11−xq−qΦ(x)+qpxp.S(x)=x^p\ln\frac1{1-x^q}-q\Phi(x)+\frac qpx^p.

Step 2. By (13) applied to −ln⁡(1−x)=∑N≥1xN/N-\ln(1-x)=\sum_{N\ge1}x^N/N with r=pr=p, qΦ(x)=−∑k=0q−1ω−kpln⁡(1−ωkx).q\Phi(x)=-\sum_{k=0}^{q-1}\omega^{-kp}\ln(1-\omega^kx). Here the logarithm has its principal value, which is the value given by the series for ∣x∣<1|x|<1. Separate the term k=0k=0:

S(x)=g(x)+∑k=1q−1ω−kpln⁡(1−ωkx),g(x)=ln⁡(1−x)−xpln⁡(1−xq)+qpxp.S(x)=g(x)+\sum_{k=1}^{q-1}\omega^{-kp}\ln(1-\omega^kx),\qquad g(x)=\ln(1-x)-x^p\ln(1-x^q)+\frac qpx^p.

Step 3, the term gg. Since 1−xq=(1−x)(1+x+⋯+xq−1)1-x^q=(1-x)(1+x+\cdots+x^{q-1}), we have ln⁡(1−x)−xpln⁡(1−xq)=(1−xp)ln⁡(1−x)−xpln⁡(1+x+⋯+xq−1)\ln(1-x)-x^p\ln(1-x^q)=(1-x^p)\ln(1-x)-x^p\ln(1+x+\cdots+x^{q-1}). The product (1−xp)ln⁡(1−x)(1-x^p)\ln(1-x) tends to 00 as x→1−x\to1^-, because 1−xp≤p(1−x)1-x^p\le p(1-x). So g(x)→qp−ln⁡qg(x)\to\frac qp-\ln q.

Step 4, the other terms. For k≠0k\ne0 the number ωk≠1\omega^k\ne1, so the logarithm is continuous at x=1x=1 and the limit is ln⁡(1−ωk)\ln(1-\omega^k). With θ=2πk/q\theta=2\pi k/q in (0,2π)(0,2\pi) we have 1−eiθ=2sin⁡(θ/2) ei(θ−π)/21-e^{i\theta}=2\sin(\theta/2)\,e^{i(\theta-\pi)/2}, where sin⁡(θ/2)>0\sin(\theta/2)>0 and ∣(θ−π)/2∣<π/2|(\theta-\pi)/2|<\pi/2. So ln⁡(1−ωk)=ln⁡(2sin⁡kπq)+i(kπq−π2)\ln(1-\omega^k)=\ln\bigl(2\sin\frac{k\pi}q\bigr)+i\bigl(\frac{k\pi}q-\frac\pi2\bigr). Put

T=∑k=1q−1ω−kp[ln⁡(2sin⁡kπq)+i(kπq−π2)].T=\sum_{k=1}^{q-1}\omega^{-kp}\Bigl[\ln\bigl(2\sin\tfrac{k\pi}q\bigr)+i\bigl(\tfrac{k\pi}q-\tfrac\pi2\bigr)\Bigr].

We use ∑k=1q−1ω−kp=−1\sum_{k=1}^{q-1}\omega^{-kp}=-1, because qq does not divide pp.

Real logarithmic part. The terms for kk and q−kq-k have the same ln⁡(2sin⁡kπq)\ln(2\sin\frac{k\pi}q) and conjugate factors ω∓kp\omega^{\mp kp}, so the sum is real and equals ∑k=1q−1cos⁡2pkπq ln⁡(2sin⁡kπq)\sum_{k=1}^{q-1}\cos\frac{2pk\pi}q\,\ln\bigl(2\sin\frac{k\pi}q\bigr). Split ln⁡(2sin⁡)=ln⁡2+ln⁡sin⁡\ln(2\sin)=\ln2+\ln\sin. The part with ln⁡2\ln2 is −ln⁡2-\ln2. In the part with ln⁡sin⁡\ln\sin, join kk with q−kq-k. When qq is even the term k=q/2k=q/2 has ln⁡sin⁡π2=0\ln\sin\frac\pi2=0. The result is 2∑0<k<q/2cos⁡2pkπqln⁡sin⁡kπq2\sum_{0<k<q/2}\cos\frac{2pk\pi}q\ln\sin\frac{k\pi}q.

Remaining part. It is −iπ2∑k=1q−1ω−kp=iπ2-\frac{i\pi}2\sum_{k=1}^{q-1}\omega^{-kp}=\frac{i\pi}2, plus iπq∑k=1q−1kρk\frac{i\pi}q\sum_{k=1}^{q-1}k\rho^k with ρ=ω−p≠1\rho=\omega^{-p}\ne1 and ρq=1\rho^q=1. By differentiating the geometric sum, ∑k=0q−1kρk=qρq/(ρ−1)=q/(ρ−1)\sum_{k=0}^{q-1}k\rho^k=q\rho^q/(\rho-1)=q/(\rho-1). With φ=2πp/q\varphi=2\pi p/q we have ρ−1=−2isin⁡φ2 e−iφ/2\rho-1=-2i\sin\frac\varphi2\,e^{-i\varphi/2}, so 1ρ−1=i2cot⁡φ2−12\frac1{\rho-1}=\frac i2\cot\frac\varphi2-\frac12. The second part is therefore iπ(i2cot⁡pπq−12)=−π2cot⁡pπq−iπ2i\pi\bigl(\frac i2\cot\frac{p\pi}q-\frac12\bigr)=-\frac\pi2\cot\frac{p\pi}q-\frac{i\pi}2. Adding iπ2\frac{i\pi}2, the imaginary parts cancel.

Step 5. Collect:

Hp/q=qp−ln⁡q−ln⁡2−π2cot⁡pπq+2∑0<k<q/2cos⁡2pkπqln⁡sin⁡kπq,H_{p/q}=\frac qp-\ln q-\ln2-\frac\pi2\cot\frac{p\pi}q+2\sum_{0<k<q/2}\cos\frac{2pk\pi}q\ln\sin\frac{k\pi}q,

and ln⁡q+ln⁡2=ln⁡2q\ln q+\ln2=\ln2q. This is the claimed formula.

Check

For p=1p=1, q=2q=2 the formula gives H1/2=2−ln⁡4=2−2ln⁡2H_{1/2}=2-\ln4=2-2\ln2, since cot⁡π2=0\cot\frac\pi2=0 and the sum over 0<k<10<k<1 is empty. Then 1−12H1/2=ln⁡21-\frac12H_{1/2}=\ln2, the first series in the exercise. For p=1p=1, q=4q=4 the formula gives H1/4=4−π2−ln⁡8+2cos⁡π2ln⁡sin⁡π4=4−π2−3ln⁡2H_{1/4}=4-\frac\pi2-\ln8+2\cos\frac\pi2\ln\sin\frac\pi4=4-\frac\pi2-3\ln2, and Python confirms the value of Hp/q=ψ(p/q+1)+γH_{p/q}=\psi(p/q+1)+\gamma to 2525 digits for seven pairs (p,q)(p,q).

Remarks

This is Gauss's formula for the digamma function at rational points, Hx=ψ(x+1)+γH_x=\psi(x+1)+\gamma. The three series of the exercise use HH at 12\frac12, at 14\frac14 and 34\frac34, and at 16\frac16 and 23\frac23.

This solution is drafted, and a person has not reviewed it yet. The source.

In Lean

stated The statement is in Lean and it builds. The proof is not in Lean yet.

The status is computed from the Lean build. The node of the map.

Something is wrong? Report it.