What's the derivative of $\frac{\cos((n+1)\theta)-\cos((n-1)\theta)}{2^n},\theta=\frac{x\pi}{n}$ for $x \in \{0,...,n-1\}$? 
What's the derivative of $\dfrac{\cos((n+1)\theta)-\cos((n-1)\theta)}{2^n}$,
  where $\theta=\dfrac{x\pi}{n}$ for $x \in \{0,...,n-1\}$ and $n$ is fixed?

So I've tried using the chain rule, and I got:
$a)$
$$\left( (n+1)\theta \right)'=\left( \pi x-\frac{x\pi}{n} \right)'=\pi(1-\frac{1}{n})$$
So because of that:
$$\left(\dfrac{\cos((n+1)\theta)-\cos((n-1)\theta)}{2^n}\right)'\stackrel{a)}{=}\dfrac{1}{2^n}\left( \pi(1-\frac{1}{n}) \sin(n-1)\theta- \pi(1-\frac{1}{n})\sin(n+1)\theta  \right)$$
But my textbook says, that it's 
$$\frac{(n+1)\sin((n+1)\theta)}{\sin\theta } - \frac{(n-1)\sin((n-1)\theta)}{\sin\theta }$$
How come?

The book is obviously wrong. I think you are also wrong. The correct answer is $$ \dfrac {n \sin x \cos (nx) + \cos x \sin (nx)}{2^{n-1}}. $$
