Chapter IV · Limits of functions of a positive integral variable

Interpolation

§51 20 min

Finding a formula in x that agrees with a given function of n is always possible and never unique; what is wanted is a natural one.

Why this matters

The last lesson showed that a function of nn always extends to functions of xx, in infinitely many ways. §51 (printed in Hardy’s small type) asks the sharper question that working mathematicians actually ask: is there a good formula in xx that takes the given values at x=1,2,3,…x = 1, 2, 3, \dots? This is the problem of functional interpolation. It explains why xxx^x and (−1)x(-1)^x need care, and it leads to one of the most important functions in analysis, the gamma function, which extends n!n!.

The idea

Mere existence is cheap. We can always fill in the values between the integers however we like, or even leave them undefined. So the problem only has content when we ask for a formula with good properties: simple, smooth, and agreeing with the “obvious” formula when there is one.

Even then there is never only one answer. If F(x)F(x) agrees with ϕ(n)\phi(n) at every positive integer, so does F(x)+csin⁡πxF(x) + c\sin\pi x for every number cc, because sin⁡nπ=0\sin n\pi = 0. You can see the whole family at once below.

Explore Many curves through the same dots

Try this. With n2n^2 selected, move the slider cc in both directions. Then do the same for n!n!. For (−1)n(-1)^n, also switch on the dots that show where the formula (−1)x(-1)^x has a meaning, and move the probe to x=1/3x = 1/3 or x=2/3x = 2/3.

ϕ(n)=n2\phi(n) = n^2 and the curve y=x2y = x^2
xy
  • the values φ(1), …, φ(5)
  • an interpolating curve
Sequence
At x=2.5x = 2.5 this curve has height 6.256.25. Move c: every curve of the family passes through the same dots, because sin⁡nπ=0\sin n\pi = 0. The dots alone cannot decide between them.
What to notice

Every curve passes through the blue dots, but between them the curves disagree as much as you like: the dots cannot choose. For (−1)n(-1)^n the formula (−1)x(-1)^x is useless as an interpolation. It is defined only at rationals with odd denominator, and there it is always +1+1 or −1-1, for example (−1)1/3=−1(-1)^{1/3} = -1, while cos⁡(π/3)=12\cos(\pi/3) = \tfrac12.

Hardy’s examples show three typical situations.

  1. The formula already works for every xx. For ϕ(n)=n2\phi(n) = n^2 or cos⁡nπ\cos n\pi we simply take ϕ(x)\phi(x). But even here, ϕ(x)+sin⁡πx\phi(x) + \sin \pi x is “almost equally obvious”.
  2. The formula breaks down, but can be rewritten. (−1)n(-1)^n makes sense for integers, but (−1)x(-1)^x does not make sense for x=12x = \tfrac12 or for irrational xx. Since (−1)n=cos⁡nπ(-1)^n = \cos n\pi for every integer nn, the function cos⁡πx\cos \pi x solves the problem.
  3. There is no formula at all. n!=1⋅2⋯nn! = 1 \cdot 2 \cdots n has no meaning unless nn is a positive integer. Here the search for a good interpolation led to a genuine discovery: the gamma function, with Γ(n+1)=n!\Gamma(n+1) = n!, which you can see in the explorer.

A fourth example sits in between: nnn^n suggests xxx^x, which (for x>0x > 0) makes sense when xx is rational, using the meaning of fractional powers from algebra. But with the tools available at this point of the book, xxx^x has no meaning at all for irrational xx. Hardy promises to fill that gap later, and he does, with the exponential function in Chapter IX.

Precise statements

Definition Interpolation Hardy: §51

Let ϕ(n)\phi(n) be a function of the positive integral variable nn. A function F(x)F(x) of the real variable xx interpolates ϕ\phi if FF is defined at every positive integer and F(n)=ϕ(n)F(n) = \phi(n) for n=1,2,3,…n = 1, 2, 3, \dots The problem of functional interpolation is to find such an FF given by a formula, as simple and natural as possible.

The family of all solutions is easy to describe exactly.

Theorem All interpolations of one function of nn

Suppose FF interpolates ϕ\phi. Then a function GG (defined at least at the positive integers) interpolates ϕ\phi if and only if G=F+HG = F + H, where HH is a function with H(n)=0H(n) = 0 for every positive integer nn.

Proofs

Proof All interpolations of one function of nn
Strategy

Look at the difference of two interpolations. It must vanish at the positive integers, and any function that vanishes there may be added.

If GG interpolates, then H=G−FH = G - F vanishes at the integers

