Looking at Jolley, Summation of Series, formula 445: $\sum_{k=0}^{n-1}\tan^2\left(\theta+{k\pi\over n}\right)=n^2\cot^2\left({n\pi\over2}+n\theta\right)+n(n-1)$
How can one prove this?
Considering $\left( \sum^{n-1}_{j=0}Z_j\right)^2 = \sum^{n-1}_{j=0} Z_j^2 +\sum^{n-1}_{j=0}\sum^{n-1}_{i\neq j} Z_jZ_i$ from here
I thought one could take the log differential of the well known sine product:
$\begin{align} \prod_{k=0}^{n-1}\sin\left(\theta + \frac{k\pi}{n}\right) &= 2^{1-n} \sin(n\theta) \end{align}$
to get
$n \cot(n\theta) = \sum_{k=0}^{n-1}\cot\left(\theta+\frac{k\pi}{n}\right)$
or
$-n \cot(\frac{n\pi}{2}+n\theta) = \sum_{k=0}^{n-1}\tan\left(\theta+\frac{k\pi}{n}\right)$
then square to get
$n^2 \cot(\frac{n\pi}{2}+n\theta)^2 = (\sum_{k=0}^{n-1}\tan\left(\theta+\frac{k\pi}{n})\right)^2$
but I cannot see how to show the
$\sum _{j=0}^{n-1} \sum _{k=0}^{n-1} \tan \left(\theta +\frac{\pi j}{n}\right) \tan \left(\theta +\frac{\pi k}{n}\right) [j\neq k]$
necessary for the $n(n-1)$ part of the identity.
Perhaps somebody could show a more successful method.
So, here is my idea, it occurred to me when I saw this well known sine product, that it will appear if we integrate the function
$$f\left(\theta\right) = \sum_{k=0}^{n-1} \tan^{2}\left(\theta+\frac{k\pi}{n}\right).$$
Since we are going to differentiate in the end, I won't be bothering to write integration constant:
$$\int f\left(\theta\right)d\theta = \int \sum_{k=0}^{n-1} \left(\sec^{2}\left(\theta+\frac{k\pi}{n}\right) - 1\right) d\theta = \sum_{k=0}^{n-1} \tan\left(\theta+\frac{k\pi}{n}\right) - n\theta $$
$$\int f\left(\theta\right)d\theta = - n\theta - \sum_{k=0}^{n-1} \cot\left(\theta - \frac{\pi}{2}+\frac{k\pi}{n}\right) = - n\theta - \sum_{k=0}^{n-1} \frac{\frac{d}{d\theta}\sin\left(\theta - \frac{\pi}{2}+\frac{k\pi}{n}\right)}{\sin\left(\theta - \frac{\pi}{2}+\frac{k\pi}{n}\right)}$$
$$\int f\left(\theta\right)d\theta = - n\theta - \frac{\frac{d}{d\theta}\Pi_{k=0}^{n-1}\sin\left(\theta - \frac{\pi}{2}+\frac{k\pi}{n}\right)}{\Pi_{k=0}^{n-1}\sin\left(\theta - \frac{\pi}{2}+\frac{k\pi}{n}\right)} = -n\theta -\frac{\frac{d}{d\theta}2^{1-n}\sin\left(n\left(\theta-\frac{\pi}{2}\right)\right)}{2^{1-n}\sin\left(n\left(\theta-\frac{\pi}{2}\right)\right)}$$
$$ \int f\left(\theta\right)d\theta = - n\theta - n\frac{\cos\left(n\theta-\frac{n\pi}{2}\right)}{\sin\left(n\theta-\frac{n\pi}{2}\right)} = -n\theta -n\cot\left(n\theta-\frac{n\pi}{2}\right). $$
If you sum $n\pi$ in the argument of $\cot$ it won't change its value, so:
$$\int f\left(\theta\right)d\theta = -n\theta -n\cot\left(n\theta+\frac{n\pi}{2}\right),$$
now differentiating we get:
$$f\left(\theta\right) = -n +n^{2}\csc^{2}\left(n\theta+\frac{n\pi}{2}\right) = -n +n^{2}\left(1+\cot^{2}\left(n\theta+\frac{n\pi}{2}\right)\right)$$
which give us the equality desired.