Part 2. Chebyshev polynomials from powers of a point#

We take powers of a point \(P=(a,b)\) of the circle. Each coordinate of \(P^n\) is a polynomial in \(a\) and \(b\), and on the circle we may replace \(b^2\) by \(1-a^2\). We will see that then the first coordinate depends only on \(a\), while the second equals \(b\) times a polynomial in \(a\). These polynomials are the Chebyshev polynomials of the first and second kind, \(T_n\) and \(U_{n-1}\). We will derive all their basic properties from the group law and check each of them by a symbolic computation.

import numpy as np
import matplotlib.pyplot as plt
import sympy as sp

a, b = sp.symbols("a b")
JEDEN, ZERO = sp.Integer(1), sp.Integer(0)


def m(P, Q):
    """Prawo grupowe okręgu (część 1)."""
    a, b = P
    c, d = Q
    return (a * c - b * d, a * d + b * c)


def redukuj(w):
    """Reszta z dzielenia przez a² + b² - 1 względem b (b² → 1 - a²)."""
    return sp.expand(sp.rem(sp.expand(w), a**2 + b**2 - 1, b))

Powers of a general point#

Let us compute successive powers of the point with symbolic coordinates \(P=(a,b)\). After each multiplication we reduce the result with the function redukuj, that is, we replace \(b^2\) by \(1-a^2\).

P = (a, b)
Q = (JEDEN, ZERO)
for n in range(1, 7):
    Q = tuple(redukuj(q) for q in m(Q, P))
    print(f"P^{n} = ({Q[0]},  {sp.factor(Q[1])})")
P^1 = (a,  b)
P^2 = (2*a**2 - 1,  2*a*b)
P^3 = (4*a**3 - 3*a,  b*(2*a - 1)*(2*a + 1))
P^4 = (8*a**4 - 8*a**2 + 1,  4*a*b*(2*a**2 - 1))
P^5 = (16*a**5 - 20*a**3 + 5*a,  b*(4*a**2 - 2*a - 1)*(4*a**2 + 2*a - 1))
P^6 = (32*a**6 - 48*a**4 + 18*a**2 - 1,  2*a*b*(2*a - 1)*(2*a + 1)*(4*a**2 - 3))

After reduction the first coordinate does not contain \(b\), and the second has the form \(b\) times a polynomial in \(a\). Let us call these polynomials \(T_n(a)\) and \(U_{n-1}(a)\):

\[ P^n=\bigl(T_n(a),\ b\,U_{n-1}(a)\bigr). \]

Definition by induction#

From \(P^{n+1}=P^n\cdot P\) and the formula for \(m\) we read off how to pass from \(n\) to \(n+1\):

\[ \bigl(T_n,\ bU_{n-1}\bigr)\cdot(a,b) =\bigl(aT_n-b^2U_{n-1},\ b\,(T_n+aU_{n-1})\bigr), \]

and on the circle \(b^2=1-a^2\). This gives a recursive definition:

\[ T_0=1,\quad U_{-1}=0,\qquad T_{n+1}=aT_n-(1-a^2)\,U_{n-1},\qquad U_n=T_n+a\,U_{n-1}. \]
def czebyszew(N):
    """Listy T[0..N] i U[0..N], gdzie U[n] to U_{n-1} (U[0] = U_{-1} = 0)."""
    T, U = [JEDEN], [ZERO]
    for _ in range(N):
        T_n, U_n = T[-1], U[-1]
        T.append(sp.expand(a * T_n - (1 - a**2) * U_n))
        U.append(sp.expand(T_n + a * U_n))
    return T, U


T, U = czebyszew(40)
for n in range(6):
    print(f"T_{n} = {T[n]}")
T_0 = 1
T_1 = a
T_2 = 2*a**2 - 1
T_3 = 4*a**3 - 3*a
T_4 = 8*a**4 - 8*a**2 + 1
T_5 = 16*a**5 - 20*a**3 + 5*a

Theorem 1