For each positive integer nn, H(n)=G(n)−F(n)=ϕ(n)−ϕ(n)=0H(n) = G(n) - F(n) = \phi(n) - \phi(n) = 0. And G=F+HG = F + H.

Conversely, adding such an HH keeps the values

If H(n)=0H(n) = 0 for every positive integer nn, then (F+H)(n)=F(n)+0=ϕ(n)(F + H)(n) = F(n) + 0 = \phi(n). So F+HF + H interpolates ϕ\phi.

There are infinitely many such HH

For example H(x)=csin⁡πxH(x) = c\sin\pi x for any real cc, or csin⁡2πxc\sin^2 \pi x, or sin⁡2πx\sin 2\pi x, or any function that is 00 at the integers and anything at all elsewhere. So an interpolation is never unique.

The theorem moves the difficulty to the right place. Uniqueness can only come from extra conditions on FF, chosen so that the answer is the natural one. For n!n! the natural condition is the rule (n+1)!=(n+1)⋅n!(n+1)! = (n+1)\cdot n!, but the next exercise shows that this rule alone is not enough.

Worked examples and exercises

Exercise Where (−1)x(-1)^x has a meaning ●●○ Hardy: §51

Using the meaning of fractional powers from algebra, show that (−1)x(-1)^x is a real number when x=p/qx = p/q in lowest terms with qq odd, and find its value. Why does it have no real value when qq is even? Conclude that (−1)x(-1)^x and cos⁡πx\cos \pi x agree only at the integers among such xx.

Hint
(−1)p/q(-1)^{p/q} means the pp-th power of the real qq-th root of −1-1. Which real number has qq-th power −1-1 when qq is odd?

Solution

For odd qq, the equation tq=−1t^q = -1 has exactly one real solution, t=−1t = -1. So (−1)p/q=(−1)p(-1)^{p/q} = (-1)^p, which is +1+1 for even pp and −1-1 for odd pp. For even qq, tq≥0t^q \ge 0 for every real tt, so no real tt has tq=−1t^q = -1, and (−1)p/q(-1)^{p/q} has no real value.

Now compare with cos⁡(πp/q)\cos(\pi p/q). Its value is ±1\pm 1 only when p/qp/q is an integer. So for a non-integral p/qp/q with odd qq, cos⁡(πp/q)\cos(\pi p/q) lies strictly between −1-1 and 11, while (−1)p/q=±1(-1)^{p/q} = \pm 1. The two agree only at the integers (where q=1q = 1). The formula (−1)x(-1)^x is therefore no solution of the interpolation problem, and cos⁡πx\cos \pi x is.

Exercise No polynomial interpolates (−1)n(-1)^n ●●○ Hardy: §51

Show that for any finite list ϕ(1),…,ϕ(N)\phi(1), \dots, \phi(N) there is a polynomial PP with P(n)=ϕ(n)P(n) = \phi(n) for n≤Nn \le N, but that no polynomial satisfies P(n)=(−1)nP(n) = (-1)^n for every positive integer nn.

Hint
For the first part, try P(x)=∑kϕ(k)∏j≠kx−jk−jP(x) = \sum_k \phi(k) \prod_{j \neq k} \dfrac{x - j}{k - j}. For the second, look at P(x)−1P(x) - 1 at the even integers.

Solution

Finite lists. In P(x)=∑k=1Nϕ(k) Lk(x)P(x) = \sum_{k=1}^{N} \phi(k)\, L_k(x) with Lk(x)=∏j≠k(x−j)/(k−j)L_k(x) = \prod_{j \ne k} (x - j)/(k - j) (product over j=1,…,Nj = 1, \dots, N), each LkL_k is a polynomial with Lk(k)=1L_k(k) = 1 and Lk(n)=0L_k(n) = 0 for the other n≤Nn \le N. Hence P(n)=ϕ(n)P(n) = \phi(n) for n=1,…,Nn = 1, \dots, N. (This is Lagrange’s interpolation formula.)

The whole sequence. Suppose P(n)=(−1)nP(n) = (-1)^n for every nn. Then the polynomial P(x)−1P(x) - 1 vanishes at x=2,4,6,…x = 2, 4, 6, \dots, infinitely many points. A non-zero polynomial of degree dd has at most dd roots, so P(x)−1P(x) - 1 is the zero polynomial and P(x)=1P(x) = 1 for every xx. But then P(1)=1≠−1P(1) = 1 \neq -1. This contradiction shows no such polynomial exists. The infinite data is a genuinely stronger demand than any finite part of it.

Exercise The factorial rule is not enough ●●○ Hardy: §51

