Multiple angle identity for cotangent
The previous post discusses generalized replicative functions, functions that satisfy
Donald Knuth says in Exercise 40 of Section 1.2.4 of TAOCP that the functions cot x and csc^2 x fall into this class of functions.
If this is true of cot x then it follows by differentiation that it is true of csc^2 x as well, so we will focus on the former.
I believe that for f(x) = cot(x) we have an = n and bn = 0, but I don't have a proof. If this is correct then
Here's a Python script that draws values of n and x at random and verifies that the left and right sides above are equal to at least 10 decimal places. It's not a proof, but it's good evidence.
import numpy as np def cot(x): return 1/np.tan(x) def f1(n, x): return n*cot(n*np.pi*x) def f2(n, x): return sum(cot(np.pi*(x + k/n)) for k in range(n)) np.random.seed(20211011) for _ in range(1000): n = np.random.randint(1, 50) x = np.random.random() a, b = f1(n,x), f2(n, x) assert( abs(a - b) <= abs(a)*1e-10 )
Note that NumPy doesn't have a cotangent function. See this post for quirks of how trig functions are supported in various environments.
An actual proof is left as an exercise for the reader. Knuth left it as an exercise too, but he didn't say what the as are, so I'm being nicer than he was. :)
If you come up with a proof, please share it in the comments.
UpdateHere's a proof combining the first two comments below. Start with the identity
and substitute x for x. Take the logarithm and then the derivative of both sides, divide by , and you get the identity we're trying to prove.
The post Multiple angle identity for cotangent first appeared on John D. Cook.