For every point \(P=(a,b)\) of the circle and every \(n\ge0\) we have \(P^n=\bigl(T_n(a),\ b\,U_{n-1}(a)\bigr)\).

Proof. Induction on \(n\). For \(n=0\) both sides are \((1,0)\). In the step we assume that \(P^n=(T,\ bU)\) for some numbers \(T,U\), and check that \(P^{n+1}=P^n\cdot P\) has the form from the definition. The induction step is a single symbolic check in which \(T\) and \(U\) are ordinary symbols:

Ts, Us = sp.symbols("T U")
krok = m((Ts, b * Us), (a, b))
nastepny = (a * Ts - (1 - a**2) * Us, b * (Ts + a * Us))
print([redukuj(krok[i] - nastepny[i]) for i in range(2)])
[0, 0]

Both differences are zero modulo \(a^2+b^2-1\), which completes the proof. \(\square\)

The proof uses neither angles nor trigonometric functions and works over every field (also over \(\mathbb{F}_p\)). For the point \((\cos\theta,\sin\theta)\), de Moivre’s formula gives \(P^n=(\cos n\theta,\sin n\theta)\), so we recover the classical definition:

\[ T_n(\cos\theta)=\cos n\theta,\qquad U_{n-1}(\cos\theta)=\frac{\sin n\theta}{\sin\theta}. \]

Our polynomials agree with the ones built into SymPy:

zgodne = all(sp.expand(T[n] - sp.chebyshevt(n, a)) == 0 for n in range(41))
zgodne_U = all(sp.expand(U[n + 1] - sp.chebyshevu(n, a)) == 0
               for n in range(40))
print("T_n = chebyshevt(n) dla n ≤ 40:", zgodne)
print("U_n = chebyshevu(n) dla n ≤ 39:", zgodne_U)
T_n = chebyshevt(n) dla n ≤ 40: True
U_n = chebyshevu(n) dla n ≤ 39: True

Hide code cell source

INDYGO_SKALA = ["#a5b4fc", "#818cf8", "#6366f1", "#4f46e5", "#4338ca",
                "#312e81"]
xs = np.linspace(-1, 1, 801)
fig, ax = plt.subplots(figsize=(7, 3.6))
for n, kolor in zip(range(1, 7), INDYGO_SKALA):
    f = sp.lambdify(a, T[n], "numpy")
    ax.plot(xs, f(xs) + 0 * xs, color=kolor, lw=2, label=f"$T_{n}$")
ax.axhline(0, color="#94a3b8", lw=0.8)
ax.set_xlim(-1, 1)
ax.set_ylim(-1.1, 1.1)
ax.set_xlabel("$a$")
ax.set_title("Wielomiany Czebyszewa $T_1, \\dots, T_6$ na $[-1, 1]$",
             loc="left", fontsize=11)
ax.legend(ncol=6, loc="lower center", bbox_to_anchor=(0.5, -0.38),
          frameon=False, fontsize=9)
for bok in ("top", "right"):
    ax.spines[bok].set_visible(False)
ax.grid(color="#e2e8f0", lw=0.6)
fig.tight_layout()
plt.show()
../_images/0c8aa581048d96af97331305973064198be53dfc51942dc62dffe814776f6c15.png

On the interval \([-1,1]\) the values of \(T_n\) stay within \([-1,1]\), because \(T_n(a)\) is the first coordinate of a point of the circle. Outside this interval \(b=\sqrt{1-a^2}\) is not real and \(T_n\) grows like \(2^{n-1}a^n\).

The three-term recurrence#

The operation \(m\) is bilinear: linear in each argument separately. Therefore, for any \(Q=(x,y)\), not necessarily on the circle,

\[ Q\cdot(a,b)+Q\cdot(a,-b)=Q\cdot(2a,0)=2a\,Q, \]

and for \(Q=P^n\) and \(P^{-1}=(a,-b)\) the left-hand side is \(P^{n+1}+P^{n-1}\). Comparing coordinates, we get the classical recurrence