Define F(x)=1F(x) = 1 for 0<x≤10 < x \le 1 and F(x)=x F(x−1)F(x) = x\,F(x-1) for x>1x > 1 (so FF is defined on all x>0x > 0, one unit interval at a time). Show that F(n)=n!F(n) = n! for every positive integer nn, and that FF satisfies F(x)=xF(x−1)F(x) = xF(x-1), yet FF is not Γ(x+1)\Gamma(x+1).

Hint
Compute F(32)F(\tfrac32) and compare with Γ(52)=34π≈1.329\Gamma(\tfrac52) = \tfrac34\sqrt\pi \approx 1.329.

Solution

F(1)=1F(1) = 1, and if F(n)=n!F(n) = n! then F(n+1)=(n+1)F(n)=(n+1)!F(n+1) = (n+1)F(n) = (n+1)!, so F(n)=n!F(n) = n! for all nn by induction. The rule F(x)=xF(x−1)F(x) = xF(x-1) holds for x>1x > 1 by construction. But F(32)=32F(12)=32F(\tfrac32) = \tfrac32 F(\tfrac12) = \tfrac32, while Γ(52)=34π≈1.329\Gamma(\tfrac52) = \tfrac34\sqrt{\pi} \approx 1.329. So F≠Γ(x+1)F \neq \Gamma(x+1). The functional equation pins the function down only once its values on one unit interval are chosen. (The modern theorem of Bohr and Mollerup says that Γ\Gamma is the only positive solution of Γ(x+1)=xΓ(x)\Gamma(x+1) = x\Gamma(x), Γ(1)=1\Gamma(1) = 1 for which log⁡Γ\log \Gamma is convex.)

Exercise xxx^x for rational xx ●○○ Hardy: §51

Explain why xxx^x has a meaning for every positive rational xx, and compute (14)1/4(\tfrac14)^{1/4} and (32)3/2(\tfrac32)^{3/2}.

Solution

For x=p/q>0x = p/q > 0, xp/qx^{p/q} is the pp-th power of the positive qq-th root of the positive number xx, which exists by Chapter I. So (14)1/4=1/44=1/2≈0.707(\tfrac14)^{1/4} = \sqrt[4]{1/4} = 1/\sqrt{2} \approx 0.707 and (32)3/2=27/8=3322≈1.837(\tfrac32)^{3/2} = \sqrt{27/8} = \tfrac{3\sqrt 3}{2\sqrt 2} \approx 1.837. For irrational xx, nothing defined so far gives xxx^x a meaning.

Check yourself

Check yourself True or false?

If FF interpolates a function of nn, then so does F(x)+7sin⁡2πxF(x) + 7\sin 2\pi x.

Why

True. sin⁡2πn=0\sin 2\pi n = 0 for every integer nn, so adding 7sin⁡2πx7\sin 2\pi x does not change any value at a positive integer. Any function that vanishes at all the integers may be added.

Check yourself Choose one

Which function of xx interpolates (−1)n(-1)^n and is defined for every real xx?

Why

cos⁡nπ=(−1)n\cos n\pi = (-1)^n for every integer nn. The formula (−1)x(-1)^x has no real value at x=12x = \tfrac12 (or at any irrational xx). sin⁡nπ=0\sin n\pi = 0, not (−1)n(-1)^n. And 1−2x1 - 2x gives −1-1 at x=1x = 1 but −3-3 at x=2x = 2.

Check yourself Enter a number

Using real roots, what is (−1)1/3(-1)^{1/3}?

Why

(−1)1/3(-1)^{1/3} is the real cube root of −1-1, which is −1-1, since (−1)3=−1(-1)^3 = -1. Note that cos⁡(π/3)=12\cos(\pi/3) = \tfrac12, so (−1)x(-1)^x and cos⁡πx\cos \pi x are different functions even where both are defined.

Hardy’s language

What is usually wanted is some formula involving x (of as simple a kind as possible) which assumes the given values for x = 1, 2, ….

— G. H. Hardy, §51

Summary

Summary
  • Interpolating a function of nn means finding a function of xx that takes the values ϕ(n)\phi(n) at x=nx = n.
  • Any two interpolations differ by a function that vanishes at all the integers, so there are always infinitely many (add csin⁡πxc \sin \pi x).
  • A formula that works for integers may fail elsewhere: (−1)x(-1)^x makes sense only at certain rationals, so (−1)n(-1)^n is interpolated by cos⁡πx\cos \pi x instead.
  • For n!n! the natural interpolation is the gamma function; extra conditions, not the values alone, are what single it out.