## Pi and Python: how 22/7 morphs into 355/113

This is a brief return to the topic of Irrational Sunflowers. The sunflower associated with a real number ${a}$ is the set of points with polar coordinates ${r=\sqrt{k}}$ and ${\theta = a(2\pi k)}$, ${k=1, 2, \dots, n}$. A sunflower reduces to ${n}$ equally spaced rays if and only if ${a}$ is a rational number written in lowest terms as ${m/n}$.

Here is the sunflower of ${a=\pi}$ of size ${n = 10000}$.

Seven rays emanate from the center because ${\pi \approx 22/7}$, then they become spirals, and spirals rearrange themselves into 113 rays because ${\pi \approx 355/113}$. Counting these rays is boring, so here is a way to do this automatically with Python (+NumPy as np):

a = np.pi
n = 5000
x = np.mod(a*np.arange(n, 2*n), 1)
np.sum(np.diff(np.sort(x)) > 1/n)

This code computes the polar angles of sunflower points indexed ${5000\le k<10000}$, sorts them and counts the relatively large gaps between the sorted values. These correspond to the gaps between sunflower rays, except that one of the gaps gets lost when the circle is cut and straightened onto the interval ${[0, 2\pi)}$. So the program output (112) means there are 113 rays.

Here is the same sunflower with the points alternatively colored red and blue.

The colors blur into purple when the rational approximation pattern is strong. But they are clearly seen in the transitional period from 22/7 approximation to 355/113.

1. How many points would we need to see the next rational approximation after 355/113?
2. What will that approximation be? Yes, 22/7 and 355/113 and among the convergent of the continued fraction of ${\pi}$. But so is 333/106 which I do not see in the sunflower. Are some convergents better than others?

Finally, the code I used to plot sunflowers.

import numpy as np
import matplotlib.pyplot as plt
a = np.pi
k = np.arange(10000)
r = np.sqrt(k)
t = a*2*np.pi*k
plt.axes().set_aspect('equal')
plt.plot(r*np.cos(t), r*np.sin(t), '.')
plt.show()

## Transcendental-free Riemann-Lebesgue lemma

Calculus books tend to introduce transcendental functions (trigonometric, exponential, logarithm) early. Analysis textbooks such as Principles of Mathematical Analysis by Rudin tend to introduce them later, because of how long it takes to develop enough of the theory of power series.

The Riemann-Lebesgue lemma involves either trigonometric or exponential functions. But the following version works with the “late transcendentals” approach.

## Transcendental-free Riemann-Lebesgue Lemma