\[ T_{n+1}=2a\,T_n-T_{n-1},\qquad U_{n}=2a\,U_{n-1}-U_{n-2}. \]
x, y = sp.symbols("x y")
lewa = [u + v for u, v in zip(m((x, y), (a, b)), m((x, y), (a, -b)))]
print("Q·P + Q·P⁻¹ - 2a·Q =", [sp.expand(l - 2 * a * q)
                               for l, q in zip(lewa, (x, y))])
print("T_{n+1} = 2a T_n - T_{n-1} dla n < 40:",
      all(sp.expand(T[n + 1] - 2 * a * T[n] + T[n - 1]) == 0
          for n in range(1, 40)))
Q·P + Q·P⁻¹ - 2a·Q = [0, 0]
T_{n+1} = 2a T_n - T_{n-1} dla n < 40: True

Pell’s equation for polynomials#

\(P^n\) lies on the circle, so \(T_n^2+b^2U_{n-1}^2=1\), that is, after substituting \(b^2=1-a^2\):

\[ T_n(a)^2-(a^2-1)\,U_{n-1}(a)^2=1. \]

This is Pell’s equation \(X^2-(a^2-1)Y^2=1\) in the polynomial ring, and \((T_n,U_{n-1})\) are its solutions — the successive powers of the fundamental solution \((a,1)\). We will return to this in Part 4, with the genuine Pell equation in the integers.

print("T_n² - (a² - 1) U_{n-1}² = 1 dla n ≤ 40:",
      all(sp.expand(T[n]**2 - (a**2 - 1) * U[n]**2) == 1 for n in range(41)))
T_n² - (a² - 1) U_{n-1}² = 1 dla n ≤ 40: True

Composition: \(T_m\circ T_n=T_{mn}\)#

This is the most beautiful consequence of the group law.

Theorem 2

For all \(m,n\ge1\) we have \(T_m\bigl(T_n(a)\bigr)=T_{mn}(a)\) and \(U_{mn-1}(a)=U_{m-1}\bigl(T_n(a)\bigr)\cdot U_{n-1}(a)\).

Proof. Let \(P=(a,b)\) lie on the circle and \(Q=P^n=\bigl(T_n(a),\ bU_{n-1}(a)\bigr)\). The point \(Q\) also lies on the circle, so by Theorem 1 applied to \(Q\):

\[ Q^m=\Bigl(T_m\bigl(T_n(a)\bigr),\ bU_{n-1}(a)\cdot U_{m-1}\bigl(T_n(a)\bigr)\Bigr). \]

On the other hand, \(Q^m=P^{mn}=\bigl(T_{mn}(a),\ bU_{mn-1}(a)\bigr)\). We compare coordinates. One subtlety remains: the equalities hold in the ring \(\mathbb{Q}[a,b]/(a^2+b^2-1)\), while we want equalities of polynomials in \(a\) alone. Every element of this ring has a unique representation \(r_0(a)+b\,r_1(a)\) (the remainder of division by \(b^2+a^2-1\) with respect to \(b\), our function redukuj), so two polynomials in \(a\) that are equal in this ring are truly equal. In the same way we cancel the factor \(b\) in the second coordinate. \(\square\)

The proof is general, but the computer can additionally check the claim for many pairs \((m,n)\):

zlozenie = all(sp.expand(T[k].subs(a, T[n]) - T[k * n]) == 0
               for k in range(1, 9) for n in range(1, 6))
zlozenie_U = all(sp.expand(U[k * n] - U[k].subs(a, T[n]) * U[n]) == 0
                 for k in range(1, 9) for n in range(1, 6))
print("T_m(T_n) = T_mn dla m ≤ 8, n ≤ 5:", zlozenie)
print("U_{mn-1} = U_{m-1}(T_n)·U_{n-1} dla m ≤ 8, n ≤ 5:", zlozenie_U)
print("T_3(T_5) =", sp.factor(T[3].subs(a, T[5])) == sp.factor(T[15]),
      "  stopień:", sp.degree(T[15], a))
