Geometry formulas, how to show identities. Given $d$ is integer:
How do I show:
$$\frac{1}{(e^{\frac{2i\pi p}{d}}-1)}=\frac{-i}{2\tan(\frac{\pi p}{d})}-\frac{1}{2}$$
How do I rewrite and show, for $k$ is an integer:
$$ \sum_{p=1}^{d-1}\frac{\cos(\frac{2\pi p}{d})}{\tan^k(\frac{\pi p}{d})}  $$
is 0 for every odd k, and if anyone knows, what will the value be at even $k$, since they turn out to be "nice" when I compute it.
And vice versa for :
$$ \sum_{p=1}^{d-1}\frac{\sin(\frac{2\pi p}{d})}{\tan^k(\frac{\pi p}{d})}  $$
Why is it 0 at even $k$, and what is the value at odd $k$.
 A: $$\begin{align}
\frac{1}{e^{i2\pi p/d}-1}&=\frac{e^{-i\pi p/d}}{e^{i\pi p/d}-e^{-i\pi p/d}}\\\\
&=\frac{e^{-i\pi p/d}}{2i\sin \pi p/d}\\\\
&=\frac{\cos \pi p/d-i\sin \pi p/d}{2i\sin \pi p/d}\\\\
&=\frac{-i}{2}\cot \pi p/d-\frac12 \tag 1
\end{align}$$

To show that 
$$\sum_{p=1}^{d-1}\frac{\cos 2\pi p/d}{\tan^k\pi p/d}=0$$
for odd $k$, we make use of the relationship in $(1)$.  There, we observe that 
$$\frac{1}{\tan \pi p/d}=i\frac{e^{i2\pi p/d}+1}{e^{i2\pi p/d}-1}$$
Thus, we have
$$\begin{align}
\sum_{p=1}^{d-1}\frac{\cos 2\pi p/d}{\tan^k\pi p/d}&=i^k\,\sum_{p=1}^{d-1}\cos 2\pi p/d\left(\frac{e^{i2\pi p/d}+1}{e^{i2\pi p/d}-1}\right)^k \tag 2\\\\
&=\frac{i^k}{2}\,\sum_{p=1}^{d-1}\left(e^{i2\pi p/d}+e^{-i2\pi p/d}\right)\left(\frac{e^{i2\pi p/d}+1}{e^{i2\pi p/d}-1}\right)^k \tag 3 \\\\
&=\frac{i^k}{2}\,\sum_{p=1}^{d-1}e^{i2\pi p/d}\left(\frac{e^{i2\pi p/d}+1}{e^{i2\pi p/d}-1}\right)^k+\frac{i^k}{2}\,\sum_{p=1}^{d-1}e^{-i2\pi p/d}\left(\frac{e^{i2\pi p/d}+1}{e^{i2\pi p/d}-1}\right)^k \tag 4 \\\\
&=\frac{i^k}{2}\,\sum_{p=1}^{d-1}e^{i2\pi p/d}\left(\frac{e^{i2\pi p/d}+1}{e^{i2\pi p/d}-1}\right)^k+\frac{i^k}{2}\,\sum_{p=-1}^{-(d-1)}e^{i2\pi p/d}\left(\frac{e^{-i2\pi p/d}+1}{e^{-i2\pi p/d}-1}\right)^k \tag  5\\\\
&=\frac{i^k}{2}\,\sum_{p=1}^{d-1}e^{i2\pi p/d}\left(\frac{e^{i2\pi p/d}+1}{e^{i2\pi p/d}-1}\right)^k+\frac{i^k}{2}\,\sum_{p=-1}^{-(d-1)}e^{i2\pi p/d}(-1)^k\left(\frac{e^{i2\pi p/d}+1}{e^{i2\pi p/d}-1}\right)^k \tag 6 \\\\
&=\frac{i^k}{2}\,\sum_{p=1}^{d-1}e^{i2\pi p/d}\left(\frac{e^{i2\pi p/d}+1}{e^{i2\pi p/d}-1}\right)^k+\frac{i^k}{2}\,\sum_{p=1}^{d-1}e^{i2\pi p/d}(-1)^k\left(\frac{e^{i2\pi p/d}+1}{e^{i2\pi p/d}-1}\right)^k \tag 7 \\\\
&=\frac{i^k}{2}\,\sum_{p=1}^{d-1}(1+(-1)^k)e^{i2\pi p/d}\left(\frac{e^{i2\pi p/d}+1}{e^{i2\pi p/d}-1}\right)^k \tag 8 \\\\
&=0\,\,\text{for odd values of}\,\,k \tag 9
\end{align}$$
as was to be shown!
NOTES:
In going from $(2)$ to $(3)$, we wrote $\cos 2\pi p/d=\frac{e^{i2\pi p/d}+e^{-i2\pi p/d}}{2}$
In going from $(3)$ to $(4)$, we split the summation.
In going from $(4)$ to $(5)$, we made the substitution $p \to -p$ for the summation index.
In going from $(5)$ to $(6)$, we noted that $\frac{e^{-i2\pi p/d}+1}{e^{-i2\pi p/d}-1}=-\frac{e^{i2\pi p/d}+1}{e^{i2\pi p/d}-1}$.
In going from $(6)$ to $(7)$, we made the substitution $p \to p-d$ for the summation index.
In going from $(7)$ to $(8)$, we recombined the summations.
In going from $(8)$ to $(9)$, we recognized that $1+(-1)^k=0$ for odd values of $k$.
