It ain’t about how hard you can hit. Its about how hard you can get hit, and how much you can take, and keep moving forward, Rocky Balboa

Laurent’s theorem. Let A = {$z \in \mathbb{C}: R \lt |z -a| \lt S$} be an annular region ($0 \le R \lt S \le \infty$) and let f be analytic on A. Then, $f(z) = \sum_{n=-\infty}^\infty c_n(z -a)^n, \forall z \in A$ where $c_n = \frac{1}{2\pi i}\int_{\gamma} \frac{f(w)}{(w-a)^{n+1}}dw$ and $\gamma$ is a positively oriented circle of radius r centered at a and R < r < S ($\gamma$ is inside the annular region).
Corollary (aka Rosetta Stone of Complex Analysis). Let f be analytic in $\mathbb{B'}(a; r)$. (i) f has a removable singularity at a if and only if in the Laurent's series expansion of f around a ($\sum_{n = -\infty}^\infty (z-a)^n$) all negative coefficients are zero $c_n = 0, \forall n \lt 0$. (ii) f has a pole of order m ($m \ge 1$) at a if and only if the series stop at the negative power -m, $c_{-m} \ne 0, c_n = 0, \forall n \lt -m$; (iii) f has an isolated essential singularity at a if and only if the series has infinitely many negative terms (it never stops), i.e., there is no m such that $c_n = 0, \forall n \lt -m$
The Argument Principle. Suppose f is meromorphic on and inside a simple closed curve $\gamma$ with a finite number of zeroes $a_j, 1 \le j \le l_1$ and poles $b_k, 1 \le k \le l_2$. Suppose none of those zeros and poles lie on $\gamma$. Then, $\frac{1}{2\pi i}\int_{\gamma}\frac{f'(z)}{f(z)}dz = M - N$ where M is the sum of order of zeroes at $a_j, 1 \le j \le l_1$ and N is the sum of order of poles at $b_k, 1 \le k \le l_2$
We want to calculate the improper real integral: $\int_{0}^{\infty} \frac{dx}{1+x^{2n}}, \forall n \in \mathbb{N}, n \gt 1$. We cannot compute this directly using standard Calculus.
Inspired by this integral, we extend the integrand to the complex plane $\frac{1}{1+z^{2n}}$.
We choose a contour $\Gamma$ that consists of three paths (a “pizza slice”, Figure ii):

Why this specific angle $\pi/n$? Because the function depends on $z^{2n}$. If we rotate $z$ by an angle of $\pi/n$, then $z^{2n}$ rotates by $2n(\pi/n) = 2\pi$, which brings us back to where we started. This symmetry is absolutely essential for the algebra later.
We want to integrate $\frac{1}{1+z^{2n}}$ around our “Pizza Slice” shape (sector) in the complex plane. We need to find the singularities inside our pizza slice. Singularities occur when the denominator is zero: $1 + z^{2n} = 0 \implies z^{2n} = -1$. In polar form, $-1 = e^{i\pi}, e^{3i\pi}, e^{5i\pi}, \dots$. In polar form, all representations of -1 are $-1=e^{i(\pi +2\pi m)}, m\in \mathbb{Z}$. So, we solve $z^{2n}=e^{i(\pi +2\pi m)}$, the 2n distinct roots are: $z_k = e^{i\frac{(2k+1)\pi}{2n}}, k = 0, 1, 2, \cdots, 2n-1$.
Which one is inside our “pizza” 🍕 slice? Our slice goes from angle $0$ to $\frac{\pi}{n}$ (or $\frac{2\pi}{2n}$).
By Cauchy Residue Theorem, $\int_{\Gamma} \frac{1}{1+z^{2n} }dz= 2\pi i \cdot Res\{ \frac{1}{1+z^{2n}}; e^{\frac{i\pi}{2n}} \}$
$\lim_{z \to e^{\frac{i\pi}{2n}}} (z - e^{\frac{i\pi}{2n}}) \frac{1}{1+z^{2n}} =[\text{For simplicity, let's name }a = e^{\frac{i\pi}{2n}}] \lim_{z \to a} \frac{1}{\frac{1+z^{2n}-0}{z-a}}$
Recall the concept of derivative $g'(a) = \lim_{z \to a}\frac{g(z)-g(a)}{z-a}$ where $g(z) = 1 + z^{2n}, g (a) = 0$
We need the residue at $a = e^{i\frac{\pi}{2n}}$.Since it is a simple pole, we use the derivative formula: $\text{Res}(f, a) = \frac{1}{g'(a)} \quad \text{where } g(z) = 1+z^{2n}$
$lim_{z \to a} \frac{1}{\frac{1+z^{2n}-0}{z-a}} = \frac{1}{(1+z^{2n})'|_{e^{\frac{i\pi}{2n}}}} = \frac{1}{2nz^{2n-1}|_{e^{\frac{i\pi}{2n}}}} = \frac{1}{2n(e^{i\pi}e^{\frac{-i\pi}{2n}})} = \frac{e^{\frac{i\pi}{2n}}}{-2n} =\frac{-e^{\frac{i\pi}{2n}}}{2n}$
$2\pi iRes\{ \frac{1}{1+z^{2n}}; e^{\frac{i\pi}{2n}} \} = 2\pi i( \frac{-e^{\frac{i\pi}{2n}}}{2n}) = \frac{-i\pi e^{\frac{i\pi}{2n}}}{n}$
Now we break the loop into its three parts: $\int_{\Gamma} \frac{1}{1+z^{2n}}dz = \int_{0}^{R}\frac{1}{1+x^{2n}}dx + \int_{C_R}\frac{1}{1+z^{2n}}dz + \int_{\gamma}\frac{1}{1+z^{2n}}dz$.
$z = r e^{i\frac{\pi}{n}} \implies dz = e^{i\frac{\pi}{n}} dr$. Then, $1 + z^{2n} = 1 + (r e^{i\frac{\pi}{n}})^{2n} = 1 + r^{2n} e^{i 2\pi} = 1 + r^{2n}$ (The avid reader should not fail to notice how the complex part has completely vanished! This is why we chose this angle and “pizza slice”).
$\int_{\gamma} \frac{dz}{1+z^{2n}} = \int_{R}^{0} \frac{e^{\frac{i\pi}{n}}dr}{1+ (re^{\frac{i\pi}{n}})^{2n}} = -e^{\frac{i\pi}{n}}\int_{0}^{R} \frac{dr}{1+r^{2n}}$ Letting $R \to \infty$, this becomes $-e^{\frac{i\pi}{n}}\int_{0}^{\infty} \frac{dx}{1+x^{2n}} = - e^{i\frac{\pi}{n}} \cdot I$.
L.H.S. = $(1 -e^{\frac{i\pi}{n}})I = (1 -e^{\frac{i\pi}{n}})\int_{0}^{\infty} \frac{dx}{1+x^{2n}}$
R.H.S. = $\frac{-i\pi e^{\frac{i\pi}{2n}}}{n}$
Combining both results: $I = \frac{-\frac{i \pi}{n} e^{i\frac{\pi}{2n}}}{1 - e^{i\frac{\pi}{n}}}$
Multiply the numerator and denominator by $e^{-i\frac{\pi}{2n}}$: $I = \frac{-\frac{i \pi}{n} e^{i\frac{\pi}{2n}} \cdot e^{-i\frac{\pi}{2n}}}{(1 - e^{i\frac{\pi}{n}}) \cdot e^{-i\frac{\pi}{2n}}} = \frac{-\frac{i \pi}{n}}{e^{-i\frac{\pi}{2n}} - e^{i\frac{\pi}{2n}}}$
Swap the sign in the denominator to make it look like sine definition ($e^{ix} - e^{-ix}$), recall $\sin(\theta) = \frac{e^{i\theta} - e^{-i\theta}}{2i} \implies e^{i\theta} - e^{-i\theta} = 2i \sin(\theta)$: $I = \frac{-\frac{i \pi}{n}}{-(e^{i\frac{\pi}{2n}} - e^{-i\frac{\pi}{2n}})} = \frac{\frac{i \pi}{n}}{e^{i\frac{\pi}{2n}} - e^{-i\frac{\pi}{2n}}}= \frac{i \pi / n}{2i \sin(\frac{\pi}{2n})} = \frac{\pi}{2n \sin(\frac{\pi}{2n})}$
$\int_{0}^{\infty} \frac{dx}{1+x^{2n}} = \boxed{\frac{\pi}{2n \sin(\frac{\pi}{2n})}}$