<s>[INST] $\dfrac{1}{2\pi i}\int_{C}\dfrac{e^{z}}{z^{3}-1}dz = \sum_{n=0}^{\infty}\dfrac{1}{(3n+2)!}$ a) Use residue at infinity to solve the problem: 
If $C$ is a circle $C(0,2)$ traversed in the counter clockwise direction, then $$\dfrac{1}{2\pi i}\int_{C}\dfrac{e^{z}}{z^{3}-1}dz = \sum_{n=0}^{\infty}\dfrac{1}{(3n+2)!}$$ 
b) By evaluating $$\dfrac{1}{2\pi i}\int_{C}\dfrac{e^{z}}{z^{3}-1}dz$$
using Cauchy's integral formula, show that $$\sum_{n=0}^{\infty}\dfrac{1}{(3n+2)!} = \dfrac{1}{3}(e-\dfrac{2}{\sqrt{e}}\cos(\dfrac{\pi}{3}-\dfrac{\sqrt{3}}{2}))$$
Hint: One may use the identity $\prod_{j=1,j\neq k}^{m}(e^{2\pi ij/m}-e^{2\pi ik/m}) = \dfrac{m}{e^{2\pi ik/m}}$
a) Note that the function $f(z) = \dfrac{e^{z}}{z^{3}-1}$ and we see that there will be 3 singularity, namely $z =1, z = e^{2\pi i/3}\text{ and } z = e^{4\pi i/3}$. All of which are contained in the $C(0,2)$. Well since we are given the hint to solve the first part with residue at infinity, we will follow it. 
$$\dfrac{1}{2\pi i}\int_{C}f(z)dz = \text{Res}\left[\dfrac{1}{z^{2}}f\left(\dfrac{1}{z}\right),0\right] = \text{Res}\left[\dfrac{1}{z^{2}}\dfrac{e^{1/z}}{\dfrac{1}{z^{3}}-1},0\right] = \text{Res}\left[\dfrac{ze^{1/z}}{1-z^{3}},0\right]$$
We want to find the reside of $\dfrac{ze^{1/z}}{1-z^{3}}$ at $0$. Hence we expand this equation about $0$ in Laurent Series form, $$ze^{1/z}\dfrac{1}{1-z^{3}} = z\sum_{k=0}^{\infty}\dfrac{1}{k!z^{k}}\sum_{m=0}^{\infty}z^{3m} = \sum_{m=0}^{\infty}\left(\sum_{k=0}^{\infty}\dfrac{1}{k!}z^{3n-k+1}\right)$$
We want to find the coefficient of $z^{-1}$ and it happens when $3n-k+1 = -1 \Rightarrow k = 3m+2$. Hence the residue is $$\sum_{m=0}^{\infty}\dfrac{1}{(3m+2)!}$$
First question is part a), why can't i get the answer if i interchange the summation????? By right it should be the same answer.
b) We easily find out that the three singularities for the function is $z=1,z=e^{2\pi i/3},z=e^{4\pi i/3}$
And hence we are solving for $$\dfrac{1}{2\pi i}\int_{C}\dfrac{e^{z}}{(z-1)(z-e^{2\pi i/3})(z-e^{4\pi i/3})}dz$$
Since we are required to use CIF to solve, we construct 3 circles $C_1,C_2,C_3$ of radius $\epsilon_1,\epsilon_2,\epsilon_3$ and centered at $z=1,z=e^{2\pi i/3},z=e^{4\pi i/3}$. 
Then from here, i can only use brute force (REALLY TOOK ME VERY LONG) to solve it, anyone knows how to solve it with the hint?
 [/INST] We first note that for a simple pole we have 
$$\mathrm{Res}(f/g,z_0) = \frac{f(z_0)}{g'(z_0)}$$
The sum of the residues 
$$\sum \mathrm{Res}(f,z) =\frac{e}{3}+\dfrac{e^{e^{2\pi i/3}}}{3e^{4\pi i/3}}+\dfrac{e^{e^{4\pi i/3}}}{3e^{8\pi i/3}}$$
Note that 
$$\dfrac{e^{e^{2\pi i/3}}}{e^{4\pi i/3}}+\dfrac{e^{e^{4\pi i/3}}}{e^{8\pi i/3}} = e^{e^{2\pi i/3}+2\pi i /3}+ e^{e^{-2\pi i/3}-2\pi i /3}  = 2\mathrm{Re}\left(e^{e^{2\pi i/3}+2\pi i /3}\right)$$
Note by expnading and using trignometric properites we have 
$$e^{e^{2\pi i/3}+2\pi i /3} = i\frac{\cos\left(\frac{\sqrt{3}}{2} + \frac{\pi}{6}\right)}{\sqrt{e}} - \frac{\sin\left(\frac{\sqrt{3}}{2} + \frac{\pi}{6}\right)}{\sqrt{e}}$$
Hence 
$$\sum \mathrm{Res}(f,z)=\frac{e}{3}- \frac{2\sin\left(\frac{\sqrt{3}}{2} + \frac{\pi}{6}\right)}{3\sqrt{e}}=\frac{e}{3}- \frac{2\cos\left(\frac{\pi}{3}-\frac{\sqrt{3}}{2}\right)}{3\sqrt{e}}$$
</s>