Help finding the residue of $1/(z^8+1)$ Help finding the residue of $1/(z^8+1)$
I'm integrating over $\{ Re^{it} | 0 \leq t \leq \pi \}$, and I found 4 simple poles at $z_0=e^{in\pi/8}$ where $n = 0,...,3$ and I'm trying to calculate $res(1/(z^8+1),z_0)$ 
calculating this: $$\lim_{z\to z_0} (z-z_0)f = \lim_{z\to z_0}\frac{z-z_0}{1+z^8},$$ now are there any algebra tricks I can do to simplify this?
 A: You don't need to factor $z^8+1$. The function $f(z)=\frac{1}{z^{8}+1}$ has 8 simple poles $z_{k}$, $k\in\left\{ 0,1,2\ldots ,7\right\} $, which are the zeros of the equation $z^{8}+1=0\Leftrightarrow z^{8}=-1$, i.e. the complex numbers $z_{k}=e^{i\left( \pi +2k\pi \right) /8}=e^{i\left(2k+1 \right)\pi /8}$ (and not $z_{k}=e^{i k\pi  /8}$ that you computed). 

(...) are there any algebra tricks I can do to simplify this?

Since the numerator of $f(z)$ is $1$, the residue $\mathrm{Res}\left(
f(z);z_{k}\right) $ reduces to the inverse of the derivative of the
denominator at $z=z_{k}$ 
\begin{equation*}
\mathrm{Res }\left( f(z);z_{k}\right) =\frac{1}{\left. \frac{d}{dz}
\left( z^{8}+1\right) \right\vert _{z=z_{k}}}=\frac{1}{8z_{k}^{7}}=\frac{1}{
8e^{i7\left( 2k+1\right) \pi /8}},\tag{1}
\end{equation*}
because when $f$ is of the form $f(z)=\frac{p(z)}{q(z)}$, where both numerator and
denominator are analytical functions, the following equality holds
\begin{equation*}
\mathrm{Res}\left( f(z);z_{k}\right) =\frac{p(z_{k})}{q^{\prime }(z_k)}
,\tag{2}
\end{equation*}
provided that $z_{k}$ is a simple pole of $f(z)$ and $p(z_{k})\neq 0$, $
q(z_{k})=0$, $q'(z_{k})\neq 0$. (Theorem 2 in section 69 of Complex Variables
and Applications / J. Brown and R. Churchill, International ed. 2003,
McGraw-Hill).
ADDED 2. For instance $$\mathrm{Res}\left( f(z);z_{0}\right)=\frac{1}{8}e^{-i7\pi /8}=-\frac{1}{8}\cos \frac{\pi }{8}-i\frac{1}{8}\sin \frac{\pi }{8}=-\frac{1}{16}\sqrt{2+\sqrt{2}}-\frac{1}{16}i\sqrt{2-\sqrt{2}}.$$
ADDED. Grouping the residues with equal immaginary part and symmetrical real part, each of the two following sums becomes pure imaginary, and respectively a function of $\sin\frac{\pi}{8}$ and $\sin\frac{3\pi}{8}$:
\begin{eqnarray*}
\mathrm{Res }\left( f(z);z_{0}\right) +\mathrm{Res }\left( f(z);z_{3}\right) 
&=&\frac{1}{8e^{i7\left( 1\right) \pi /8}}+\frac{1}{8e^{i7\left( 7\right)
\pi /8}} \\
&=&\frac{1}{8e^{i7\pi /8}}+\frac{1}{8e^{i\pi /8}}=-\frac{1}{8}\left( e^{i\pi
/8}+e^{i7\pi /8}\right)  \\
&=&-\frac{1}{8}\left( i2\sin \frac{\pi }{8}\right) =-\frac{1}{8}i\sqrt{2-\sqrt{2}},
\end{eqnarray*}
and
\begin{eqnarray*}
\mathrm{Res }\left( f(z);z_{1}\right) +\mathrm{Res }\left( f(z);z_{2}\right) 
&=&\frac{1}{8e^{i7\left( 3\right) \pi /8}}+\frac{1}{8e^{i7\left( 5\right)
\pi /8}} \\
&=&\frac{1}{8e^{i5\pi /8}}+\frac{1}{8e^{i3\pi /8}}=\cdots  \\
&=&-\frac{1}{8}\left( i2\sin \frac{3\pi }{8}\right) =-\frac{1}{8}i\sqrt{2+
\sqrt{2}}.
\end{eqnarray*}
The improper real integral $I=\int_{-\infty }^{\infty }\frac{1}{x^{8}+1}dx$ evaluates to
\begin{eqnarray*}
I &=&2\pi i\sum_{k=0}^{3}\mathrm{Res }\left( f(z);z_{k}\right)  =2\pi i\left( -\frac{1}{8}i\sqrt{2-\sqrt{2}}-\frac{1}{8}i\sqrt{2+\sqrt{2}}
\right)  \\
&=&2\pi i\left( -\frac{1}{8}i\sqrt{4+2\sqrt{2}}\right) =\frac{\pi }{4}\sqrt{
4+2\sqrt{2}}.
\end{eqnarray*}
A: $$z^8+1=(z-i^{\frac{1}{8}})(z+i^{\frac{1}{8}})(z-i^{\frac{3}{8}})(z+i^{\frac{3}{8}})(z-i^{\frac{5}{8}})(z+i^{\frac{5}{8}})(z-i^{\frac{7}{8}})(z+i^{\frac{7}{8}})$$
$$Res_{z=\sqrt[8]i}= \lim_{x\to\sqrt[8]i}\dfrac{(z-\sqrt[8]i)}{(z-i^{\frac{1}{8}})(z+i^{\frac{1}{8}})(z-i^{\frac{3}{8}})(z+i^{\frac{3}{8}})(z-i^{\frac{5}{8}})(z+i^{\frac{5}{8}})(z-i^{\frac{7}{8}})(z+i^{\frac{7}{8}})}
=\lim_{z\to\sqrt[8]i}\dfrac{(z-i^\frac{1}{8})}{(z-i^{\frac{1}{8}})(z+i^{\frac{1}{8}})(z-i^{\frac{3}{8}})(z+i^{\frac{3}{8}})(z-i^{\frac{5}{8}})(z+i^{\frac{5}{8}})(z-i^{\frac{7}{8}})(z+i^{\frac{7}{8}})}
=\lim_{z\to\sqrt[8]i}\dfrac{1}{(z+i^{\frac{1}{8}})(z-i^{\frac{3}{8}})(z+i^{\frac{3}{8}})(z-i^{\frac{5}{8}})(z+i^{\frac{5}{8}})(z-i^{\frac{7}{8}})(z+i^{\frac{7}{8}})}
=-\frac{i^\frac{1}{8}}{8}$$.
Now apply the same procedure to the other singularities.