T_m(T_n) = T_mn dla m ≤ 8, n ≤ 5: True
U_{mn-1} = U_{m-1}(T_n)·U_{n-1} dla m ≤ 8, n ≤ 5: True
T_3(T_5) = True   stopień: 15

Corollary: Chebyshev polynomials commute under composition, \(T_m\circ T_n=T_n\circ T_m\), just like the powers \(a^m\circ a^n=a^n\circ a^m\). Both families come from the same construction: the powers \(a^n\) are exponentiation in the multiplicative group, and \(T_n\) — in the circle group.

This is no accident. J. F. Ritt proved in 1923 that there are no other essentially different examples: if two polynomials of degree at least \(2\) commute under composition and are not iterates of a common polynomial, then after a linear change of variable they are either both powers or both Chebyshev polynomials (up to sign). So both families come from one-dimensional algebraic groups: the multiplicative group and the circle.

The product formula#

By bilinearity, \(P^n+P^{-n}=\bigl(2T_n(a),0\bigr)\), and multiplication by the point \((2T_n,0)\) is multiplication by the number \(2T_n\). Hence \(P^{m+n}+P^{m-n}=P^m\cdot(P^n+P^{-n})=2T_n(a)\,P^m\) and

\[ 2\,T_m T_n=T_{m+n}+T_{|m-n|}. \]
iloczynowy = all(sp.expand(2 * T[k] * T[n] - T[k + n] - T[abs(k - n)]) == 0
                 for k in range(16) for n in range(16))
print("2 T_m T_n = T_{m+n} + T_{|m-n|} dla m, n < 16:", iloczynowy)
2 T_m T_n = T_{m+n} + T_{|m-n|} dla m, n < 16: True

The derivative: motion along the circle#

The derivative also has a geometric meaning here. Motion along the circle at constant speed is the tangent vector field \(D=-b\,\partial_a+a\,\partial_b\); it satisfies \(D(a)=-b\), \(D(b)=a\) and the Leibniz rule. We will prove by induction that for \(P^n=(x_n,y_n)\)

\[ D(x_n)=-n\,y_n,\qquad D(y_n)=n\,x_n, \]

that is, the \(n\)-th power “spins” \(n\) times faster. For \(n=1\) this is the definition of \(D\). In the step, \(x_{n+1}=ax_n-by_n\) and \(y_{n+1}=ay_n+bx_n\); the Leibniz rule gives formulas for \(D(x_{n+1})\) and \(D(y_{n+1})\) in terms of \(x_n,y_n,D(x_n),D(y_n)\), and in place of \(D(x_n),D(y_n)\) we insert the induction hypothesis. Again a single check with symbols \(x,y\) instead of specific polynomials suffices:

n = sp.Symbol("n")
Dx, Dy = -n * y, n * x                       # założenie indukcyjne
D_x_nast = -b * x + a * Dx - a * y - b * Dy  # D(a x - b y), Leibniz
D_y_nast = -b * y + a * Dy + a * x + b * Dx  # D(a y + b x)
x_nast, y_nast = a * x - b * y, a * y + b * x
print([sp.expand(D_x_nast + (n + 1) * y_nast),
       sp.expand(D_y_nast - (n + 1) * x_nast)])
[0, 0]

From \(x_n=T_n(a)\) we get \(D(x_n)=T_n'(a)\cdot D(a)=-b\,T_n'(a)\), and on the other hand \(-n\,y_n=-n\,b\,U_{n-1}(a)\). After cancelling \(b\):

