Is there any identity for $\sum_{k=0}^{n-1}\tan(x+ka) $?? I found this series
$$
\sum_{k=0}^{n-1}\tan\left(\theta+\frac{k\pi}{n}\right)=−n\cot\left(\frac{n\pi}{2}+n\theta\right)
$$
but it's not what I need.
 A: Lemma 1:

let $x_{j}=e^{i(2a+\frac{j-1}{n}\cdot 2\pi)}$,then we have
  $$\dfrac{1}{1+x_{1}}+\dfrac{1}{1+x_{2}}+\cdots+\dfrac{1}{1+x_{n}}=\dfrac{n}{1+(-1)^{n-1}e^{2ina}}$$

Proof:

First we note
  $$\dfrac{1}{1+x_{1}}+\dfrac{1}{1+x_{2}}+\cdots+\dfrac{1}{1+x_{n}}=\dfrac{n+(n-1)\sum_{j=1}^{n}x_{j}+(n-2)\sum_{i,j}x_{i}x_{j}+\cdots+\sum_{i_{1},\cdots,i_{n-1}}x_{i_{1}}x_{i_{2}}\cdots x_{i_{n-1}}}{\prod_{j=1}^{n}(1+x_{j})}$$
  and
  since 
  $$x_{1}x_{2}x_{3}\cdots x_{n}=e^{i(2na+\dfrac{1+2+\cdots+n-1}{n}\cdot 2\pi)}=e^{2ina+(n-1)i\pi}=(-1)^{n-1}e^{2ina}$$
  so I
   note
  $x_{1},x_{2},\cdots,x_{n}$ is equation roots
  $$z^n=e^{2na\cdot i}$$
  because
  $$x^n_{j}=\left(e^{i(2a+\frac{(j-1)\pi}{n}}\right)^n=e^{2ina+(j-1)2\pi}=e^{2ina},j=1,2,\cdots,n$$
  so use Vieta's formulas
  $$\begin{cases}
\sum_{i=1}^{n}x_{i}=0\\
\sum_{i,j}x_{i}x_{j}=0\\
\sum_{i,j,k}x_{i}x_{j}x_{k}=0\\
\cdots\cdots\\
x_{1}x_{2}\cdots x_{n}=(-1)^n\cdot (-e^{2ina})=(-1)^{n-1}e^{2ina}
\end{cases}$$
  so
  $$\dfrac{1}{1+x_{1}}+\dfrac{1}{1+x_{2}}+\cdots+\dfrac{1}{1+x_{n}}=\dfrac{n+0}{\prod_{i=1}^{n}(1+x_{i})}$$
  By the other hand
  $$z^n-e^{2ina}=(z-x_{1})(z-x_{2})\cdots (z-x_{n})$$
  let $z=-1$,so
  $$(1+x_{1})(1+x_{2})\cdots(1+x_{n})=1+(-1)^{n-1}e^{2ina}$$
  so
  $$\dfrac{1}{1+x_{1}}+\dfrac{1}{1+x_{2}}+\cdots+\dfrac{1}{1+x_{n}}=\dfrac{n}{1+(-1)^{n-1}e^{2ina}}$$

Lemma 2:
$$\dfrac{n}{i}-\dfrac{2}{i}\cdot\dfrac{n}{1+(-1)^{n-1}e^{2ina}}=-n\cot{\left(\dfrac{n\pi}{2}+na\right)}$$
Proof:
since
\begin{align*}
\dfrac{n}{i}-\dfrac{2}{i}\cdot\dfrac{n}{1+(-1)^{n-1}e^{2ina}}&=\dfrac{n}{i}\left(1-\dfrac{2}{1+(-1)^{n-1}e^{2ina}}\right)\\
&=\dfrac{n}{i}\cdot\dfrac{(-1)^{n-1}e^{2ina}-1}{1+(-1)^{n-1}e^{2ina}}\\
&=n\cdot\dfrac{\frac{(-1)^{n-1}\cdot e^{ina}-e^{-ina}}{2i}}{\frac{e^{-ina}+(-1)^{n-1}e^{ina}}{2}}\\
&=-n\cot{\left(\dfrac{n\pi}{2}+na\right)}
\end{align*}
since
$$\tan{x}=\dfrac{1}{i}\dfrac{e^{ix}-e^{-ix}}{e^{ix}+e^{-ix}}=\dfrac{1}{i}\left(1-\dfrac{2}{e^{2ix}+1}\right)$$
let
$x=a+\dfrac{(j-1)\pi}{n},j=1,2,3,\cdots,n)$,then we have
$$\sum_{j=0}^{n}\tan{(a+\dfrac{j-1}{n}\pi)}=\dfrac{n}{i}-\dfrac{2}{i}\sum_{j=1}^{n}\dfrac{1}{e^{i(2a+\frac{j-1}{n}\cdot 2\pi)}+1}$$
let
$x_{j}=e^{i(2a+\frac{j-1}{n}\cdot 2\pi)}$,
Use this Lemma1,2,we have
$$\sum_{j=0}^{n}\tan{(a+\dfrac{j-1}{n}\pi)}=\dfrac{n}{i}-\dfrac{2}{i}\cdot\dfrac{n}{1+(-1)^{n-1}e^{2ina}}=-n\cot{\left(\dfrac{n\pi}{2}+na\right)}$$