TFRLL. Suppose that ${f\colon [a, b]\to \mathbb R}$ and ${g\colon \mathbb R\to \mathbb R}$ are continuously differentiable functions, and ${g}$ is bounded. Then ${\int_a^b f(x)g'(nx)\,dx \to 0}$ as ${n\to\infty}$.

The familiar form of the lemma is recovered by letting ${g(x) = \sin x}$ or ${g(x) = \cos x}$.

Proof. By the chain rule, ${g'(nx)}$ is the derivative of ${g(nx)/n}$. Integrate by parts:

${\displaystyle \int_a^b f(x)g'(nx)\,dx = \frac{f(b)g(nb)}{n} - \frac{f(a)g(na)}{n} - \int_a^b f'(x)\frac{g(nx)}{n}\,dx }$

By assumption, there exists a constant ${M}$ such that ${|g|\le M}$ everywhere. Hence ${\displaystyle \left| \frac{f(b)g(nb)}{n}\right| \le \frac{|f(b)| M}{n} }$, ${\displaystyle \left|\frac{f(a)g(na)}{n}\right| \le \frac{|f(a)| M}{n}}$, and ${\displaystyle \left|\int_a^b f'(x)\frac{g(nx)}{n}\,dx\right| \le \frac{M}{n} \int_a^b |f'(x)|\,dx}$. By the triangle inequality,

${\displaystyle \left|\int_a^b f(x)g'(nx)\,dx \right| \le \frac{M}{n}\left(|f(b)|+|f(a)| + \int_a^b |f'(x)|\,dx \right) \to 0 }$

completing the proof.

As a non-standard example, TFRLL applies to, say, ${g(x) = \sin (x^2) }$ for which ${g'(x) = 2x\cos (x^2)}$. The conclusion is that ${\displaystyle \int_a^b f(x) nx \cos (n^2 x^2) \,dx \to 0 }$, that is, ${\displaystyle \int_a^b xf(x) \cos (n^2 x^2) \,dx = o(1/n)}$ which seems somewhat interesting. When ${0\notin [a, b]}$, the factor of ${x}$ can be removed by applying the result to ${f(x)/x}$, leading to ${\displaystyle \int_a^b f(x) \cos (n^2 x^2) \,dx = o(1/n)}$.

## What if we tried less smoothness?

Later in Rudin’s book we encounter the Weierstrass theorem: every continuous function on ${[a, b]}$ is a uniform limit of polynomials. Normally, this would be used to make the Riemann-Lebesgue lemma work for any continuous function ${f}$. But the general form given above, with an unspecified ${g}$, presents a difficulty.

Indeed, suppose ${f}$ is continuous on ${[a, b]}$. Given ${\epsilon > 0 }$, choose a polynomial ${p}$ such that ${|p-f|\le \epsilon}$ on ${[a, b]}$. Since ${p}$ has continuous derivative, it follows that ${\int_a^b p(x)g'(nx)\,dx \to 0}$. It remains to show that ${\int_a^b p(x)g'(nx)\,dx}$ is close to ${\int_a^b f(x)g'(nx)\,dx}$. By the triangle inequality,

${\displaystyle \left| \int_a^b (p(x) - f(x))g'(nx)\,dx \right| \le \epsilon \int_a^b |g'(nx)|\,dx }$

which is bounded by … um. Unlike for ${\sin }$ and ${\cos}$, we do not have a uniform bound for ${|g'|}$ or for its integral. Indeed, with ${g(x) = \sin x^2}$ the integrals ${\displaystyle \int_0^1 |g'(nx)| \,dx = \int_0^1 2nx |\cos (n^2x^2)| \,dx }$ grow linearly with ${n}$. And this behavior would be even worse with ${g(x) = \sin e^x}$, for example.

At present I do not see a way to prove TFRLL for continuous ${f}$, let alone for integrable ${f}$. But I do not have a counterexample either.

## Partitions of unity and monotonicity-preserving approximation

There are many ways to approximate a given continuous function ${f\colon [a, b]\to \mathbb R}$ (I will consider the interval ${[a, b]=[0, 1]}$ for convenience.) For example, one can use piecewise linear interpolation through the points ${(k/n, f(k/n))}$, where ${k=0, 1, \dots, n}$. The resulting piecewise linear function ${g}$ has some nice properties: for example, it is increasing if ${f}$ is increasing. But it is not smooth.

A convenient way to represent piecewise linear interpolation is the sum ${g(x) = \sum_{k=0}^n f(k/n) \varphi_k(x)}$ where the functions ${\varphi_k}$ are the triangles shown below: ${\varphi_k(x) = \max(0, 1 - |nx-k|)}$.

The functions ${{\varphi_k}}$ form a partition of unity, meaning that ${\sum_k \varphi_k \equiv 1}$ and all ${\varphi_k}$ are nonnegative. This property leads to the estimate

${\displaystyle |f(x) - g(x)| = \left| \sum_{k=0}^n (f(x) - f(k/n)) \varphi_k(x)\right| \le \sum_{k=0}^n |f(x) - f(k/n)| \varphi_k(x) }$

The latter sum is small because when ${x}$ is close to ${k/n}$, the first factor ${|f(x) - f(k/n)|}$ is small by virtue of continuity, while the second factor ${\varphi_k(x)}$ is bounded by ${1}$. When ${x}$ is far from ${k/n}$, the second factor ${\varphi_k(x)}$ is zero, so the first one is irrelevant. The upshot is that ${f-g}$ is uniformly small.

But if we want a smooth approximation ${g}$, we need a smooth partition of unity ${{\varphi_k}}$. But not just any set of smooth nonnegative functions that add up to ${0}$ is equally good. One desirable property is preserving monotonicity: if ${f}$ is increasing, then ${g}$ should be increasing, just as this works for piecewise linear interpolation. What does this condition require of our partition of unity?

An increasing function can be expressed as a limit of sums of the form ${\sum_{j} c_j [x \ge t_j]}$ where ${c_j>0}$ and ${[\cdots ]}$ is the Iverson bracket: 1 if true, 0 if false. By linearity, it suffices to have increasing ${g}$ for the case ${f(x) = [x \ge t]}$. In this case ${g}$ is simply ${s_m := \sum_{k=m}^n \varphi_k}$ for some ${m}$, ${0\le m\le n}$. So we want all ${s_m}$ to be increasing functions. Which is the case for the triangular partition of unity, when each ${s_m}$ looks like this:

One smooth choice is Bernstein basis polynomials: ${\displaystyle \varphi_k(x) = \binom{n}{k} x^k (1-x)^{n-k}}$. These are nonnegative on ${[0, 1]}$, and the binomial formula shows ${\displaystyle \sum_{k=0}^n \varphi_k(x) = (x + 1-x)^n \equiv 1}$. Are the sums ${\displaystyle s_m(x) = \sum_{k=m}^n \binom{n}{k} x^k (1-x)^{n-k}}$ increasing with ${x}$? Let’s find out. By the product rule,

${\displaystyle s_m'(x) = \sum_{k=m}^n \binom{n}{k} k x^{k-1} (1-x)^{n-k} - \sum_{k=m}^n \binom{n}{k} (n-k) x^{k} (1-x)^{n-k - 1}}$

In the second sum the term with ${k=n}$ vanishes, and the terms with ${k can be rewritten as ${\displaystyle \frac{n!}{k! (n-k)!} (n-k) x^{k} (1-x)^{n-k - 1}}$, which is ${\frac{n!}{(k+1)! (n-k-1)!} (k+1) x^{k} (1-x)^{n-k - 1}}$, which is ${\binom{n}{k+1} (k+1) x^{k} (1-x)^{n-k - 1} }$. After the index shift ${k+1\mapsto k}$ this becomes identical to the terms of the first sum and cancels them out (except for the first one). Thus,

${\displaystyle s_m'(x) = \binom{n}{m} m x^{m-1} (1-x)^{n-m} \ge 0 }$

To summarize: the Bernstein polynomials ${\displaystyle B_n(x) = \sum_{k=0}^n f(k/n) \binom{n}{k} x^k (1-x)^{n-k}}$ are monotone whenever ${f}$ is. On the other hand, the proof that ${B_n\to f}$ uniformly is somewhat complicated by the fact that the polynomial basis functions ${\varphi_k}$ are not localized the way that the triangle basis functions are: the factors ${\varphi_k(x)}$ do not vanish when ${x}$ is far from ${k/n}$. I refer to Wikipedia for a proof of convergence (which, by the way, is quite slow).

Is there some middle ground between non-smooth triangles and non-localized polynomials? Yes, of course: piecewise polynomials, splines. More specifically, B-splines which can be defined as follows: B-splines of degree ${1}$ are the triangle basis functions shown above; a B-spline of degree ${d+1}$ is the moving averages of a ${B}$-spline of degree ${d}$ with a window of length ${h = 1/n}$. The moving average of ${F}$ can be written as ${\frac{1}{h} \int_{x-h/2}^{x+h/2} f}$. We get a partition of unity because the sum of moving averages is the moving average of a sum, and averaging a constant function does not change it.

The splines of even degrees are awkward to work with… they are obtained from the triangles by taking those integrals with ${h/2}$ an odd number of times, which makes their knots fall in the midpoints of the uniform grid instead of the grid points themselves. But I will use ${d=2}$ anyway, because this degree is enough for ${C^1}$-smooth approximation.

Recall that a triangular basis function ${\varphi_k}$ has slope ${\pm n}$ and is supported on an interval ${[(k-1)h, (k+1)h]}$ where ${h=1/n}$. Accordingly, its moving average ${\psi_k}$ will be supported on ${[(k-3/2)h, (k+3/2)h]}$. Since ${\psi_k'(x) = n(\phi_k(x+h/2) - \phi_k(x-h/2))}$, the second derivative ${\psi_k''}$ is ${n^2}$ when ${-3/2< nx-k< -1/2}$, is ${-2n^2}$ when ${|nx-k| < 1/2}$, and is ${n^2}$ again when ${1/2 < nx-k < 3/2}$. This is enough to figure out the formula for ${\psi_k}$:

${\displaystyle \psi_k(n) = \begin{cases} (nx-k+3/2)^2 / 2, & -3/2\le nx -k\le -1/2 \\ 3/4 -(nx-k)^2, & -1/2\le nx-k \le 1/2 \\ (nx-k-3/2)^2 / 2, & 1/2\le nx -k \le 3/2 \\ \end{cases} }$

These look like:

Nice! But wait a moment, the sum near the endpoints is not constant: it is less than 1 because we do not get a contributions of two splines to the left and right of the interval. To correct for this boundary effect, replace ${\psi_0}$ with ${\psi_0 + \psi_{-1}}$ and ${\psi_n}$ with ${\psi_n + \psi_{n+1}}$, using “ghost” elements of the basis that lie outside of the actual grid. Now the quadratic B-spline basis is correct:

Does this partition of unity preserve monotinicity? Yes, it does: ${\displaystyle \sum_{k\ge m}\psi_k'(x) = n\sum_{k\ge m} (\phi_k(x+h/2) - \phi_k(x-h/2)) = n(s(x+h/2) - s(x-h/2))}$ which is nonnegative because the sum ${s := \sum_{k\ge m} \phi_k}$ is an increasing piecewise linear function, as noted previously. Same logic works for B-splines of higher degree.

In conclusion, here is a quadratic B-spline approximation (orange) to a tricky increasing function (blue).

One may wonder why the orange curve deviates from the line at the end – did we miss some boundary effect there? Yes, in a way… the spline actually approximates the continuous extension of our original function by constant values on the left and right. Imagine the blue graph continuing to the right as a horizontal line: this creates a corner at ${x=1}$ and the spline is smoothing that corner. To avoid this effect, one may want to extend ${f}$ in a better way and then work with the extended function, not folding the ghosts ${\psi_{-1}, \psi_{n+1}}$ into ${\psi_0, \psi_n}$.

But even so, B-spline achieves a better approximation than the Bernstein polynomial with the same number of basis functions (eight):

The reason is the non-local nature of the polynomial basis ${\varphi_k}$, which was noted above. Bernstein polynomials do match the function perfectly at the endpoints, but this is small consolation.

## The closure of periodic functions and sums of waves with incommensurable periods

Consider the space ${C(\mathbb R)}$ of all bounded continuous functions ${f\colon \mathbb R\to\mathbb R}$, with the uniform norm ${\|f\| = \sup |f|}$. Let ${P}$ be its subset that consists of all periodic continuous functions: recall that ${f}$ is periodic if there exists ${T>0}$ such that ${f(x+T)=f(x)}$ for all ${x\in \mathbb R}$.

The set ${P}$ is not closed in the topology of ${C(\mathbb R)}$. Indeed, let ${d(x) = \mathrm{dist}\,(x, \mathbb Z)}$ be the distance from ${x}$ to nearest integer. The function ${d}$ is periodic with ${T=1}$. Therefore, each sum of the form ${\displaystyle \sum_{k=0}^n 2^{-k} d(2^{-k} x)}$ is periodic with ${T=2^n}$. Hence the sum of the infinite series ${\displaystyle f(x) = \sum_{k=0}^\infty 2^{-k} d(2^{-k} x) }$ is a uniform limit of periodic functions. Yet, ${f}$ is not periodic, because ${f(0)=0}$ and ${f(x)>0 }$ for ${x\ne 0}$ (for every ${x\ne 0}$ there exists ${k}$ such that ${2^{-k}x}$ is not an integer).

The above example (which was suggested to me by Yantao Wu) is somewhat similar to the Takagi function, which differs from it by the minus sign in the exponent: ${\displaystyle T(x) = \sum_{k=0}^\infty 2^{-k} d(2^{k} x) }$. Of course, the Takagi function is periodic with period ${1}$.

Do we really need an infinite series to get such an example? In other words, does the set ${\overline{P}\setminus P}$ contain an elementary function?

A natural candidate is the sum of trigonometric waves with incommensurable periods (that is, the ratio of periods must be irrational). For example, consider the function ${g(x) = \cos (x) + \cos (\sqrt{2}x)}$ whose graph is shown below.

Since ${g(0)=2}$ and ${g(x) < 2}$ for all ${x\ne 0}$, the function ${g}$ is not periodic. Its graph looks vaguely similar to the graph of ${f}$. Is ${g}$ a uniform limit of periodic functions?

Suppose ${h\colon \mathbb R\to\mathbb R}$ is a ${T}$-periodic function such that ${\|h-g\|<\epsilon}$. Then ${h(0) > 2-\epsilon}$, hence ${h(nT)>2-\epsilon}$ for all ${n\in \mathbb Z}$, hence ${g(nT) > 2- 2\epsilon }$. By the definition of ${g}$ this implies ${\cos (nT) > 1-2\epsilon}$ and ${\cos (\sqrt{2}nT) > 1-2\epsilon}$ for all ${n\in \mathbb Z}$. The following lemma shows a contradiction between these properties.

Lemma. If a real number ${t}$ satisfies ${\cos nt > -1/2}$ for all ${n\in \mathbb Z}$, then ${t}$ is an integer multiple of ${2\pi}$.

Proof. Suppose ${t}$ is not an integer multiple of ${2\pi}$. We can assume ${0 < t < \pi}$ without loss of generality, because ${t}$ can be replaced by ${t - 2\pi k}$ to get it in the interval ${(0, 2\pi)}$ and then by ${2\pi - t}$ to get it in ${(0, \pi)}$. Since ${\cos t > -1/2}$, we have ${t\in (0, 2\pi/3)}$. Let ${k}$ be the smallest positive integer such that ${2^k t \ge 2\pi/3}$. The minimality of ${k}$ implies ${2^{k-1} t < 2\pi/3}$, hence ${2^k t \in [2\pi/3, 4\pi/3)}$. But then ${\cos (2^k t) \le -1/2}$, a contradiction. ${\quad \Box}$

The constant ${-1/2}$ in the lemma is best possible, since ${\cos (2n\pi/3)\ge -1/2}$ for all ${n\in \mathbb Z}$.

Returning to the paragraph before the lemma, choose ${\epsilon=3/4}$ so that ${1-2\epsilon = -1/2}$. The lemma says that both ${T}$ and ${\sqrt{2} T}$ must be integer multiples of ${2\pi}$, which is impossible since they are incommensurable. This contradiction shows that ${\|g-h\|\ge 3/4}$ for any periodic function ${h}$, hence ${g}$ is not a uniform limit of periodic functions.

The above result can be stated as ${\mathrm{dist}(g, P) \ge 3/4}$. I guess ${\mathrm{dist}(g, P)}$ is actually ${1}$. It cannot be greater than ${1}$ since ${|g(x)-\cos x|\le 1}$ for all ${x}$. (Update: Yantao pointed out that the density of irrational rotations implies the distance is indeed equal to 1.)

Note: the set ${\overline{P}}$ is a proper subset of the set of (Bohr / Bochner / uniform) almost periodic functions (as Yemon Choi pointed out in a comment). The latter is a linear space while ${\overline{P}}$ is not. I was confused by the sentence “Bohr defined the uniformly almost-periodic functions as the closure of the trigonometric polynomials with respect to the uniform norm” on Wikipedia. To me, a trigonometric polynomial is a periodic function of particular kind. What Bohr called Exponentialpolynom is a finite sum of the form ${\sum a_n e^{\lambda_n x}}$ where ${\lambda_n}$ can be any real numbers. To summarize: the set considered above is the closure of ${P}$ while the set of almost periodic functions is the closed linear span of ${P}$. The function ${g(x)=\cos (x) + \cos(\sqrt{2} x)}$ is an example of the latter, not of the former.

## Points of maximal curvature

In Calculus I students are taught how to find the points at which the graph of a function has zero curvature (that is, the points of inflection). The points of maximal curvature are usually not discussed. This post attempts to rectify this omission.

The (signed) curvature of ${y=f(x)}$ is

${\displaystyle \kappa = \frac{y''}{(1+(y')^2)^{3/2}}}$

We want to maximize the absolute value of ${\kappa}$, whether the function is positive or negative there (so both maxima and minima of ${\kappa}$ can be of interest). The critical points of ${\kappa}$ are the zeros of

${\displaystyle \kappa' = \frac{y''' (1+(y')^2) - 3 y' (y'')^2 }{(1+(y')^2)^{5/2}}}$

So we are lead to consider a polynomial of the first three derivatives of ${y}$, namely ${p := y''' (1+(y')^2) - 3 y' (y'')^2 }$.

Begin with some simple examples:

${y = x^2}$ has ${p = -24x}$ so the curvature of a parabola is maximal at its vertex. No surprise there.

${y = x^3}$ has ${p = 6(1 - 45x^4)}$, indicating two symmetric points of maximal curvature, ${x\approx \pm 0.386}$, pretty close to the point of inflection.

${y=x^4}$ has ${p = 24 x (1 - 56 x^6)}$. This has three real roots, but ${x=0}$ actually minimizes curvature (it vanishes there).

More generally, ${y=x^n}$ with positive integer ${n}$ yields ${\displaystyle p = n(n-1)x^{n-3} (n - 2 - (2n^3-n^2) x^{2n-2})}$ indicating two points ${\displaystyle x = \pm \left(\frac{n-2}{2n^3-n^2} \right)^{1/(2n-2)}}$ which tend to ${\pm 1}$ as ${n}$ grows.

The graph of a polynomial of degree ${n}$ can have at most ${n-2}$ points of zero curvature, because the second derivative vanishes at those. How many points of maximal curvature can it have? The degree of expression ${p}$ above is ${3n-5}$ but it is not obvious whether all of its roots can be real and distinct, and also be the maxima of ${|\kappa|}$ (unlike ${x=0}$ for ${y=x^4}$). For ${n=2}$ we do get ${3n-5 = 1}$ point of maximal curvature. But for ${n=3}$, there can be at most ${2}$ such points, not ${3n-5 = 4}$. Edwards and Gordon (Extreme curvature of polynomials, 2004) conjectured that the graph of a polynomial of degree ${n}$ has at most ${n-1}$ points of maximal curvature. This remains open despite several partial results: see the recent paper Extreme curvature of polynomials and level sets (2017).

A few more elementary functions:

${y = e^x}$ has ${p = e^x(1-2e^{2x})}$, so the curvature is maximal at ${x=-\log(2)/2}$. Did I expect the maximum of curvature to occur for a negative ${x}$? Not really.

${y=\sin x}$ has ${p = (\cos 2x - 3)\cos x}$. The first factor is irrelevant: the points of maximum curvature of a sine wave are at its extrema, as one would guess.

${y = \tan x}$ has ${p = -6\tan^8(x) - 16\tan^6(x) - 6\tan^4(x) + 8\tan(x)^2 + 4}$ which is zero at… ahem. The expression factors as

${\displaystyle p = -2(\tan^2 x+1)(3\tan^6(x) + 5\tan^4(x) - 2\tan^2(x) - 2)}$

Writing ${u = \tan^2(x)}$ we can get a cubic equation in ${u}$, but it is not a nice one. Or we could do some trigonometry and reduce ${p=0}$ to the equation ${8 - 41\cos 2x + \cos 6x =0}$. Either way, a numerical solution is called for: ${x \approx \pm 0.6937}$ (and ${+\pi n}$ for other periods).

## Branching

Multiple kinds of branching here. First, the motorsport content has been moved to formula7.blog. Two blogs? Well, it became clear that my Stack Exchange activity, already on hiatus since 2018, is not going to resume (context: January 14, January 15, January 17). But typing words in boxes is still a hobby of mine.

There may be yet more branching in the knowledge market space, with Codidact and TopAnswers attempting to rise from the ashes of Stack Exchange. (I do not expect either project to have much success.)

Also, examples of branching in complex analysis are often limited to the situations where any two branches differ either by an additive constant like ${\log z}$ or by a multiplicative constant like ${z^p}$. But different branches can even have different branch sets. Consider the dilogarithm, which has a very nice power series in the unit disk:

${\displaystyle f(z) = \sum_{n=1}^\infty \frac{z^n}{n^2} = z + \frac{z^2}{4} + \frac{z^3}{9} + \frac{z^4}{16} + \cdots}$

The series even converges on the unit circle ${|z|=1}$, providing a continuous extension there. But this circle is also the boundary of the disk of convergence, so some singularity has to appear. And it does, at ${z=1}$. Going around this singularity and coming back to the unit disk, we suddenly see a function with a branch point at ${z=0}$, where there was no branching previously.

What gives? Consider the derivative:

${\displaystyle f'(z) = \sum_{n=1}^\infty \frac{z^{n-1}}{n} = -\frac{\log (1-z)}{z}}$

As long as the principal branch of logarithm is considered, there is no singularity at ${z}$ since ${\log(1-0) = 0}$ cancels the denominator. But once we move around ${z=1}$, the logarithm acquires a multiple of ${2\pi i }$, and so ${f'}$ gets an additional term ${cz^{-1}}$, and integrating that results in logarithmic branching at ${z=0}$.

Of course, this does not even begin the story of the dilogarithm, so I refer to Zagier’s expanded survey which has a few branch points itself.

Thus the dilogarithm is one of the simplest non-elementary functions one can imagine. It is also one of the strangest. It occurs not quite often enough, and in not quite an important enough way, to be included in the Valhalla of the great transcendental functions—the gamma function, Bessel and Legendre- functions, hypergeometric series, or Riemann’s zeta function. And yet it occurs too often, and in far too varied contexts, to be dismissed as a mere curiosity. First defined by Euler, it has been studied by some of the great mathematicians of the past—Abel, Lobachevsky, Kummer, and Ramanujan, to name just a few—and there is a whole book devoted to it. Almost all of its appearances in mathematics, and almost all the formulas relating to it, have something of the fantastical in them, as if this function alone among all others possessed a sense of humor.