\[ T_n'=n\,U_{n-1}. \]

Applying \(D\) twice gives \(D^2(x_n)=-n^2x_n\). Let us compute \(D^2\) for an arbitrary function \(g(a)\):

g = sp.Function("g")


def D(w):
    return -b * sp.diff(w, a) + a * sp.diff(w, b)


D2 = redukuj(D(D(g(a))))
print("D²(g(a)) =", sp.collect(D2, [g(a).diff(a, 2), g(a).diff(a)]))
print("= (1 - a²)·g'' - a·g':",
      sp.expand(D2 - ((1 - a**2) * g(a).diff(a, 2) - a * g(a).diff(a))) == 0)
D²(g(a)) = -a*Derivative(g(a), a) + (1 - a**2)*Derivative(g(a), (a, 2))
= (1 - a²)·g'' - a·g': True

We got \((1-a^2)g''-a\,g'\). Hence \(T_n\) satisfies the Chebyshev differential equation

\[ (1-a^2)\,T_n''-a\,T_n'+n^2\,T_n=0. \]
pochodna = all(sp.expand(sp.diff(T[k], a) - k * U[k]) == 0 for k in range(41))
rownanie = all(sp.expand((1 - a**2) * sp.diff(T[k], a, 2)
                         - a * sp.diff(T[k], a) + k**2 * T[k]) == 0
               for k in range(41))
print("T_n' = n U_{n-1} dla n ≤ 40:", pochodna)
print("równanie Czebyszewa dla n ≤ 40:", rownanie)
T_n' = n U_{n-1} dla n ≤ 40: True
równanie Czebyszewa dla n ≤ 40: True

Summary#

We derived all the properties in this part from the group law, and we checked each induction step by a single symbolic computation. The table collects where they came from. In Part 5 we will see that this is one observation viewed from different sides.

Property

Where it comes from in the circle group

Proof

\(P^n=(T_n,\ bU_{n-1})\)

\(P^{n+1}=P^n\cdot P\)

induction, step = one reduction

\(T_{n+1}=2aT_n-T_{n-1}\)

\(P^{n+1}+P^{n-1}=2a\,P^n\)

bilinearity of \(m\)

\(T_n^2-(a^2-1)U_{n-1}^2=1\)

\(P^n\) lies on the circle

closure

\(T_m\circ T_n=T_{mn}\)

\((P^n)^m=P^{mn}\)

the theorem for \(Q=P^n\)

\(2T_mT_n=T_{m+n}+T_{\lvert m-n\rvert}\)

\(P^m(P^n+P^{-n})\)

bilinearity of \(m\)

\(T_n'=nU_{n-1}\), Chebyshev equation

motion along the circle

induction with the Leibniz rule

Exercises#

  1. From \(P^{2n}=(P^n)^2\) derive \(T_{2n}=2T_n^2-1\) and \(U_{2n-1}=2T_nU_{n-1}\). Check symbolically.

  2. Show that \(T_n(-a)=(-1)^nT_n(a)\), using the point \((-1,0)\) of the circle.

  3. The roots of \(T_n\) are \(\cos\frac{(2k-1)\pi}{2n}\), \(k=1,\dots,n\). Explain this via the points \(P\) with \(P^n=(0,\pm1)\) and check numerically for \(n=7\).

  4. The Dickson polynomials \(D_n(x)=2T_n(x/2)\) have integer coefficients and leading coefficient \(1\). Write down \(D_1,\dots,D_6\) and check that \(D_m\circ D_n=D_{mn}\).

Literature and further reading#

  • T. J. Rivlin, Chebyshev Polynomials: From Approximation Theory to Algebra and Number Theory, 2nd ed., Wiley, 1990 — the classic monograph, also on composition and arithmetic properties.

  • J. C. Mason, D. C. Handscomb, Chebyshev Polynomials, Chapman & Hall/CRC, 2003.

  • NIST DLMF, Chapter 18 — formulas and properties of orthogonal polynomials, including Chebyshev polynomials; Chebyshev polynomials on Wikipedia.

  • J. F. Ritt, Permutable rational functions, Transactions of the AMS 25 (1923), 399–448 (DOI) — commuting polynomials and rational functions.

  • The Mathlib library (Lean) has these polynomials and their properties with formal proofs, among others the composition Polynomial.Chebyshev.T_mul and the product formula Polynomial.Chebyshev.T_mul_T: documentation.