# Contour integral

## Introduction

Contour integration is a way to calculate an integral on the complex plane. In other words, we're just integrating along the complex plane.

## Calculating Contour Integrals With The Residue Theorem

For a standard contour integral, we can evaluate it by using the residue theorem. This theorem states

${\displaystyle \oint _{C}f(z)\,dz=2\pi i\cdot {\text{Res}}f(z)}$Where the "Res" of ${\displaystyle f(z)}$

Where ${\displaystyle {\text{Res}}}$ is the residue of the function ${\displaystyle f(z)}$ is also the integrand, or part of the integral to be integrated, and ${\displaystyle C}$ is the contour located on the complex plane.

Now, we can evaluate any contour integral! For example, let's take these:

### Example 1

{\displaystyle {\begin{aligned}&\oint _{C}{\frac {e^{z}}{z^{3}}}\,dz\\&=2\pi i\cdot {\text{Res}}\left({\frac {e^{z}}{z^{3}}}\right)\\&=2\pi i\cdot {\frac {1}{2}}\\&=\pi i\end{aligned}}}

See what we did there? Using the residue theorem, we have evaluated the ${\displaystyle \oint _{C}{\frac {e^{z}}{z^{3}}}}$. Let's try another example:

### Example 2

{\displaystyle {\begin{aligned}&\oint _{C}{\frac {1}{z^{3}}}\,dz\\&=2\pi i{\text{Res}}f(z)\\&=2\pi i{\text{Res}}{\frac {1}{z^{3}}}\\&=2\pi i\cdot 0\\&=0\end{aligned}}}

## Multivariable Contour Integrals

To solve multivariable (contour integrals with more than one variable to integrate) contour integrals (i.e. surface integrals, complex volume integrals, and higher order integrals), we must use the divergence theorem. For right now, let ${\displaystyle \nabla }$ be interchangeable with ${\displaystyle {\text{Div}}}$. These will both serve as the divergence of the vector field denoted as ${\displaystyle \mathbf {F} }$. This theorem states:

${\displaystyle \underbrace {\int \cdots \int _{U}} _{n}{\text{Div}}(\mathbf {F} )\,dV=\underbrace {\oint \cdots \oint _{\partial U}} _{n-1}\mathbf {F} \cdot \mathbf {n} \,dS}$

In addition, we also need to evaluate ${\displaystyle \nabla \cdot \mathbf {F} }$ where ${\displaystyle \nabla \cdot \mathbf {F} }$ is an alternate notation of ${\displaystyle {\text{div}}\,\mathbf {F} }$. The Divergence of any dimension can be described as

{\displaystyle {\begin{aligned}&{\text{Div}}{\mathbf {F} }\\\\&=\nabla \cdot {\textbf {F}}\\\\&=\left({\frac {\partial }{\partial u}},{\frac {\partial }{\partial x}},{\frac {\partial }{\partial y}},{\frac {\partial }{\partial z}},\cdots \right)\cdot (F_{u},F_{x},F_{y},F_{z}\cdots )\\\\&=\left({\frac {\partial F_{u}}{\partial u}}+{\frac {\partial F_{x}}{\partial x}}+{\frac {\partial F_{y}}{\partial y}}+{\frac {\partial F_{z}}{\partial z}}\cdots \right)\end{aligned}}}

Let's try an example:

### Example 1

Let the vector field ${\displaystyle \mathbf {F} =\sin(2x)+\sin(2y)+\sin(2z)}$ and be bounded by the following

${\displaystyle {0\leq x\leq 1}\quad {0\leq y\leq 3\pi }\quad {-1\leq z\leq 4}}$

The corresponding double contour integral would be set up as such:

${\displaystyle {\scriptstyle S}}$ ${\displaystyle {\mathbf {F} \cdot n}\,{\rm {d}}\,S}$

We now evaluate ${\displaystyle \nabla \cdot \mathbf {F} }$. While we're at it, let's set up the corresponding triple integral:

