Article 5QKN6 Multiple angle identity for cotangent

Multiple angle identity for cotangent

by
John
from John D. Cook on (#5QKN6)

The previous post discusses generalized replicative functions, functions that satisfy

replicative_generalized.svg

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

cot_multiple_angle2.svg

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.

Update

Here's a proof combining the first two comments below. Start with the identity

sine_product2.svg

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.8wsqcziLv7I
External Content
Source RSS or Atom Feed
Feed Location http://feeds.feedburner.com/TheEndeavour?format=xml
Feed Title John D. Cook
Feed Link https://www.johndcook.com/blog
Reply 0 comments