Complex integral with residuals questions for complex integrals


*

*For $R>0$ let $\Gamma_R$ be the circle {$z\in \mathbb{C} : \lvert z \rvert =R $} equipped with counterclockwise direction. Figure out for which $R>0$, the function $f(z)=\frac{1}{\sin^2(z)}$ is continuous on $\Gamma_R$ and evaluate $$\int\limits_{\Gamma_R}\frac{dz}{\sin^2(z)}$$
for every such $R$ (the answer may depend on $R$)

*Evaluate $\int\limits_{0}^{\infty}\frac{\cos{x}}{1+x^6}dx$
I have no idea where to start from for any of the questions above, any help to get me started is greatly appreciated.

Function $\sin{z}$ has zeros at $k\cdot \pi, k \in \mathbb{Z}$ and same applies to $\sin^2{z}$. As a result, function $\frac{1}{\sin^2{z}}$ has singularities at $k\cdot \pi, k \in \mathbb{Z}$. These singularities are poles of order $2$ since (using this fact)
$$\lim\limits_{z\rightarrow k\pi}\frac{(z-k\pi)^2}{\sin^2{z}}=\lim\limits_{z-k\pi\rightarrow 0}\frac{(z-k\pi)^2}{\sin^2{(z-k\pi)}}=\frac{1}{\lim\limits_{z-k\pi\rightarrow 0}\frac{\sin^2{(z-k\pi)}}{(z-k\pi)^2}}=1$$
and
$$\lim\limits_{z\rightarrow k\pi}\frac{(z-k\pi)^3}{\sin^2{z}}=0$$
Any $\Gamma_R$ where $R=k\pi, k\in\mathbb{N}\setminus\{0\}$ is of the form $\Gamma_R=\left\{k\pi e^{it}\mid 0\leq t < 2\pi\right\}$ and will contain $k\pi$ and $-k\pi$ where $\frac{1}{\sin^2{z}}$ is not continuous. In all the other cases ($R\ne k\pi, k\in\mathbb{N}\setminus\{0\}$), $\frac{1}{\sin^2{z}}$  is continuous on $\Gamma_R$. To calculate the integral on such a contour, residue theorem can be applied
$$\int\limits_{\Gamma_R}\frac{1}{\sin^2{z}}dz=2\pi i\sum\limits_{|k|<\frac{R}{\pi}\\ k\in \mathbb{Z}} \text{Res}\left(\frac{1}{\sin^2{z}}, k\pi\right)$$
We already know that the pole order at $k\pi$ is $2$, so calculating the residues shouldn't be a problem
$$\text{Res}\left(\frac{1}{\sin^2{z}},k\pi\right)=\lim\limits_{z\rightarrow k\pi}\left(\frac{(z-k\pi)^2}{\sin^2{z}}\right)'=\\
\lim\limits_{z\rightarrow k\pi}\left(\frac{2(z-k\pi)\sin^2{z}-2(z-k\pi)^2\sin{z}\cos{z}}{\sin^4{z}}\right)=\\
\lim\limits_{z\rightarrow k\pi}\left(\frac{2(z-k\pi)\left(\sin{z}-(z-k\pi)\cos{z}\right)}{\sin^3{z}}\right)\overset{\text{L'Hospital}}{=}\\
\lim\limits_{z\rightarrow k\pi}\left(\frac{2((z-k\pi)^2 \sin{z}-(z-k\pi) \cos{z} + \sin{z})}{3\sin^2{z}\cos{z}}\right)\overset{\text{L'Hospital}}{=}\\
\lim\limits_{z\rightarrow k\pi}\left(\frac{2(z-k\pi)\left((z-k\pi)\cos{z}+ 3\sin{z}\right) }{-\frac{3}{4}\left(\sin{z}-3\sin{3z}\right)}\right)\overset{\text{L'Hospital}}{=}\\
\lim\limits_{z\rightarrow k\pi}\left(\frac{ -2\left(\left(z^2-2 k\pi z-3+(k\pi)^2\right)\sin{z}-5(z-k\pi)\cos{z}\right) }{-\frac{3}{4}\left(\cos{z}-9\cos{3z}\right)}\right)=\\
\frac{0}{6\cdot (-1)^k}=0$$
As a result $$\int\limits_{\Gamma_R}\frac{1}{\sin^2{z}}dz=0$$

For the second one, function $\frac{\cos{x}}{1+x^6}$ is even, as a result 
$$\int\limits_{0}^{\infty}\frac{\cos{x}}{1+x^6}dx= \lim\limits_{R\rightarrow\infty} \int\limits_{0}^{R}\frac{\cos{x}}{1+x^6}dx=\frac{1}{2} \lim\limits_{R\rightarrow\infty} \int\limits_{-R}^{R}\frac{\cos{x}}{1+x^6}dx=...$$
Now $\frac{\sin{x}}{1+x^6}$ is odd and as a result $\int\limits_{-R}^{R}\frac{\sin{x}}{1+x^6}dx=0$, thus
$$...=\frac{1}{2} \lim\limits_{R\rightarrow\infty} \int\limits_{-R}^{R}\frac{\cos{x}+i\sin{x}}{1+x^6}dx=\frac{1}{2} \lim\limits_{R\rightarrow\infty} \int\limits_{-R}^{R}\frac{e^{ix}}{1+x^6}dx=...$$
Now we will look at this contour

$$...=\frac{1}{2} \lim\limits_{R\rightarrow\infty} \left(\int\limits_{C_R}\frac{e^{iz}}{1+z^6}dz - \int\limits_{\Gamma_R}\frac{e^{iz}}{1+z^6}dz \right)=\\
\frac{1}{2} \lim\limits_{R\rightarrow\infty} \left(\int\limits_{C_R}\frac{e^{iz}}{(z-i)(z+i)\left(z-\frac{\sqrt{3}}{2}-\frac{i}{2}\right)\left(z+\frac{\sqrt{3}}{2}+\frac{i}{2}\right)\left(z-\frac{\sqrt{3}}{2}+\frac{i}{2}\right)\left(z+\frac{\sqrt{3}}{2}-\frac{i}{2}\right)}dz \\
- \int\limits_{\Gamma_R}\frac{e^{iz}}{1+z^6}dz \right)=
\frac{1}{2} \lim\limits_{R\rightarrow\infty} \left(\text{Res}\left(\frac{e^{iz}}{1+z^6},i\right)+
\text{Res}\left(\frac{e^{iz}}{1+z^6},\frac{\sqrt{3}}{2}+\frac{i}{2}\right)+\\
\text{Res}\left(\frac{e^{iz}}{1+z^6},-\frac{\sqrt{3}}{2}+\frac{i}{2}\right)
- \int\limits_{\Gamma_R}\frac{e^{iz}}{1+z^6}dz \right)=\\
\frac{1}{2}\left(\text{Res}\left(\frac{e^{iz}}{1+z^6},i\right)+
\text{Res}\left(\frac{e^{iz}}{1+z^6},\frac{\sqrt{3}}{2}+\frac{i}{2}\right)+
\text{Res}\left(\frac{e^{iz}}{1+z^6},-\frac{\sqrt{3}}{2}+\frac{i}{2}\right)\right)$$
It remains to show that 
$$\lim\limits_{R\rightarrow\infty} \int\limits_{\Gamma_R}\frac{e^{iz}}{1+z^6}dz =0$$
which is
$$\left|\int\limits_{\Gamma_R}\frac{e^{iz}}{1+z^6}dz\right| \leq \text{length}(\Gamma_R) \max\limits_{z \in \Gamma_R}\left|\frac{e^{iz}}{1+z^6}\right|=\pi R \max\limits_{z \in \Gamma_R}\frac{|e^{iz}|}{\left|1+z^6\right|}\leq \pi R \max\limits_{z \in \Gamma_R}\frac{|e^{i(x+iy)}|}{\left||z^6|-|1|\right|}\leq\\
\pi R \frac{e^{-y}}{\left|R^6-1\right|}\leq \frac{\pi R}{R^6-1} \rightarrow 0, R \rightarrow \infty$$
I will leave you to finish the calculations of residues.