{\displaystyle {\begin{aligned}&=\iiint _{V}\left({\frac {\partial F_{x}}{\partial x}}+{\frac {\partial F_{y}}{\partial y}}+{\frac {\partial F_{z}}{\partial z}}\right)\,dV\\\\&=\iiint _{V}\left({\frac {\partial \sin(2x)}{\partial x}}+{\frac {\partial \sin(2y)}{\partial y}}+{\frac {\partial \sin(2z)}{\partial z}}\right)\,dV\\\\&=\iiint _{V}{=2(\cos(2x)+\cos(2y)+\cos(2z))}\,dV\end{aligned}}}

From knowing this, we can now evaluate the integral.

{\displaystyle {\begin{aligned}&\int _{0}^{1}\int _{0}^{3}\int _{-1}^{4}2(\cos(2x)+\cos(2y)+\cos(2z))\,dx\,dy\,dz\\\\&=\int _{0}^{1}\int _{0}^{3}(10\cos(2y)+\sin(8)+\sin(2)+10\cos(z))\,dy\,dz\\\\&=\int _{0}^{1}(30\cos(2z)+3\sin(2)+3\sin(8)+5\sin(6))\,dz\\\\&=18\sin(2)+3\sin(8)+5\sin(6)\end{aligned}}} Now that we know this, let's try another!

### Example 2

For example, let the vector field ${\displaystyle \mathbf {F} =u^{4}+x^{5}+y^{6}+z^{-3}}$, and ${\displaystyle n}$ is the fourth dimension. Let this vector field be bounded by the following:

${\displaystyle {0\leq x\leq 1}\quad {-10\leq y\leq 2\pi }\quad {4\leq z\leq 5}\quad {-1\leq u\leq 3}}$

To evaluate this, we must utilize the divergence theorem as stated before, and we must evaluate ${\displaystyle \nabla \cdot \mathbf {F} }$. For right now, let ${\displaystyle \,dV=\,dx\,dy\,dz\,du}$

${\displaystyle {\scriptstyle S}}$ ${\displaystyle \mathbf {F} \cdot n\,{\rm {d}}{\mathbf {S}}}$
{\displaystyle {\begin{aligned}&=\iiiint _{V}\left({\frac {\partial F_{u}}{\partial u}}+{\frac {\partial F_{x}}{\partial x}}+{\frac {\partial F_{y}}{\partial y}}+{\frac {\partial F_{z}}{\partial z}}\right)\,dV\\\\&=\iiiint _{V}\left({\frac {\partial u^{4}}{\partial u}}+{\frac {\partial x^{5}}{\partial x}}+{\frac {\partial y^{6}}{\partial y}}+{\frac {\partial z^{-3}}{\partial z}}\right)\,dV\\\\&=\iiiint _{V}{\frac {4u^{3}z^{4}+5x^{4}z^{4}+5y^{4}z^{4}-3}{z^{4}}}\,dV\end{aligned}}}

From this, we now can evaluate the integral.

{\displaystyle {\begin{aligned}&\iiiint _{V}{\frac {4u^{3}z^{4}+5x^{4}z^{4}+5y^{4}z^{4}-3}{z^{4}}}\,dV\\\\&=\int _{0}^{1}\int _{-10}^{2\pi }\int _{4}^{5}\int _{-1}^{3}{\frac {4u^{3}z^{4}+5x^{4}z^{4}+5y^{4}z^{4}-3}{z^{4}}}\,dV\\\\&=\int _{0}^{1}\int _{-10}^{2\pi }\int _{4}^{5}\left({\frac {4(3u^{4}z^{3}+3y^{6}+91z^{3}+3)}{3z^{3}}}\right)\,dy\,dz\,du\\\\&=\int _{0}^{1}\int _{-10}^{2\pi }\left(4u^{4}+{\frac {743440}{21}}+{\frac {4}{z^{3}}}\right)\,dz\,du\\\\&=\int _{0}^{1}\left(-{\frac {1}{2\pi ^{2}}}+{\frac {1486880\pi }{21}}+8\pi u^{4}+40u^{4}+{\frac {371720021}{1050}}\right)\,du\\\\&={\frac {371728421}{1050}}+{\frac {14869136\pi ^{3}-105}{210\pi ^{2}}}\\\\&\,\approx {576468.77}\end{aligned}}}

Thus, we can evaluate a contour integral of the fourth dimension.