\chapter{Complex Problem Set}
\begin{abox}
	Practise Set-1
\end{abox}

\begin{enumerate}[label=\color{ocre}\textbf{\arabic*.}]
	\item The value of the integral $\int_{C} d z z^{2} e^{z}$, where $C$ is an open contour in the complex $z$-plane as shown in the figure below, is:
	{\exyear{NET/JRF(JUNE-2011)}}
	\begin{figure}[H]
		\centering
		\includegraphics[height=5cm,width=9cm]{diagram-20211005-crop}
	\end{figure}
	\begin{tasks}(4)
		\task[\textbf{A.}] $\frac{5}{e}+e$
		\task[\textbf{B.}] $e-\frac{5}{e}$
		\task[\textbf{C.}] $\frac{5}{e}-e$
		\task[\textbf{D.}] $-\frac{5}{e}-e$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		\intertext { If we complete the contour, then by Cauchy integral theorem }
		\int_{-1}^{1} d z z^{2} e^{z}+\int_{C} d z z^{2} e^{z}&=0 \Rightarrow \int_{C} d z z^{2} e^{z}=-\int_{-1}^{1} d z z^{2} e^{z}\\&=-\left[z^{2} e^{z}-2 z e^{2}+2 e^{2}\right]_{-1}^{1}=\frac{5}{e}-e
		\end{align*}
		So the correct answer is \textbf{Option (C)}
	\end{answer}
	\item Which of the following is an analytic function of the complex variable $z=x+i y$ in the domain $|z|<2 ?$
	{\exyear{NET/JRF(JUNE-2011)}}
	\begin{tasks}(2)
		\task[\textbf{A.}] $(3+x-i y)^{7}$
		\task[\textbf{B.}] $(1+x+i y)^{4}(7-x-i y)^{3}$
		\task[\textbf{C.}] $(1-x-i y)^{4}(7-x+i y)^{3}$
		\task[\textbf{D.}] $(x+i y-1)^{1 / 2}$
	\end{tasks}
	\begin{answer}
		Put $z=x+i y .$ If $\bar{z}=x-i y$ appears in any of the expressions then that expression is non-analytic. For option (D) we have a branch point singularity as the power is $\frac{1}{2}$ which is fractional. Hence only option (B) is analytic.\\\\
		So the correct answer is \textbf{Option (B)}
	\end{answer}
	\item The first few terms in the Laurent series for $\frac{1}{(z-1)(z-2)}$ in the region $1 \leq|z| \leq 2$ and around $z=1$ is
	{\exyear{NET/JRF(JUNE-2012)}}
	\begin{tasks}(1)
		\task[\textbf{A.}] $\frac{1}{2}\left[1+z+z^{2}+\ldots\right]\left[1+\frac{z}{2}+\frac{z^{2}}{4}+\frac{z^{3}}{8}+\ldots .\right]$
		\task[\textbf{B.}] $\frac{1}{1-z}-z-(1-z)^{2}+(1-z)^{3}+\ldots .$
		\task[\textbf{C.}] $\frac{1}{\mathrm{z}^{2}}\left[1+\frac{1}{\mathrm{z}}+\frac{1}{\mathrm{z}^{2}}+\ldots .\right]\left[1+\frac{2}{\mathrm{z}}+\frac{4}{\mathrm{z}^{2}}+\ldots . .\right]$
		\task[\textbf{D.}]  $2(z-1)+5(z-1)^{2}+7(z-1)^{3}+\ldots$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		\frac{1}{(z-1)(z-2)}&=\frac{1}{z-2}-\frac{1}{z-1}=\frac{1}{1-z}+\frac{1}{(z-1)-1}\\&=\frac{1}{1-z}-(1+(1-z))^{-1}\\
		&=\frac{1}{1-z}-\left[1+(1-z)+\frac{(-1)(-2)}{2 !}(1-z)^{2}+\frac{(-1)(-2)(-3)}{3 !}(1-z)^{3} \ldots\right]\\
		&=\frac{1}{1-z}-\left[z+(1-z)^{2}-(1-z)^{3}+\ldots . .\right]
		\end{align*}
		So the correct answer is \textbf{Option (B)}
	\end{answer}
	\item Let $u(x, y)=x+\frac{1}{2}\left(x^{2}-y^{2}\right)$ be the real part of analytic function $f(z)$ of the complex variable $z=x+i y$. The imaginary part of $f(z)$ is
	{\exyear{NET/JRF(JUNE-2012)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $y+x y$
		\task[\textbf{B.}] $x y$
		\task[\textbf{C.}] $y$
		\task[\textbf{D.}] $y^{2}-x^{2}$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		u(x, y)&=x+\frac{1}{2}\left(x^{2}-y^{2}\right), v(x, y)=?\\
		\text{Check }\frac{\partial u}{\partial x}&=\frac{\partial v}{\partial y}\text{ and } \frac{\partial u}{\partial y}=-\frac{\partial v}{\partial x}\\
		\Rightarrow \frac{\partial u}{\partial x}&=\frac{\partial v}{\partial y}, \quad \frac{\partial v}{\partial y}=1+x, \\ v&=y+x y+f(x)\\
		\frac{\partial u}{\partial y}&=-\frac{\partial v}{\partial x} \Rightarrow \frac{\partial v}{\partial x}=+y, \\ v&=y x+f(y)\\
		y+x y+f(x)&=y x+f(y)\\
		\text{If }f(x)&=0\quad \quad
		f(y)=y\\
		v&=x y+y
		\end{align*}
		So the correct answer is \textbf{Option (A)}
	\end{answer}
	\item The value of the integral $\int_{C} \frac{z^{3} d z}{\left(z^{2}-5 z+6\right)}$, where $C$ is a closed contour defined by the equation $2|z|-5=0$, traversed in the anti-clockwise direction, is
	{\exyear{NET/JRF(DEC-2012)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $-16 \pi i$
		\task[\textbf{B.}] $16 \pi \mathrm{i}$
		\task[\textbf{C.}] $8 \pi i$
		\task[\textbf{D.}] $2 \pi i$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		z^{2}-5 z+6&=0 \Rightarrow z^{2}-2 z-3 z+6\\&=0 \Rightarrow z(z-2)-3(z-2)=0 \Rightarrow z=3,2\\
		2|z|&=5 \Rightarrow|z|=2.5,\text{ only 2 will be inside.}\\
		\text{Residue }&=\left.(z-2) \frac{z^{3}}{(z-3)(z-2)}\right|_{z=2}=\frac{8}{2-3}\\&=-8 \Rightarrow \int \frac{z^{3} d z}{z^{2}-5 z+6}=2 \pi i(-8)=-16 \pi i
		\end{align*}
		So the correct answer is \textbf{Option (A)}
	\end{answer}
	\item  With $z=x+i y$, which of the following functions $f(x, y)$ is NOT a (complex) analytic function of $z$ ?
	{\exyear{NET/JRF(JUNE-2013)}}
	\begin{tasks}(1)
		\task[\textbf{A.}] $f(x, y)=(x+i y-8)^{3}\left(4+x^{2}-y^{2}+2 i x y\right)^{7}$
		\task[\textbf{B.}] $f(x, y)=(x+i y)^{7}(1-x-i y)^{3}$
		\task[\textbf{C.}] $f(x, y)=\left(x^{2}-y^{2}+2 i x y-3\right)^{5}$
		\task[\textbf{D.}] $f(x, y)=(1-x+i y)^{4}(2+x+i y)^{6}$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		f(x, y)&=(1-x+i y)^{4}(2+x+i y)^{6}\\&=\{1-(x-i y)\}^{4}(2+x+i y)^{6}\\
		\text{Due to present of }\bar{z}&=(x-i y)
		\end{align*}
		So the correct answer is \textbf{Option (D)}
	\end{answer}
	\item  Which of the following functions cannot be the real part of a complex analytic function of $z=x+i y ?$
	{\exyear{NET/JRF(DEC-2013)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $x^{2} y$
		\task[\textbf{B.}]  $x^{2}-y^{2}$
		\task[\textbf{C.}] $x^{3}-3 x y^{2}$
		\task[\textbf{D.}] $3 x^{2} y-y-y^{3}$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		\intertext{ Let $x^{2} y$ be real part of a complex function. Use Milne Thomson's method to write analytic complex function. The real part of that function should be (1) but that is not the case. So this cannot be real part of an analytic function. Also,}
		z^{2}&=(x+i y)^{2}=x^{2}-y^{2}+2 i x y,\text{ Real part option (2)}\\
		z^{3}&=(x+i y)^{3}=x^{3}-i y^{3}+3 i x y(x+i y)\\
		&=x^{3}-i y^{3}+3 i x^{2} y-3 x y^{2},\text{ Real part option (3)}
		\end{align*}
		So the correct answer is \textbf{Option (A)}
	\end{answer}
	\item  Given that the integral $\int_{0}^{\infty} \frac{d x}{y^{2}+x^{2}}=\frac{\pi}{2 y}$, the value of $\int_{0}^{\infty} \frac{d x}{\left(y^{2}+x^{2}\right)^{2}}$ is
	{\exyear{NET/JRF(DEC-2013)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $\frac{\pi}{y^{3}}$
		\task[\textbf{B.}] $\frac{\pi}{4 y^{3}}$
		\task[\textbf{C.}]  $\frac{\pi}{8 y^{3}}$
		\task[\textbf{D.}] $\frac{\pi}{2 y^{3}}$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		\int_{0}^{\infty} \frac{d x}{\left(y^{2}+x^{2}\right)^{2}}&=\frac{1}{2} \int_{-\infty}^{\infty} \frac{d x}{\left(y^{2}+x^{2}\right)^{2}},\text{ pole is of }2^{\text {nd }}\text{ order at }x=i y,\text{ residue }=1 /\left(4 i y^{3}\right)\\
		\text{Integral }&=\left(\frac{1}{2}\right)(2 \pi i) \frac{1}{4 i y^{3}}=\frac{\pi}{\left(4 y^{3}\right)}
		\end{align*}
	\end{answer}
	\item If $C$ is the contour defined by $|z|=\frac{1}{2}$, the value of the integral
	$$
	\oint_{C} \frac{d z}{\sin ^{2} z}
	$$
	is
	{\exyear{NET/JRF(JUNE-2014)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $\infty$
		\task[\textbf{B.}] $2 \pi i$
		\task[\textbf{C.}] 0
		\task[\textbf{D.}] $\pi i$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		f(z)&=\frac{1}{\sin ^{2} z} \quad\left(|z|=\frac{1}{2}\right)\\
		\sin z&=z-\frac{z^{3}}{\lfloor 3}+\frac{z^{5}}{\lfloor 5} \ldots . \Rightarrow \frac{1}{\sin ^{2} z}=\frac{1}{\left(z-\frac{z^{3}}{\frac{3}{3}}+\frac{z^{5}}{5} \cdots\right)^{2}}\\
		\Rightarrow \frac{1}{\sin ^{2} z}&=\frac{1}{z^{2}}\left[1-\frac{z^{2}}{\lfloor 3}+\frac{z^{4}}{\lfloor 5} \ldots .\right]^{-2} \Rightarrow \oint_{C} \frac{d z}{\sin ^{2} z}=0
		\end{align*}
		So the correct answer is \textbf{Option (C)}
	\end{answer}
	\item The principal value of the integral $\int_{-\infty}^{\infty} \frac{\sin (2 x)}{x^{3}} d x$ is
	{\exyear{NET/JRF(DEC-2014)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $-2 \pi$
		\task[\textbf{B.}]  $-\pi$
		\task[\textbf{C.}] $\pi$
		\task[\textbf{D.}]  $2 \pi$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		\text{Let }f(z)&=\frac{e^{i 2 z}}{z^{3}}\\
		\lim _{2 \rightarrow 0}(z-0)^{3} f(z)&=\lim _{z \rightarrow 0}(z-0)^{3} \frac{e^{i 2 z}}{z^{3}}\\&=1(\text{ finite and }\neq 0) \Rightarrow z=0 \text{is pole of order 3} .\\
		\text{Residue }R&=\frac{1}{2 !} \lim _{z \rightarrow 0} \frac{d^{2}}{d z^{2}}\left[(z-0)^{3} \frac{e^{i 2 z}}{z^{3}}\right]=-2\\
		\Rightarrow \int_{-\infty}^{\infty} f(x) d x&=\pi i \Sigma R=\pi i(-2)=-2 \pi i \Rightarrow \operatorname{Im} .\text{ Part }\\&=-2 \pi \Rightarrow \int_{-\infty}^{\infty} f(x) d x=-2 \pi
		\end{align*}
		So the correct answer is \textbf{Option (A)}
	\end{answer}
	\item The Laurent series expansion of the function $f(z)=e^{2}+e^{1 / 2}$ about $z=0$ is given by
	{\exyear{NET/JRF(DEC-2014)}}
	\begin{tasks}(2)
		\task[\textbf{A.}] $\sum_{n=-\infty}^{\infty} \frac{z^{n}}{n !}$ for all $|z|<\infty$
		\task[\textbf{B.}] $\sum_{n=0}^{\infty}\left(z^{n}+\frac{1}{z^{n}}\right) \frac{1}{n !}$ only if $0<|z|<1$
		\task[\textbf{C.}] $\sum_{n=0}^{\infty}\left(z^{n}+\frac{1}{z^{n}}\right) \frac{1}{n !}$ for all $0<|z|<\infty$
		\task[\textbf{D.}]  $\sum_{n=-\infty}^{\infty} \frac{z^{n}}{n !}$ only if $|z|<1$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		e^{z}&=\left(1+z+\frac{z^{2}}{2 !}+\ldots\right)=\sum_{n=0}^{\infty} \frac{z^{n}}{n !}\text{ and }e^{1 / z}\\&=1+\frac{1}{z}+\frac{1}{2 !} \frac{1}{z^{2}}+\ldots .=\sum_{n=0}^{\infty} \frac{1}{z^{n} n !}\\
		\Rightarrow f(z)&=\left(e^{z}+e^{1 / 2}\right)=\sum_{n=0}^{\infty}\left(z^{n}+\frac{1}{z^{n}}\right) \frac{1}{n !},\text{ for all }0<|z|<\infty
		\end{align*}
		So the correct answer is \textbf{Option (C)}
	\end{answer}
	\item Consider the function $f(z)=\frac{1}{z} \ln (1-z)$ of a complex variable $z=r e^{i \theta}(r \geq 0, \quad-\infty<\theta<\infty)$. The singularities of $f(z)$ are as follows:
	{\exyear{NET/JRF(DEC-2014)}}
	\begin{tasks}(1)
		\task[\textbf{A.}]  Branch points at $z=1$ and $z=\infty$; and a pole at $z=0$ only for $0 \leq \theta<2 \pi$
		\task[\textbf{B.}] Branch points at $z=1$ and $z=\infty$; and a pole at $z=0$ for all $\theta$ other than $0 \leq \theta<2 \pi$
		\task[\textbf{C.}] Branch points at $z=1$ and $z=\infty$; and a pole at $z=0$ for all $\theta$
		\task[\textbf{D.}] Branch points at $z=0, z=1$ and $z=\infty$.
	\end{tasks}
	\begin{answer}
		\begin{align*}
		\text{For }f(z)&=\frac{1}{z} \ln (1-z)=\frac{1}{z}\left(-z-\frac{z^{2}}{2}-\frac{z^{3}}{3}-\ldots . .\right)\\&=-1-\frac{z}{2}-\frac{z^{2}}{3}-\ldots .
		\intertext{There is no principal part and when $z \rightarrow 0, f(z)=-1 .$ So there is removable singularity at $z=0$. Also $z=1$ and $z=\infty$ is Branch point.}
		\end{align*}
		None of the above is correct
	\end{answer}
	\item  The value of integral $\int_{-\infty}^{\infty} \frac{d x}{1+x^{4}}$
	{\exyear{NET/JRF(JUNE-2015)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $\frac{\pi}{\sqrt{2}}$
		\task[\textbf{B.}] $\frac{\pi}{2}$
		\task[\textbf{C.}] $\sqrt{2} \pi$
		\task[\textbf{D.}] $2 \pi$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		\int_{-\infty}^{\infty} \frac{d z}{1+z^{4}} \quad \because|z|=R\\
		\text{Now, pole }z&=e^{(2 n+1) \frac{\pi}{4}}\\
		n&=0, \quad \Rightarrow z_{0}=e^{\frac{i \pi}{4}}=\frac{1}{\sqrt{2}}+i \frac{1}{\sqrt{2}}, n\\&=2 \Rightarrow z_{2}=\frac{-1}{\sqrt{2}}-i \frac{1}{\sqrt{2}}\\
		n&=1 \Rightarrow z_{1}=e^{\frac{i 3 \pi}{4}}=\frac{-1}{\sqrt{2}}+i \frac{1}{\sqrt{2}}, n\\&=3 \Rightarrow z_{3}=+\frac{1}{\sqrt{2}}-i \frac{1}{\sqrt{2}}
		\intertext{only $z_{0}$ and $z_{1}$ lies in contour}
		\text{i.e., residue at }\left(z=e^{\frac{i \pi}{4}}\right)&=\frac{1}{4}\left(-\frac{1}{\sqrt{2}}-i \frac{1}{\sqrt{2}}\right)\\
		\text{residue at }\left(z=e^{\frac{i 3 \pi}{4}}\right)&=\frac{1}{4}\left(\frac{1}{\sqrt{2}}-i \frac{1}{\sqrt{2}}\right)\\
		\text{now }\int_{-\infty}^{\infty} \frac{d x}{x^{4}+1}&=2 \pi i \Sigma \operatorname{Re} S=\frac{\pi}{\sqrt{2}}
		\end{align*}
		So the correct answer is \textbf{Option (A)}
	\end{answer}
	\item  The function $\frac{Z}{\sin \pi z^{2}}$ of a complex variable $z$ has
	{\exyear{NET/JRF(DEC-2015)}}
	\begin{tasks}(1)
		\task[\textbf{A.}] A simple pole at 0 and poles of order 2 at $\pm \sqrt{n}$ for $n=1,2,3 \ldots$
		\task[\textbf{B.}] A simple pole at 0 and poles of order 2 at $\pm \sqrt{n}$ and $\pm i \sqrt{n}$ for $n=1,2,3 \ldots$
		\task[\textbf{C.}] Poles of order 2 at $\pm \sqrt{n}, n=0,1,2,3 \ldots$
		\task[\textbf{D.}] Poles of order 2 at $\pm n, n=0,1,2,3 \ldots$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		f(z)&=\frac{z}{\sin \pi z^{2}}=\frac{z}{\pi z^{2} \frac{\sin \pi z^{2}}{\pi z^{2}}}\\
		\text{	at }z&=0,\text{ it is a simple pole since,} \lim _{z \rightarrow 0} \frac{\sin \pi z^{2}}{\pi z^{2}}=1\\
		\text{Also, }\sin \pi z^{2}&=\sin n \pi \Rightarrow \pi \mathrm{z}^{2}\\&=\pm n \pi, z=\pm \sqrt{n}, \pm i \sqrt{n}\\
		\lim _{z \rightarrow \sqrt{n}}&(z-\sqrt{n})^{2} \cdot \frac{z}{\sin \pi z^{2}}, \text{exists. So its pole of order 2}
		\end{align*}
		So the correct answer is \textbf{Option (B)}
	\end{answer}
	\item The value of the contour integral $\frac{1}{2 \pi i} \oint_{C} \frac{e^{4 z}-1}{\cosh (z)-2 \sinh (z)} d z$ around the unit circle $C$ traversed in the anti-clockwise direction, is
	{\exyear{NET/JRF(JUNE-2016)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] 0
		\task[\textbf{B.}] 2
		\task[\textbf{C.}] $\frac{-8}{\sqrt{3}}$
		\task[\textbf{D.}] $-\tanh \left(\frac{1}{2}\right)$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		f(z)&=\frac{e^{4 z}-1}{\cosh z-2 \sinh z}=\frac{e^{4 z}-1}{\frac{e^{2}+e^{-z}}{2}-\left(e^{z}-e^{-z}\right)}\\&=\frac{e^{42}-1}{-\frac{e^{z}}{2}+\frac{3}{2} e^{-z}}\\
		\Rightarrow f(z)&=\frac{2 e^{2}\left(e^{4 z}-1\right)}{\left(3-e^{2 z}\right)}=\frac{2\left(e^{5 z}-e^{z}\right)}{\left(3-e^{2 z}\right)}\\
		\text{For pole at }z&=z_{0}, 3-e^{2 \xi_{0}}=0 \Rightarrow e^{2 z_{0}}\\&=3 \Rightarrow z_{0}=\frac{\ln 3}{2}
		\intertext{It has simple pole at $z_{0}$}
		\operatorname{Re}\left(z_{0}\right)&=\lim _{z \rightarrow z_{0}}\left(z-z_{0}\right) f(z)=\lim _{2 \rightarrow z_{0}}\left(z-z_{0}\right) \frac{2\left(e^{5 z}-e^{2}\right)}{3-e^{22}}\\
		&=\lim _{z \rightarrow z_{0}} \frac{\left(z-z_{0}\right) \times 2\left(5 e^{5 z}-e^{z}\right)+2\left(e^{5 z}-e^{z}\right) \times 1}{-2 e^{2 z}}\\&=-\left(\frac{e^{5 z_{0}}-e^{z_{0}}}{e^{2 z_{0}}}\right)\\
		&=-\left(\frac{(\sqrt{3})^{5}-\sqrt{3}}{3}\right)=-\left(\frac{9 \sqrt{3}-\sqrt{3}}{3}\right)=-\frac{8}{\sqrt{3}}\\
		\frac{1}{2 \pi i} \oint f(z) d z&=\frac{1}{2 \pi i} \times 2 \pi i \sum\text{ Residue } =-\frac{8}{\sqrt{3}}
		\end{align*}
		So the correct answer is \textbf{Option (C)}
	\end{answer}
	\item  Let $u(x, y)=e^{a x} \cos (b y)$ be the real part of a function $f(z)=u(x, y)+i v(x, y)$ of the complex variable $z=x+i y$, where $a, b$ are real constants and $a \neq 0 .$ The function $f(z)$ is complex analytic everywhere in the complex plane if and only if
	{\exyear{NET/JRF(JUNE-2017)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $b=0$
		\task[\textbf{B.}] $b=\pm a$
		\task[\textbf{C.}] $b=\pm 2 \pi a$
		\task[\textbf{D.}]  $b=a \pm 2 \pi$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		\intertext{The function $f(z)$ will be analytic everywhere in the complex plane if and only if it satisfies the Cauchy Riemann equation in that region.}
		\Rightarrow \frac{\partial u}{\partial x}&=\frac{\partial v}{\partial y}\text{ and } \frac{\partial u}{\partial y}=-\frac{\partial v}{\partial x}\\
		\text{Hence }a e^{a x} \cos (b y)&=\frac{\partial v}{\partial y}\hspace{2cm}\text{(i)}\\
		\text{and }b e^{a x} \sin (b y)&=\frac{\partial v}{\partial x}\hspace{2cm}\text{(ii)}
		\intertext{From equation (i)}
		v(x, y)&=\frac{a e^{a x} \sin (b y)}{b}+c(y)\hspace{2cm}\text{(iii)}
		\intertext{Differentiating partially with $x$ gives}
		\frac{\partial v}{\partial x}&=\frac{a^{2} e^{a x} \sin (b y)}{b}\hspace{2cm}\text{(iv)}
		\intertext{From equation (iii) and (iv)}
		b e^{a x} \sin (b y)&=\frac{a^{2} e^{a x} \sin (b y)}{b}\\
		\Rightarrow b^{2}&=a^{2} \Rightarrow b=\pm a
		\end{align*}
		So the correct answer is \textbf{Option (B)}
	\end{answer}
	\item  The integral $\oint_{\Gamma} \frac{z e^{i \pi z / 2}}{z^{2}-1} d z$ along the closed contour $\Gamma$ shown in the figure is
	{\exyear{NET/JRF(JUNE-2017)}}
	\begin{figure}[H]
		\centering
		\includegraphics[height=4cm,width=5cm]{diagram-20211005(19)-crop}
	\end{figure}
	\begin{tasks}(4)
		\task[\textbf{A.}] 0
		\task[\textbf{B.}] $2 \pi$
		\task[\textbf{C.}] $-2 \pi$
		\task[\textbf{D.}] $4 \pi i$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		f(z)&=\frac{z e^{i z \pi / 2}}{(z+1)(z-1)}\\
		\text{For }z&=+1\text{ anti-clockwise}\\
		I&=2 \pi i \lim _{z \rightarrow 1} \frac{z e^{i \pi z / 2}}{(z+1)}=\frac{2 \pi i}{2} e^{i \pi / 2}=\pi i e^{i \pi / 2}\\
		\text{For }z&=-1\\
		I&=-2 \pi i \lim _{z \rightarrow-1} \frac{z e^{i \pi z / 2}}{(z-1)}=-2 \pi i \times \frac{(-1) e^{-i \pi / 2}}{(-2)}=-\pi i e^{-i \pi / 2}\\
		\text{Integral }&=\pi i \frac{\left(e^{i \pi / 2}-e^{-i \pi / 2}\right)}{2 i} \times 2 i=2 \pi i^{2} \sin \frac{\pi}{2}=-2 \pi
		\end{align*}
		So the correct answer is \textbf{Option (C)}
	\end{answer}
	\item What is the value of $a$ for which $f(x, y)=2 x+3\left(x^{2}-y^{2}\right)+2 i(3 x y+a y)$ is an analytic function of complex variable $z=x+i y$
	{\exyear{NET/JRF(JUNE-2018)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] 1
		\task[\textbf{B.}] 0
		\task[\textbf{C.}] 3
		\task[\textbf{D.}] 2
	\end{tasks}
	\begin{answer}
		\begin{align*}
		f(x, y)&=2 x+3\left(x^{2}-y^{2}\right)+2 i(3 x y+\alpha y)\\
		u&=2 x+3\left(x^{2}-y^{2}\right), v=2(3 x y+\alpha y)\\
		\text{C-R conditions: }u_{x}&=v_{y}, u_{y}=-v_{x}\\
		2+3(2 x)&=2(3 x+\alpha) \Rightarrow \alpha=1 \Rightarrow-6 y=-6 y
		\end{align*}
		So the correct answer is \textbf{Option (A)}
	\end{answer}
	\item  The value of the integral $\oint_{C} \frac{d z}{z} \frac{\tanh 2 z}{\sin \pi z}$, where $C$ is a circle of radius $\frac{\pi}{2}$, traversed counter-clockwise, with centre at $z=0$, is
	{\exyear{NET/JRF(DEC-2018)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] 4
		\task[\textbf{B.}] $4 i$
		\task[\textbf{C.}] $2 i$
		\task[\textbf{D.}] 0
	\end{tasks}
	\begin{answer}$\left. \right. $
		\begin{figure}[H]
			\centering
			\includegraphics[height=4.5cm,width=5.5cm]{diagram-20211005(2)-crop}
		\end{figure}
		\begin{align*}
		&\oint_{C} \frac{d z}{z} \frac{\tanh 2 z}{\sin \pi z} d z\\
		z&=0,1,-1, \frac{\pi i}{4}, \frac{-\pi i}{4}\\
		f(z)&=\frac{2 z-\frac{1}{3}(2 z)^{3}+\frac{2}{15}(2 z)^{5} \ldots .}{z\left(\pi z-\frac{\pi^{3} z^{3}}{3 !}+\ldots\right)}\\
		\frac{2}{\pi z}&\left(1-\frac{1}{2} z^{2}+\ldots\right)\left(1-\frac{\pi^{2} z^{2}}{2 !}+\ldots\right)\\
		b_{1}&=\frac{2}{\pi}\\
		\text{As Re } z&=1, \frac{\tanh ^{2}}{-\pi}\text{ and }\operatorname{Re} z=-1, \frac{\tanh ^{2}}{-\pi}\\
		\operatorname{Re} z&=\frac{i \pi}{4}=-\frac{1}{\pi}\left(2 \operatorname{cosec} h \frac{\pi^{2}}{4}\right)\\
		\operatorname{Re} z&=\frac{-i \pi}{4}=-\frac{1}{\pi}\left(2 \operatorname{cosec} \mathrm{h} \frac{\pi^{2}}{4}\right)
		\intertext{$I=2 \pi i \Sigma R=4 i$ only when 0 lies inside, otherwise wrong question.}
		\end{align*}
		So the correct answer is \textbf{Option (B)}
	\end{answer}
	\item The integral $I=\int_{C} e^{z} d z$ is evaluated from the point $(-1,0)$ to $(1,0)$ along the contour $C$, which is an arc of the parabola $y=x^{2}-1$, as shown in the figure. The value of $I$ is
	{\exyear{NET/JRF(DEC-2018)}}
	\begin{figure}[H]
		\centering
		\includegraphics[height=4.5cm,width=5cm]{diagram-20211005(3)-crop}
	\end{figure}
	\begin{tasks}(4)
		\task[\textbf{A.}]  0
		\task[\textbf{B.}] $2 \sinh 1$
		\task[\textbf{C.}]  $e^{2 i} \sinh 1$
		\task[\textbf{D.}] $e+e^{-1}$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		\int_{C} f(z) d z&=2 \pi i \Sigma R\\
		\int_{C} f(z) d z+\int_{1}^{-1} e^{x} d x&=0\\
		\int_{C} f(z) d z&=-\int_{1}^{-1} e^{x} d x=\int_{1}^{-1} e^{x} d x\\&=\frac{\left(e^{1}-e^{-1}\right)}{2} \cdot 2=2 \sinh 1
		\end{align*}
		So the correct answer is \textbf{Option (B)}
	\end{answer}
	\item The contour $C$ of the following integral
	$$
	\oint_{C} d z \frac{\sqrt{(z-1)(z-3)}}{\left(z^{2}-25\right)^{3}}
	$$
	in the complex $z$ plane is shown in the figure below.\\
	\begin{figure}[H]
		\centering
		\includegraphics[height=3.5cm,width=6cm]{diagram-20211005(8)-crop}
	\end{figure}
	This integral is equivalent to an integral along the contours
	{\exyear{NET/JRF(DEC-2018)}}
	\begin{tasks}(2)
		\task[\textbf{A.}] \begin{figure}[H]
			\centering
			\includegraphics[height=3cm,width=6.5cm]{diagram-20211005(4)-crop}
		\end{figure}
		\task[\textbf{B.}] \begin{figure}[H]
			\centering
			\includegraphics[height=3cm,width=6.5cm]{diagram-20211005(5)-crop}
		\end{figure}
		\task[\textbf{C.}] \begin{figure}[H]
			\centering
			\includegraphics[height=3cm,width=6.5cm]{diagram-20211005(6)-crop}
		\end{figure}
		\task[\textbf{D.}] \begin{figure}[H]
			\centering
			\includegraphics[height=3cm,width=6.5cm]{diagram-20211005(7)-crop}
		\end{figure}
	\end{tasks}
	\begin{answer}
		\begin{align*}
		\intertext{$z=1,3$ are branch points $\infty$ is not a branch point 1 branch cut 3}
		\end{align*}
		So the correct answer is \textbf{Option (C)}
	\end{answer}
	\item  Let $C$ be the circle of radius $\frac{\pi}{4}$ centered at $z=\frac{1}{4}$ in the complex $z$-plane that is traversed counter-clockwise. The value of the contour integral $\oint_{C} \frac{z^{2}}{\sin ^{2} 4 z} d z$ is
	{\exyear{NET/JRF(DEC-2019)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] 0
		\task[\textbf{B.}] $\frac{i \pi^{2}}{4}$
		\task[\textbf{C.}] $\frac{i \pi^{2}}{16}$
		\task[\textbf{D.}] $\frac{i \pi}{4}$
	\end{tasks}
	\begin{answer}$\left. \right. $
		\begin{figure}[H]
			\centering
			\includegraphics[height=3cm,width=3cm]{diagram-20211026(16)-crop}
		\end{figure}
		\begin{align*}
		f(z)&=\left(\frac{\pi}{\sin 4 z}\right)^{2}\\
		z_{0}&=0, \frac{\pi}{4}\text{ are poles}\\
		4 z&=n \pi, z=0, \frac{\pi}{4}
		\intertext{Others are outside the contour.}
		\text{Residue at }z&=0\text{ is }\left[\frac{\pi}{4 z-\frac{4^{3} z^{3}}{3 !}+\ldots}\right]^{2}\\
		&=\left[\frac{1}{4-\frac{4^{3} z^{2}}{3 !}+\ldots .}\right]^{2}\qquad \text{ No terms for } \frac{1}{z}, b_{1}=0\\
		&=\left[4-\frac{4^{3} z^{2}}{3 !}+\ldots .\right]^{-2}\\
		\text{Residue for }z&=\frac{\pi}{4}\\
		z-\frac{\pi}{4}&=t
		\intertext{$\sin (4 t+\pi)=-\sin 4 t \quad$ (But square so no effect)}
		&\left[\frac{t+\frac{\pi}{4}}{\sin 4\left(t+\frac{\pi}{4}\right)}\right]^{2}\\
		\left(\frac{t+\frac{\pi}{4}}{\sin 4 t}\right)^{2}&=\frac{t^{2}+\frac{\pi^{2}}{4}+2 t \cdot \frac{\pi}{4}}{\sin ^{2} 4 t}\\
		\frac{\pi}{2} \frac{t}{16 t^{2}[1-\ldots .]^{2}}&=\frac{\pi}{32 t}[1-\ldots .]^{-2} \text{(from first term)}\\
		b_{1}&=\frac{\pi}{32}\\
		\oint_{C} \frac{z^{2}}{\sin ^{2} 4 z} d z&=2 \pi i\left[0+\frac{\pi}{32}\right]=\frac{i \pi^{2}}{16}
		\end{align*}
		So the correct answer is \textbf{Option (C)}
	\end{answer}
	\item  A function of a complex variable $z$ is defined by the integral $f(z)=\oint_{\Gamma} \frac{w^{2}-2}{w-z} d w$, where $\Gamma$ is a circular contour of radius 3 , centred at origin, running counter-clockwise in the $w$ - plane. The value of the function at $z=(2-i)$ is
	{\exyear{NET/JRF(JUNE-2020)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] 0
		\task[\textbf{B.}] $1-4 i$
		\task[\textbf{C.}]  $8 \pi+2 \pi \mathrm{i}$
		\task[\textbf{D.}] $-\frac{2}{\pi}-\frac{i}{2 \pi}$
	\end{tasks}
	\begin{answer}$\left. \right. $
		\begin{figure}[H]
			\centering
			\includegraphics[height=4cm,width=4.6cm]{diagram-20211027-crop}
		\end{figure}
		\begin{align*}
		f(z)&=\oint_{\Gamma} \frac{w^{2}-2}{w-z} d w\\
		\omega&=z\text{ is a simple pole.}\\
		\text{Residue }\lim _{\omega \rightarrow z}(\omega-z) \frac{\left(\omega^{2}-2\right)}{(\omega-z)}&=(2-i)^{2}-2 \\&=4-1-4 i-2=(1-4 i)\\
		f(z)&=\oint_{\Gamma} \frac{w^{2}-2}{w-z} d w=2 \pi i(1-4 i)=2 \pi i+8 \pi
		\end{align*}
		So the correct answer is \textbf{Option (C)}
	\end{answer}
\end{enumerate}
\colorlet{ocre1}{ocre!70!}
\colorlet{ocrel}{ocre!30!}
\setlength\arrayrulewidth{1pt}
\begin{table}[H]
	\centering
	\arrayrulecolor{ocre}
	\begin{tabular}{|p{1.5cm}|p{1.5cm}||p{1.5cm}|p{1.5cm}|}
		\hline
		\multicolumn{4}{|c|}{\textbf{Answer key}}\\\hline\hline
		\rowcolor{ocrel}Q.No.&Answer&Q.No.&Answer\\\hline
		1&\textbf{C} &2&\textbf{B}\\\hline
		3&\textbf{B} &4&\textbf{A} \\\hline
		5&\textbf{A} &6&\textbf{D} \\\hline
		7&\textbf{A}&8&\textbf{-}\\\hline
		9&\textbf{C}&10&\textbf{A}\\\hline
		11&\textbf{C} &12&\textbf{-}\\\hline
		13&\textbf{A}&14&\textbf{B}\\\hline
		15&\textbf{C}&16&\textbf{B}\\\hline
		17&\textbf{C} &18&\textbf{A}\\\hline
		19&\textbf{B}&20&\textbf{B}\\\hline
		21&\textbf{C}&22&\textbf{C}\\\hline
		23&\textbf{C}& &\\\hline

	\end{tabular}
\end{table}
\newpage
\begin{abox}
	Practise Set-2
\end{abox}
\begin{enumerate}[label=\color{ocre}\textbf{\arabic*.}]
	\item  The value of the integral $\oint_{C} \frac{e^{z} \sin (z)}{z^{2}} d z$, where the contour $C$ is the unit circle: $|z-2|=1$, is
	{\exyear{GATE 2010}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $2 \pi i$
		\task[\textbf{B.}] $4 \pi i$
		\task[\textbf{C.}] $\pi i$
		\task[\textbf{D.}] 0
	\end{tasks}
	\begin{answer}
		\begin{align*}
		\intertext{$|z-2|=1 \Rightarrow 1<z<3$ i.e. the pole $z=0$ does not lie inside the contour.}
		\therefore \quad \oint_{C} \frac{e^{z} \sin z}{z^{2}} d z=2 \pi i \times 0=0 .
		\end{align*}
		So the correct answer is \textbf{Option (D)}
	\end{answer}
	\item Which of the following statements is TRUE for the function $f(z)=\frac{z \sin z}{(z-\pi)^{2}}$ ?
	{\exyear{GATE 2011}}
	\begin{tasks}(1)
		\task[\textbf{A.}] $f(z)$ is analytic everywhere in the complex plane
		\task[\textbf{B.}] $f(z)$ has a zero at $z=\pi$
		\task[\textbf{C.}] $f(z)$ has a pole of order 2 at $z=\pi$
		\task[\textbf{D.}] $f(z)$ has a simple pole at $z=\pi$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		f(z)=\frac{z \sin z}{(z-\pi)^{2}}\text{ has a pole of order 2 at }z=\pi
		\end{align*}
		So the correct answer is \textbf{Option (C)}
	\end{answer}
	\item For the function $f(z)=\frac{16 z}{(z+3)(z-1)^{2}}$, the residue at the pole $z=1$ is (your answer should be an integer)-------
	{\exyear{GATE 2013}}
	\begin{answer}
		\begin{align*}
		\text{	At }z&=1,\text{ pole is of order 2 .} \\&\text{So, residue is }\frac{1}{\lfloor-1} \frac{d^{2-1}}{d z^{2-1}}\left[\frac{(z-1)^{2} 16 z}{(z+3)(z-1)^{2}}\right]_{z=1}=3
		\end{align*}
	\end{answer}
	\item The value of the integral
	$$
	\oint_{C} \frac{z^{2}}{e^{z}+1} d z
	$$
	where $C$ is the circle $|z|=4$, is
	{\exyear{GATE 2014}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $2 \pi i$
		\task[\textbf{B.}] $2 \pi^{2} i$
		\task[\textbf{C.}]  $4 \pi^{3} i$
		\task[\textbf{D.}] $4 \pi^{2} i$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		\text{	Pole }e^{z}&=-1 \Rightarrow e^{z}=e^{i(2 m+1) \pi}\text{ where }m=0,1,2,3 \ldots \ldots\\
		\text{For }z&=i \pi,\text{ Res }=\lim _{z=i \pi} \frac{\phi(z)}{\phi^{\prime}(z)}\\&=-\frac{\pi^{2}}{e^{i \pi}}=\pi^{2}\\
		\text{Similarly, for }z&=-i \pi,\text{ Res }=\pi^{2}\\
		\therefore I&=2 \pi i\left(\pi^{2}+\pi^{2}\right)=4 \pi^{3} i
		\end{align*}
			So the correct answer is \textbf{Option (C)}
	\end{answer}
	\item Consider a complex function $f(z)=\frac{1}{z\left(z+\frac{1}{2}\right) \cos (z \pi)}$. Which one of the following statements is correct?
	{\exyear{GATE 2015}}
	\begin{tasks}(1)
		\task[\textbf{A.}] $f(z)$ has simple poles at $z=0$ and $z=-\frac{1}{2}$
		\task[\textbf{B.}] $f(z)$ has second order pole at $z=-\frac{1}{2}$
		\task[\textbf{C.}] $f(z)$ has infinite number of second order poles
		\task[\textbf{D.}] $f(z)$ has all simple poles
	\end{tasks}
	\begin{answer}
		\begin{align*}
		f(z)&=\frac{1}{z\left(z+\frac{1}{2}\right) \cos (z \pi)}\\
		\text{	For $n^{t h}$ order pole, Res. }&=\lim _{z \rightarrow a}(z-a)^{n} f(z)=\text{ finite}\\
		\text{At }z&=0, \lim _{z \rightarrow 0} z f(z)=\text{ finite }\\\Rightarrow z&=0\text{ is a simple pole.}\\
		\text{At }z&=-\frac{1}{2}, \lim _{z \rightarrow-\frac{1}{2}} \frac{\left(z+\frac{1}{2}\right)^{2}}{z\left(z+\frac{1}{2}\right) \cos z \pi}=\lim _{z \rightarrow-\frac{1}{2}} \frac{\left(z+\frac{1}{2}\right)}{z \cos z \pi}\\&=\lim _{z \rightarrow-\frac{1}{2}} \frac{1}{1 . \cos z \pi+z . \pi(-\sin z \pi)}\\
		&=\lim _{z \rightarrow-\frac{1}{2}} \frac{1}{\cos z \pi-z \pi \sin z \pi}=\frac{1}{-\frac{\pi}{2}}\\&=-\frac{2}{\pi}=\text{ finite}\\
		\Rightarrow f(z)\text{ has second order pole at }z&=-\frac{1}{2}
		\end{align*}
		So the correct answer is \textbf{Option (A)}
	\end{answer}
	\item  Consider $w=f(z)=u(x, y)+i v(x, y)$ to be an analytic function in a domain $D$. Which one of the following options is NOT correct?
	{\exyear{GATE 2015}}
	\begin{tasks}(1)
		\task[\textbf{A.}] $u(x, y)$ satisfies Laplace equation in D
		\task[\textbf{B.}]  $v(x, y)$ satisfies Laplace equation in $D$
		\task[\textbf{C.}] $\int_{1}^{z_{2}} f(z) d z$ is dependent on the choice of the contour between $z_{1}$ and $z_{2}$ in $D$
		\task[\textbf{D.}]  $f(z)$ can be Taylor expended in $D$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		w&=f(z)=u(x, y)+i v(x, y)\text{ to be an analytic function in a domain }D, \int_{z_{1}}^{z_{2}} f(z) d z\text{ is}\\
		&\text{independent of the choice of the contour between }z_{1}\text{ and }z_{2}\text{ in }D.
		\end{align*}
		So the correct answer is \textbf{Option (C)}
	\end{answer}
	\item A function $y(z)$ satisfies the ordinary differential equation $y^{\prime \prime}+\frac{1}{z} y^{\prime}-\frac{m^{2}}{z^{2}} y=0$, where\\
	$m=0,1,2,3, \ldots . .$ Consider the four statements P, Q, R, S as given below.\\
	$\mathrm{P}: z^{m}$ and $z^{-m}$ are linearly independent solutions for all values of $m$\\
	Q: $z^{m}$ and $z^{-m}$ are linearly independent solutions for all values of $m>0$\\
	$\mathrm{R}$ : $\ln z$ and 1 are linearly independent solutions for $m=0$\\
	S: $z^{m}$ and $\ln z$ are linearly independent solutions for all values of $m$\\
	The correct option for the combination of valid statements is
	{\exyear{GATE 2015}}
	\begin{tasks}(4)
		\task[\textbf{A.}] P, R and S only
		\task[\textbf{B.}]  P and R only
		\task[\textbf{C.}] $\mathrm{Q}$ and $\mathrm{R}$ only
		\task[\textbf{D.}] $\mathrm{R}$ and $\mathrm{S}$ only
	\end{tasks}
	\begin{answer}
		\begin{align*}
		y^{\prime \prime}+\frac{1}{z} y^{\prime}-\frac{m^{2}}{z^{2}} y&=0 \Rightarrow z^{2} y^{\prime \prime}+z y^{\prime}-m^{2} y\\&=0, m=0,1,2,3, \ldots, \quad z=e^{x}, D=\frac{d}{d x}\\
		\text{	If }m&=0 ; \quad z^{2} y^{\prime \prime}+z y^{\prime}=0,[D(D-1)+D] y\\&=0 \Rightarrow\left[D^{2}-D+D\right] y=0\\
		D^{2} y&=0 \Rightarrow y=c_{1}+c_{2} x \Rightarrow y\\&=c_{1}+c_{2} \ln z \quad \text{( $R$ is correct)}\\
		\text{And if }m &\neq 0, m>0,\text{ then }m \neq 0,\text{ then }\left(D^{2}-m^{2}\right) y\\&=0 \Rightarrow D=\pm m\\
		y&=c_{1} e^{m x}+c_{2} e^{-m x}=c_{1} e^{m \log z}+c_{2} e^{-m \log z}\\&=c_{1} z^{m}+c_{2} z^{-m}\\
		\text{or if }m &\neq 0, m>0,\text{ then}\\
		y&=c_{1} \cosh (m \log (z))+i c_{2} \sinh (m \log (x)), \quad m>0
		\end{align*}
		So the correct answer is \textbf{Option (C)}
	\end{answer}
	\item  Which of the following is an analytic function of $z$ everywhere in the complex plane?
	{\exyear{GATE 2016}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $z^{2}$
		\task[\textbf{B.}]  $\left(z^{*}\right)^{2}$
		\task[\textbf{C.}] $|z|^{2}$
		\task[\textbf{D.}] $\sqrt{z}$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		z^{2}&=(x+i y)^{2}=x^{2}-y^{2}+i(2 x y) \Rightarrow u\\&=x^{2}-y^{2}\text{ and }v=2 x y\\
		\text{Cauchy Riemann equations }\frac{\partial u}{\partial x}&=\frac{\partial v}{\partial y}=2 x, \quad \frac{\partial v}{\partial x}=-\frac{\partial u}{\partial y}=2 y\text{ satisfies.}
		\end{align*}
		So the correct answer is \textbf{Option (A)}
	\end{answer}
	\item The contour integral $\oint \frac{d z}{1+z^{2}}$ evaluated along a contour going from $-\infty$ to $+\infty$ along the
	real axis and closed in the lower half-plane circle is equal to............... (up to two decimal places).
	{\exyear{GATE 2017}}
	\begin{answer}
		\begin{align*}
		\oint_{c} \frac{1}{1+z^{2}} d z&=\int_{-\infty}^{+\infty} \frac{1}{1+x^{2}} d x+\oint_{c} \frac{1}{1+z^{2}} d z\\
		\text{Poles, }1+z^{2}&=0 \Rightarrow z=\pm i, \quad z=-i\text{ is inside }C\\
		\therefore \operatorname{Res}(z=-i)&=\lim _{z \rightarrow-i}(z+i) \frac{1}{(z-i)(z+i)}\\&=\frac{1}{-i-i}=\frac{1}{-2 i}\\
		\int_{-\infty}^{+\infty} \frac{1}{1+x^{2}} d x&=-\frac{1}{2 i} \times-2 \pi i=\pi
		\intertext{(Since, here we use lower half plane i.e., we traversed in clockwise direction, hence we have to take $-2 \pi i$ )}
		\end{align*}
	\end{answer}
	\item The imaginary part of an analytic complex function is $v(x, y)=2 x y+3 y .$ The real part of the function is zero at the origin. The value of the real part of the function at $1+i$ is ................. (up to two decimal places)
	{\exyear{GATE 2017}}
	\begin{answer}
		\begin{align*}
		\intertext{Solution: The imaginary part of the given analytic function is $v(x, y)=2 x y+3 y .$ From the
			Cauchy - Riemann condition}
		\frac{\partial v}{\partial y}&=\frac{\partial u}{\partial x}=2 x+3
		\intertext{Integrating partially gives}
		u(x, y)&=x^{2}+3 x+g(y)\\
		\intertext{From the second Cauchy - Riemann condition}
		\frac{\partial u}{\partial y}&=-\frac{\partial v}{\partial x},\text{ we obtain} \frac{\partial u}{\partial y}\\&=-2 y, \mu(x, y)=-y^{2}+g(x)\\
		\frac{d g(y)}{d y}&=-2 y \Rightarrow g(y)=-y^{2}+c\\
		\text{	Hence, }u(x, y)&=x^{2}+3 x-y^{2}+c
		\intertext{Since, the real part of the analytic function is zero at the origin.}
		\text{Hence, }0&=0+0-0+c \Rightarrow c=0\\
		\text{Thus, }u(x, y)&=x^{2}+3 x-y^{2}\\
		\therefore f(z)&=\left(x^{2}+3 x-y^{2}\right)+i(2 x y+3 y)
		\intertext{Thus, the value of real part when}
		z&=1+i, i.e. x=1\text{ and }y=1\text{ is }u(x, y)\\&=(1)^{2}+3(1)-1=3
		\end{align*}
	\end{answer}
	\item The absolute value of the integral
	$$
	\int \frac{5 z^{3}+3 z^{2}}{z^{2}-4} d z
	$$
	over the circle $|z-1.5|=1$ in complex plane, is $\ldots$ (up to two decimal places).
	{\exyear{GATE 2018}}
	\begin{answer}
		\begin{align*}
		f(z)&=\frac{5 z^{3}+3 z^{2}}{(z-2)(z+2)}\\
		\text{Pole, }z&=2,-2\\
		z&=-2 \text{ is outside the center}\\
		|-2-1.5|>1&\text{So, will not be considered}\\
		\text{	Now, }\operatorname{Re} s(2)&=\lim _{z \rightarrow 2}(z-2) \frac{\left(5 z^{3}+3 z^{2}\right)}{(z-2)(z+2)}\\&=\frac{52^{3}+32^{2}}{4}=\frac{40+12}{4}=13\\
		I&=2 \pi i \times residue =2 \pi i \times 13\\&=26 \times 3.14 \Rightarrow I=81.64
		\end{align*}
	\end{answer}
	\item The pole of the function $f(z)=\cot z$ at $z=0$ is
	{\exyear{GATE 2019}}
	\begin{tasks}(2)
		\task[\textbf{A.}] A removable pole
		\task[\textbf{B.}] An essential singularity
		\task[\textbf{C.}]  A simple pole
		\task[\textbf{D.}] A second order pole
	\end{tasks}
	\begin{answer}
		\begin{align*}
		f(z)&=\cot z\text{ at }z=0\\
		f(z)&=\frac{1}{\tan z} \quad z=0\text{ is a simple pole }\\f(z)&=\frac{1}{z}\left[1-\frac{1}{3} z^{2}+\ldots .\right]
		\end{align*}
		So the correct answer is \textbf{Option (C)}
	\end{answer}
	\item The value of the integral $\int_{-\infty}^{\infty} \frac{\cos (k x)}{x^{2}+a^{2}} d x$, where $k>0$ and $a>0$, is
	{\exyear{GATE 2019}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $\frac{\pi}{a} e^{-k a}$
		\task[\textbf{B.}] $\frac{2 \pi}{a} e^{-k a}$
		\task[\textbf{C.}] $\frac{\pi}{2 a} e^{-k a}$
		\task[\textbf{D.}] $\frac{3 \pi}{2 a} e^{-k a}$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		&\int_{-\infty}^{\infty} \frac{\cos k x}{x^{2}+a^{2}} d x\\
		f(z)&=\frac{e^{i k x}}{z^{2}+a^{2}}=\frac{e^{i k z}}{(z+i a)(z-i a)}\\
		I&=\operatorname{Re} .2 \pi i \times \frac{e^{i k(i a)}}{2 i a}=\frac{\pi e^{-k a}}{a}
		\end{align*}
		So the correct answer is \textbf{Option (A)}
	\end{answer}
\item The value of the integral $\int_{0}^{\infty} \frac{\ln x}{\left(x^{2}+1\right)^{2}} d x$ is
{\exyear{ JEST 2012}}
 \begin{tasks}(2)
	\task[\textbf{a.}]0
	\task[\textbf{b.}]$\frac{-\pi}{4}$
	\task[\textbf{c.}] $\frac{-\pi}{2}$
	\task[\textbf{d.}] $\frac{\pi}{2}$
\end{tasks}
\begin{answer}$\left. \right. $
	\begin{figure}[H]
		\centering
		\includegraphics[height=4cm,width=4.6cm]{JEST 01 2012}
	\end{figure}
	\begin{align*}
	\int_{0}^{\infty} \frac{\ln x}{\left(x^{2}+1\right)^{2}} d x&=\int_{0}^{\infty} \frac{\ln z}{\left(z^{2}+1\right)^{2}} d z\\
	\text{Let us }&\text{consider new function }f(z)=\left(\frac{\ln z}{z^{2}+1}\right)^{2},\text{ then }I=\int_{0}^{\infty}\left(\frac{\ln z}{z^{2}+1}\right)^{2} d z\\
\text{	Pole at }z&=\pm i\text{ is simple pole of second order.}\\
\text{	Residue at }z&=i\text{ is}\\
&=\frac{d}{d z}(z-i)^{2} \frac{(\ln z)^{2}}{(z-i)^{2}(z+i)^{2}}=\frac{d}{d z} \frac{(\ln z)^{2}}{(z+i)^{2}}\\
&=\frac{(z+i)^{2} 2(\ln z) \cdot \frac{1}{z}-(\ln z)^{2} \cdot 2(z+i)}{(z+i)^{4}}=\frac{(z+i) 2 \ln (z) \frac{1}{z}-(\ln z)^{2} \cdot 2}{(z+i)^{3}}\\
&=\frac{(2 i) 2 \times \frac{1}{i} \ln i-(\ln i)^{2} \cdot 2}{(2 i)^{3}}=\frac{4 \frac{i \pi}{2}-\left(\frac{i \pi}{2}\right)^{2} \times 2}{-8 i}=\frac{2 \pi i+\frac{\pi^{2}}{2}}{-8 i}\\
\left.\Rightarrow \operatorname{Res}\right|_{z=i}&=\frac{-\pi}{4}+\frac{\pi^{2}}{16} i\\
\text{Similarly, at }z&=-i ;\left.\operatorname{Res}\right|_{z=-i}=\frac{-\pi}{4}-\frac{\pi^{2}}{16} i\\
I&=\int_{0}^{\infty}\left(\frac{\ln z}{z^{2}+1}\right)^{2} d z=2 \pi i\left(\frac{-\pi}{4}+\frac{\pi^{2}}{16} i-\frac{\pi}{4}-\frac{\pi^{2}}{16} i\right)=-\pi^{2} i\\
-\pi^{2} i&=\left(\int_{R} \int_{A} \int_{B}\right) f(z) d z=\left(\iint_{A B}\right) f(z) d z ;\qquad \left[\because \int_{A B}\right.\text{ vanish }]\\
\text{Along path }A ;& \quad z=-x+i \varepsilon\text{ and along path }B ; \quad z=-x-i \varepsilon\\
\text{Thus }-\pi^{2} i&=\left(\iint_{A B}\right) f(z) d z=-\int_{-\infty}^{0}\left[\frac{\ln (-x+i \varepsilon)}{(-x+i \varepsilon)^{2}+1}\right] d x-\int_{0}^{\infty}\left[\frac{\ln (-x-i \varepsilon)}{(-x-i \varepsilon)^{2}+1}\right] d x\\
\Rightarrow-\pi^{2} i&=\int_{0}^{\infty}\left[\frac{\ln (-x+i \varepsilon)}{(-x+i \varepsilon)^{2}+1}\right]^{2} d x-\int_{0}^{\infty}\left[\frac{\ln (-x-i \varepsilon)}{(-x-i \varepsilon)^{2}+1}\right]^{2} d x\\
\Rightarrow-\pi^{2} i&=\int_{0}^{\infty}\left[\frac{\ln (x)+i \pi}{1+x^{2}}\right]^{2} d x-\int_{0}^{\infty}\left[\frac{\ln (x)-i \pi}{1+x^{2}}\right]^{2} d x ; \quad \varepsilon \rightarrow 0\\
\Rightarrow-\pi^{2} i&=\int_{0}^{\infty} \frac{(\ln (x)+i \pi)^{2}-(\ln (x)-i \pi)^{2}}{\left(1+x^{2}\right)^{2}} d x\\&=4 \pi i \int_{0}^{\infty} \frac{\ln x}{\left(x^{2}+1\right)^{2}} \Rightarrow \int_{0}^{\infty} \frac{\ln x}{\left(x^{2}+1\right)^{2}}=\frac{-i \pi^{2}}{4 \pi i}=\frac{-\pi}{4}
	\end{align*}
		So the correct answer is \textbf{Option (B)}
\end{answer}
\item Compute $\lim _{z \rightarrow 0} \frac{\operatorname{Re}\left(z^{2}\right)+\operatorname{Im}\left(z^{2}\right)}{z^{2}}$
{\exyear{ JEST 2013}}
 \begin{tasks}(2)
	\task[\textbf{a.}] The limit does not exist
	\task[\textbf{b.}]1
	\task[\textbf{c.}]$-i$
	\task[\textbf{d.}] $-1$
\end{tasks}
\begin{answer}
	\begin{align*}
	\lim _{z \rightarrow 0} \frac{\operatorname{Re}\left(z^{2}\right)+\operatorname{Im}\left(z^{2}\right)}{z^{2}}&=\lim _{z \rightarrow 0} \frac{x^{2}-y^{2}+2 x y}{x^{2}-y^{2}+2 i x y}=\lim _{y=0 \atop x \rightarrow 0} \frac{x^{2}-y^{2}+2 x y}{x^{2}-y^{2}+2 i x y}=1\\
	\lim _{x=0 \atop y \rightarrow 0} \frac{x^{2}-y^{2}+2 x y}{x^{2}-y^{2}+2 i x y}&=1\text{ and }\lim _{y=x \atop x \rightarrow 0} \frac{x^{2}-y^{2}+2 x y}{x^{2}-y^{2}+2 i x y}=-i
	\end{align*}
		So the correct answer is \textbf{Option (A)}
\end{answer}
\item The value of limit
$$
\lim _{z \rightarrow i} \frac{z^{10}+1}{z^{6}+1}
$$
is equal to
{\exyear{ JEST 2014}}
 \begin{tasks}(2)
	\task[\textbf{a.}]1
	\task[\textbf{b.}]0
	\task[\textbf{c.}] $\frac{-10}{3}$
	\task[\textbf{d.}] $\frac{5}{3}$
\end{tasks}
\begin{answer}
	\begin{align*}
	\lim _{z \rightarrow i} \frac{z^{10}+1}{z^{6}+1}=\lim _{z \rightarrow i} \frac{10 z^{9}}{6 z^{5}}=\lim _{z \rightarrow i} \frac{10 z^{4}}{6}=\frac{10}{6}=\frac{5}{3}
	\end{align*}
		So the correct answer is \textbf{Option (D)}
\end{answer}
\item The value of integral
$$
I=\oint \frac{\sin z}{2 z-\pi} d z
$$
with $c$ a circle $|z|=2$, is
{\exyear{ JEST 2014}}
 \begin{tasks}(2)
	\task[\textbf{a.}] 0
	\task[\textbf{b.}]$2 \pi i$
	\task[\textbf{c.}] $\pi i$
	\task[\textbf{d.}]  $-\pi i$
\end{tasks}
\begin{answer}
	\begin{align*}
	I&=\oint_{C} \frac{\sin z}{2 z-\pi},\text{ for pole }2 z-\pi=0 \Rightarrow z=\frac{\pi}{2}\\
\text{	Residue at }z&=\frac{\pi}{2}
	\because|z|=2\text{, so pole will lie within the contour}\\
	I&=\oint_{C} \frac{e^{i z}}{2\left(z-\frac{\pi}{2}\right)}=\sum R \times 2 \pi i\\
	\left.\operatorname{Res}\right|_{z=\frac{\pi}{2}}&=\frac{\left(z-\frac{\pi}{2}\right) e^{i z}}{2\left(z-\frac{\pi}{2}\right)}=\frac{e^{i \pi / 2}}{2}=\frac{i}{2}\text{ (taking imaginary part); Residue }=\frac{1}{2}\\
	\text{Now, }I&=\frac{1}{2} \times 2 \pi i=\pi i
	\end{align*}
		So the correct answer is \textbf{Option (C)}
\end{answer}
\item Given an analytic function $f(z)=\phi(x, y)+i \psi(x, y)$, where $\phi(x, y)=x^{2}+4 x-y^{2}+2 y$
If $C$ is a constant, which of the following relations is true?
{\exyear{ JEST 2015}}
 \begin{tasks}(2)
	\task[\textbf{a.}]$\psi(x, y)=x^{2} y+4 y+C$
	\task[\textbf{b.}]$\psi(x, y)=2 x y-2 x+C$
	\task[\textbf{c.}]$\psi(x, y)=2 x y+4 y-2 x+C$
	\task[\textbf{d.}] $\psi(x, y)=x^{2} y-2 x+C$
\end{tasks}
\begin{answer}
	\begin{align}
	u&=\phi(x, y)=x^{2}+4 x-y^{2}+2 y, v=\psi\notag\\
	\text{From C.R. equation, }\frac{\partial u}{\partial x}&=\frac{\partial v}{\partial y}, \Rightarrow \frac{\partial \phi}{\partial x}=\frac{\partial \psi}{\partial y}, \frac{\partial u}{\partial y}=-\frac{\partial v}{\partial x} \Rightarrow \frac{\partial \phi}{\partial y}=-\frac{\partial \psi}{\partial x}\notag\\
	\text{Now, }\frac{\partial \phi}{\partial x}&=2 x+4=\frac{\partial \psi}{\partial y}\notag\\
	\Rightarrow \psi&=2 x y+4 y+f(x)\label{CN 01}\\
	\text{and }\frac{\partial \phi}{\partial y}&=-2 y+2 \Rightarrow \frac{\partial \psi}{\partial x}=+2 y-2\notag\\
	\psi&=2 x y+2 x+f(y)\label{CN 02}\\
	\text{From (\ref{CN 01}) and (\ref{CN 02}), }&2 x y+4 y+f(x)=2 x y-2 x+f(y)\notag\\
	f(x)&=-2 x, \quad f(y)=4 y \notag\\
	\psi&=2 x y+4 y-2 x+c\notag
	\end{align}
		So the correct answer is \textbf{Option (C)}
\end{answer}
\item Which one is the image of the complex domain $\{z \mid x y \geq 1, x+y>0\}$ under the mapping $f(z)=z^{2}$, if $z=x+i y ?$
{\exyear{ JEST 2017}}
 \begin{tasks}(2)
	\task[\textbf{a.}] $\{z \mid x y \geq 1, x+y>0\}$
	\task[\textbf{b.}]$\{z \mid x \geq 2, x+y>0\}$
	\task[\textbf{c.}]$\{z \mid y \geq 2 \forall x\}$
	\task[\textbf{d.}] $\{z \mid y \geq 1 \forall x\}$
\end{tasks}
\item The integral $I=\int_{1}^{\infty} \frac{\sqrt{x-1}}{(1+x)^{2}} d x$ is
{\exyear{ JEST 2017}}
 \begin{tasks}(2)
	\task[\textbf{a.}]$\frac{\pi}{\sqrt{2}}$
	\task[\textbf{b.}]$\frac{\pi}{2 \sqrt{2}}$
	\task[\textbf{c.}]$\frac{\sqrt{\pi}}{2}$
	\task[\textbf{d.}]$\sqrt{\frac{\pi}{2}}$
\end{tasks}
\begin{answer}
	\begin{align*}
	I&=\int_{1}^{\infty} \frac{\sqrt{x-1}}{(1+x)^{2}} d x\\
\text{	Put,} x&=\left(1+z^{2}\right), d x=2 z d z\\
	\text{Hence, }I&=\int_{0}^{\infty} \frac{2 z^{2} d z}{\left(2+z^{2}\right)^{2}}\\
	\text{Here poles, }\left(2+z^{2}\right)&=0 \Rightarrow(z+i \sqrt{2})(z-i \sqrt{2})=0\\
\text{	Only }&(z=i \sqrt{2})\text{ poles is allowed}\\
\text{Then }R(i \sqrt{2})&=\lim _{z \rightarrow i \sqrt{2}} \frac{1}{\sqrt{2-1}} \frac{d}{d z}\left[\frac{2 z^{2}(z-i \sqrt{2})^{2}}{(z-i \sqrt{2})^{2}(z+i \sqrt{2})^{2}}\right]\\
&=\lim _{z \rightarrow i \sqrt{2}}\left[\frac{(z+i \sqrt{2})^{2} \cdot 4 z-2 z^{2} \cdot 2(z+i \sqrt{2})}{(z+i \sqrt{2})^{4}}\right]\\
&=\frac{(2 i \sqrt{2})^{2} \times 4(i \sqrt{2})-2(i \sqrt{2})^{2} \cdot 2(2 i \sqrt{2})}{(2 i \sqrt{2})^{4}}\\&=-\frac{32 \sqrt{2} i+16 \sqrt{2} i}{64}=-\frac{16 \sqrt{2} i}{64}=-\frac{i}{2 \sqrt{2}}\\
\text{Hence, }\int_{-\infty}^{\infty} \frac{2 z^{2}}{\left(2+z^{2}\right)^{2}} d z&=2 \pi i\left(-\frac{i}{2 \sqrt{2}}\right)=\frac{\pi}{\sqrt{2}}\\
\Rightarrow \int_{0}^{\infty} \frac{2 z^{2}}{\left(2+z^{2}\right)^{2}} d z&=\frac{\pi}{2 \sqrt{2}} \Rightarrow \int_{i}^{\infty} \frac{\sqrt{x-1}}{(1+x)^{2}} d x=\frac{\pi}{2 \sqrt{2}}
	\end{align*}
	So the correct answer is \textbf{Option (B)}
\end{answer}
\item The integral
$$
\int_{-\infty}^{\infty} \frac{\cos x}{x^{2}+1} d x \text { is }
$$
{\exyear{ JEST 2018}}
 \begin{tasks}(2)
	\task[\textbf{a.}]$\frac{\pi}{e}$
	\task[\textbf{b.}] $\pi e^{-2}$
	\task[\textbf{c.}]$\pi$
	\task[\textbf{d.}] zero
\end{tasks}
\begin{answer}
	\begin{align*}
	f(z)&=\frac{e^{i z}}{z^{2}+1}=\frac{e^{i z}}{(z+i)(z-i)}\\
	\int_{-\infty}^{\infty} \frac{\cos x}{x^{2}+1} d x&=\operatorname{Re} 2 \pi i \times \frac{e^{i \cdot i}}{z i}=\frac{\pi}{e}
	\end{align*}
		So the correct answer is \textbf{Option (A)}
\end{answer}
\item Consider the function $f(x, y)=|x|-i|y| .$ In which domain of the complex plane is this function analytic?
{\exyear{ JEST 2019}}
 \begin{tasks}(2)
	\task[\textbf{a.}]First and second quadrants
	\task[\textbf{b.}]Second and third quadrants
	\task[\textbf{c.}]Second and fourth quadrants
	\task[\textbf{d.}]  Nowhere
\end{tasks}
\begin{answer}
	\begin{align*}
	 f(x, y)&=|x|-i|y|\\
	f(x, y)&=x-i y=\bar{z}\\
	f(x, y)&=-x-i y=-z\\
	f(x, y)&=-x+i y=-\bar{z}\\
	f(x, y)&=x+i y=z
	\intertext{We know $\bar{z}$ is not analytic and $z$ and $-z$ are analytic. }
	\end{align*}
	So the correct answer is \textbf{Option (C)}
\end{answer}
\end{enumerate}
 \colorlet{ocre1}{ocre!70!}
\colorlet{ocrel}{ocre!30!}
\setlength\arrayrulewidth{1pt}
\begin{table}[H]
	\centering
	\arrayrulecolor{ocre}
	\begin{tabular}{|p{1.5cm}|p{1.7cm}||p{1.5cm}|p{1.5cm}|}
		\hline
		\multicolumn{4}{|c|}{\textbf{Answer key}}\\\hline\hline
		\rowcolor{ocrel}Q.No.&Answer&Q.No.&Answer\\\hline
		1&\textbf{D} &2&\textbf{C}\\\hline
		3&\textbf{3(NAT)} &4&\textbf{C} \\\hline
		5&\textbf{A} &6&\textbf{C} \\\hline
		7&\textbf{C}&8&\textbf{A}\\\hline
		9&\textbf{$\pi$(NAT)}&10&\textbf{3(NAT)}\\\hline
		11&\textbf{81.64(NAT)} &12&\textbf{C}\\\hline
		13&\textbf{A}& 14&\textbf{B}\\\hline
		15&\textbf{A}&16 &\textbf{D}\\\hline
		17&\textbf{C}&18&\textbf{C}\\\hline
		19&\textbf{-} &20&\textbf{B}\\\hline
		21&\textbf{A}&22&\textbf{C}\\\hline
	\end{tabular}
\end{table}

CSIR- Mathematical Physics/chapter/Complex Problem Set Solutions.tex


\section{Data Description and Preprocessing}
\subsection{Fundamental Data Description}

The data used within this project was obtained from a study carried out as part of a research program for the \textit{UK Forensic Science Service} \cite{ForensicScienceInduction}. The data set contained a total of $214$ glass fragments that were obtained in a pre-split of $149$ training and $65$ test samples. For each glass fragment, a total of nine features were recorded, including a measure of the refractive index (RI), which describes how fast light travels through a material. It is a standard measure in glass analysis as it varies significantly for different types of glass. The remaining eight measured features described the chemical composition of the glass fragment in percent. Table \ref{features} lists all measured features.
\newline

\begin{table}[!ht]
  \footnotesize
  \centering
\begin{tabular}{ c c c c c c c c c }
 \toprule
 \textbf{RI} & \textbf{Na} & \textbf{Mg} & \textbf{Al} & \textbf{Si} & \textbf{K} & \textbf{Ca} & \textbf{Ba} & \textbf{Fe} \\
 \midrule
 Refractive Index & Sodium & Magnesium & Aluminium & Silicon & Potassium & Calcium & Barium & Iron \\
 \bottomrule
\end{tabular}
\captionsetup{justification=centering,margin=2cm}
\caption{Observed Features for Glass Fragments}
\label{features}
\end{table}

Each glass fragment in the data set belonged to one of six classes. In the data the classes were integer-encoded and mapped to the respective glass types depicted in Table \ref{classes}.
\newline

\begin{table}[!ht]
  \footnotesize
  \centering
\begin{tabular}{ c c }
 \toprule
 Integer Code & Glass Type \\
 \midrule
 1 & Window from building (float processed) \\
 2 & Window from building (non-float processed) \\
 3 & Window from vehicle \\
 5 & Container \\
 6 & Tableware \\
 7 & Headlamp \\
 \bottomrule
\end{tabular}
\captionsetup{justification=centering,margin=2cm}
\caption{Glass Types and their Encoding}
\label{classes}
\end{table}

\subsection{Data Cleaning}
All data integrity checks carried out, such as checking for missing values, checking for the ranges of each feature, and adding up the percentages in the chemical composition in all glass fragments, did not report any major inconsistencies. Thus, no further data cleaning was necessary.

% To get reproducible results, the training data was further divided into a training and validation split, that were used in the training of all models. Furthermore, all splits were normalised using a standard normalisation, meaning that each feature was transformed such that it had a zero mean and unit variance. This was crucial for ensuring that each feature contributed to the PCA analysis independently of its scale and the gradient descent training algorithm in the neural network to work properly.


\section{Stiefel-Whitney classes, immersions, cobordisms}
There is a result analogous to Theorem \ref{chern-classes} for all vector
bundles (not necessarily oriented):
\begin{theorem}
    There exist a unique family of characteristic classes $w_i:\Vect_n(X) \to
    H^n(X;\FF_2)$ such that for $0\leq i$ and $i>n$, we have $w_i=0$, and:
    \begin{enumerate}
	\item $w_0 = 1$;
	\item $w_1(\lambda) = e(\lambda)$; and
	\item the Whitney sum formula holds:
	    \begin{equation*}
		w_k(\xi\oplus\eta) = \sum_{i+j=k} w_i(\xi)\cup w_j(\eta)
	    \end{equation*}
    \end{enumerate}
    Moreover:
    $$
    H^\ast(BO(n);\FF_2) = \FF_2[w_1,\cdots,w_n],
    $$
    where $w_n = e_2$.
\end{theorem}
\begin{remark}
    We can express the Whitney sum formula simply by defining the \emph{total
    Steifel-Whitney class}
    $$1 + w_1 + w_2 + \cdots=:w.$$
    Then the Whitney sum formula is just
    $$
    w(\xi\oplus\eta) = w(\xi)\cdot w(\eta).
    $$
    Likewise, the Whitney sum formula can be stated by defining the total Chern
    class.
\end{remark}
\begin{remark}\label{sw-stability}
    Again, the Steifel-Whitney classes are stable:
    $$w(\xi\oplus k\epsilon) = w(\xi).$$
\end{remark}
Again, Grothendieck's definition works since the splitting principle holds.
There is an injection $H^\ast(BO(n))\hookrightarrow H^\ast(B(\Z/2\Z)^n)$. To
compute $H^\ast(BO(n))$, our argument for computing $H^\ast(BU(n))$ does not
immediately go through, although there is a fiber sequence
$$S^{n-1} \to EO(n)\times_{O(n)} O(n)/O(n-1)\to BO(n);$$
the problem is that $n-1$ can be even or odd. We still have a Gysin sequence,
though:
$$
\cdots\to H^{q-n}(BO(n))\xar{e\cdot} H^q(BO(n)) \xar{\pi^\ast} H^q(BO(n-1)) \to H^{q-n+1}(BO(n))\to\cdots
$$
In order to apply our argument for computing $H^\ast(BU(n))$ to this case, we
only need to know that $e$ is a nonzero divisor. The splitting principle gave a
monomorphism $H^\ast(BO(n)) \hookrightarrow H^\ast((\RP^\infty)^n)$. The fact
that $e$ is a nonzero divisor follows from the observation that under this map,
$$e_2=w_n\mapsto e_2(\lambda_1\oplus\cdots\oplus\lambda_n) = t_1\cdots t_n,$$
using the same argument as in \S \ref{euler-multiplicativity}; however,
$t_1\cdots t_n$ {is} a nonzero divisor, since $H^\ast((\RP^\infty)^n)$ is an
integral domain.
\subsection{Immersions of manifolds}
The theory developed above has some interesting applications to differential
geometry.
\begin{definition}
    Let $M^n$ be a smooth closed manifold. An \emph{immersion} is a smooth map
    from $M^n$ to $\RR^{n+k}$, denoted $f:M^n\looparrowright \RR^{n+k}$, such
    that $(\tau_{M^n})_x \hookrightarrow (\tau_{\RR^{n+k}})_{f(x)}$ for $x\in
    M$.
\end{definition}
Informally: crossings are allows, but not cusps.
%It's a big problem in topology to try to eliminate the crossings.
\begin{example}
    There is an immersion $\RP^2 \looparrowright \RR^3$, known as \emph{Boy's
    surface}.
\end{example}
\begin{question}
    When can a manifold admit an immersion into an Euclidean space?
\end{question}
Assume we had an immersion $i:M^n\looparrowright \RR^{n+k}$.
Then we have an embedding $f:\tau_M \to i^\ast \tau_{\RR^{n+k}}$ into a trivial
bundle over $M$, so $\tau_M$ has a $k$-dimensional complement, called $\xi$
such that
$$\tau_M\oplus\xi = (n+k)\epsilon.$$
Apply the total Steifel-Whitney class, we have
$$w(\tau)w(\xi) = 1,$$
since there's no higher Steifel-Whitney class of a trivial bundle. In
particular,
$$
w(\xi) = w(\tau)^{-1}.
$$
\begin{example}
    Let $M = \RP^n\looparrowright \RR^{n+k}$. Then, we know that
    $$\tau_{\RP^n}\oplus\epsilon\simeq (n+1)\lambda^\ast \simeq (n+1)\lambda,$$
    where $\lambda\downarrow \RP^n$ is the canonical line bundle. By Remark
    \ref{sw-stability}, we have
    $$w(\tau_{\RP^n}) = w(\tau_{\RP^n}\oplus\eta) = w((n+1)\lambda) =
    w(\lambda)^{n+1}.$$
    It remains to compute $w(\lambda)$. Only the first Steifel-Whitney class is
    nonzero. Writing $H^\ast(\RP^n) = \FF_2[x]/x^{n+1}$, we therefore have
    $w(\lambda) = x$. In particular,
    $$w(\tau_{\RP^n}) = (1+x)^{n+1} = \sum^n_{i=0}\binom{n+1}{i}x^i.$$
    It follows that
    $$w_i(\tau_{\RP^n}) = \binom{n+1}{i}x^i.$$
    The total Steifel-Whitney class of the complement of the tangent bundle is:
    $$w(\xi) = (1+x)^{-n-1}.$$
    The most interesting case is when $n$ is a power of $2$, i.e., $n=2^s$ for
    some integer $s$. In this case, since taking powers of $2$ is linear in
    characteristic $2$, we have
    $$w(\xi) = (1+x)^{-1-2^s} = (1+x)^{-1}(1+x)^{-2^s} =
    (1+x)^{-1}(1+x^{2^s})^{-1}.
    %= (1+x+x^2+\cdots)(1+x^{2^s}+\cdots)
    $$
    As all terms of degree greater than $2^s$ are zero, we conclude that
    So
    $$w(\xi) = 1+x+x^2+\cdots+x^{2^s-1}+2x^s = 1+x+x^2+\cdots+x^{2^s-1}.$$
    As $x^{2^s-1}\neq 0$, this means that $k = \dim\xi \geq 2^s-1$. We
    conclude:
    \begin{theorem}
	There is no immersion $\RP^{2^s}\looparrowright \RR^{2\cdot 2^{s}-2}$.
    \end{theorem}
    The following result applied to $\RP^{2^s}$ shows that the above result is
    sharp:
    \begin{theorem}[Whitney]
	Any smooth compact closed manifold $M^n \looparrowright \RR^{2n-1}$.
    \end{theorem}
    However, Whitney's result is \emph{not} sharp for a general smooth compact
    closed manifold. Rather, we have:
    \begin{theorem}[Brown--Peterson, Cohen]
	A closed compact smooth $n$-manifold $M^n \looparrowright
	\RR^{2n-\alpha(n)}$, where $\alpha(n)$ is the number of $1$s in the
	dyadic expansion of $n$.
    \end{theorem}
    This result is sharp, since if $n=\sum 2^{d_i}$ for the dyadic expansion,
    then $M = \prod_i \RP^{2^{d_i}} \not \looparrowright \RR^{2n-\alpha(n)-1}$.
\end{example}
%There was a period of time in the late '60s, etc. when a lot of effort was put
%in to stronger and stronger immersion results.
\subsection{Cobordism, characteristic numbers}
If we have a smooth closed compact $n$-manifold, then it embeds in $\RR^{n+k}$
for some $k\gg 0$. The normal bundle then satisfies
$$\tau_M\oplus \nu_M = (n+k)\epsilon.$$
A piece of differential topology tells us that if $k$ is large, then
$\nu_M\oplus N\epsilon$ is independent of the bundle for some $N$.

This example, combined with Remark \ref{stability}, shows that $w(\nu_M)$ is
independent of $k$. We are therefore motivated to think of Stiefel-Whitney
classes as coming from $H^\ast(BO;\FF_2) = \FF_2[w_1,w_2,\cdots]$, where $BO =
\varinjlim BO(n)$. Similarly, Chern classes should be thought of as coming from
$H^\ast(BU;\Z) = \Z[c_1,c_2,\cdots]$. This exa
\begin{definition}
    The characteristic number of a smooth closed compact $n$-manifold
    $M$ is defined to be $\langle w(\nu_M),[M]\rangle$.
\end{definition}
Note that the fundamental class $[M]$ exists, since our coefficients are in
$\FF_2$, where everything is orientable.

This definition is very useful when thinking about cobordisms.
\begin{definition}\label{cobordism}
    Two (smooth closed compact) $n$-manifolds $M, N$ are \emph{(co)bordant} if
    there is an $(n+1)$-dimensional manifold $W^{n+1}$ with boundary such that
    $$\partial W\simeq M\sqcup N.$$
\end{definition}
For instance, when $n=0$, the manifold $\ast\sqcup \ast$ is \emph{not}
cobordant to $\ast$, but it is cobordant to the empty set. However,
$\ast\sqcup\ast\sqcup\ast$ is cobordant to $\ast$. Any manifold is cobordant
to itself, since $\partial(M\times I) = M\sqcup M$. In fact, cobordism forms
an equivalence relation on manifolds.

\begin{example}
    A classic example of a cobordism is the ``pair of pants''; this is the
    following cobordism between $S^1$ and $S^1\sqcup S^1$:
    \todo{add image}
\end{example}

Let us define
$$
\Omega^O_n = \{\text{cobordism classes of $n$-manifolds}\}.
$$
This forms a group: the addition is given by disjoint union. Note that every
element is its own inverse. Moreover, $\bigoplus_n \Omega^O_n = \Omega^O_\ast$
forms a graded ring, where the product is given by the Cartesian product of
manifolds. Our discussion following Definition \ref{cobordism} shows that
$\Omega^O_0 = \FF_2$.
\begin{exercise}\label{nullbordant}
    Every $1$-manifold is nullbordant, i.e., cobordant to the point.
\end{exercise}
Thom made the following observation. Suppose an $n$-manifold $M$ is embedded
into Euclidean space, and that $M$ is nullbordant via some $(n+1)$-manifold
$W$, so that $\nu_W|_{M} = \nu_M$. In particular,
$$\langle w(\nu_M),[M]\rangle = \langle w(\nu_W)|_{M},[M]\rangle.$$
On the other hand, the boundary map $H_{n+1}(W,M) \xar{\partial} H_n(M)$ sends
the relative fundamental class $[W,M]$ to $[M]$. Thus
$$\langle w(\nu_M),[M]\rangle = \langle w(\nu_M),\partial[W,M]\rangle = \langle
\delta w(\nu_M),[W,M]\rangle.$$
However, we have an exact sequence
$$H^n(W)\xar{i^\ast} H^n(M) \xar{\delta} H^{n+1}(W,M).$$
Since $w(\nu_M)$ is in the image of $i^\ast$, it follows that $\delta w(\nu_M)
= 0$. In particular, the characteristic number of a nullbordant manifold is
zero. Thus, we find that ``Stiefel-Whitney numbers tell all'':
\begin{prop}
    Characteristic numbers are cobordism invariants. In other words,
    characteristic numbers give a map
    $$\Omega^O_n \to \Hom(H^n(BO),\FF_2)\simeq H_n(BO).$$
\end{prop}
More is true:
\begin{theorem}[Thom, 1954]\label{thom-sw}
    The map of graded rings $\Omega^O_\ast\to H_\ast(BO)$ defined by the
    characteristic number is an inclusion. Concretely, if $w(M^n) = w(N^n)$ for
    all $w\in H^n(BO)$, then $M^n$ and $N^n$ are cobordant.
\end{theorem}
The way that Thom proved this was by expressing $\Omega^O_\ast$ is the graded
homotopy ring of some space, which he showed is the product of mod $2$
Eilenberg-MacLane spaces. Along the way, he also showed that:
$$
\Omega^O_\ast = \FF_2[x_i:i\neq 2^s-1] = \FF_2[x_2,x_4,x_5,x_6,x_8,\cdots]
$$
This recovers the result of Exercise \ref{nullbordant} (and so much more!).


\section{Universal Hashing}

\def\E{\mathbb{E}}
\toclesssubsection{Introduction}

\begin{frame}{Universal Hashing}{Thought Experiment}
  \textbf{Thought Experiment:}\\
  \begin{itemize}
    \item<1->
      A {\color{MainA}hash function} is defined for a given
      {\color{MainA}key set}
    \item<2->
      Find a {\color{MainA}set of keys} resulting in a degenerated
      {\color{MainA}hash table}
      \begin{itemize}
        \item<3->\textit{The {\color{MainA}hash function} stays fixed}\\
        \item<4->\textit{For table size of 100: try $100 \times (99 + 1)$ different numbers}\\
       \item<5->\textit{Worst case: all 100 {\color{MainA}key sets} map to
         one bucket}
      \end{itemize}
    \item<5->
      \textbf{Now:} find a solution to avoid that problem
  \end{itemize}
\end{frame}

%-------------------------------------------------------------------------------

\begin{frame}{Universal Hashing}{Idea}
  \textbf{Solution:} {\color{MainA}universal hashing}
  \begin{itemize}
    \item<1->
      Out of a set of hash functions we randomly choose one
    \item<2->
      The {\color{MainA}expected result} of the hash function is an equal
      distribution over the buckets
    \item<3->
      This hash function stays fixed for the lifetime of table\\
      Optional: copy table with new hash when degenerated
  \end{itemize}
  \onslide<1->{
  \vspace{-0.5em}
  \begin{columns}
    \begin{column}[T]{0.33\linewidth}
      \begin{figure}[!h]
        \begin{adjustbox}{height=0.8\linewidth}
          \input{Images/UniversalHashing/Hash_1_Crossing.tikz}
        \end{adjustbox}
        \caption{Hash func. 1}
        \label{fig:universal_hashing:hash_function_crossing}
      \end{figure}
    \end{column}
    \begin{column}[T]{0.33\linewidth}
      \begin{figure}[!h]
        \begin{adjustbox}{height=0.8\linewidth}
          \input{Images/UniversalHashing/Hash_2_Normal.tikz}
        \end{adjustbox}
        \caption{Hash func. 2}
        \label{fig:universal_hashing:hash_function_normal}
      \end{figure}
    \end{column}
    \begin{column}[T]{0.33\linewidth}
      \begin{figure}[!h]
        \begin{adjustbox}{height=0.8\linewidth}
          \input{Images/UniversalHashing/Hash_3_Colliding.tikz}
        \end{adjustbox}
        \caption{Hash func. coll.}
        \label{fig:universal_hashing:hash_function_colliding}
      \end{figure}
    \end{column}
  \end{columns}}
\end{frame}

%-------------------------------------------------------------------------------

\begin{frame}{Universal Hashing}{Definition}
  \textbf{Definition:}
  \begin{itemize}
    \item<1->
      We call {\color{MainA}$\mathbb{U}$} the set (universe) of
      possible keys
    \item<2->
      The size {\color{MainA}$m$} of the hash table {\color{MainA}$T$}
    \item<3->
      Set of hash functions
      {\color{MainA}$\mathbb{H} = \{h_1, h_2,\dots, h_n\}$} with
      {\color{MainA}$h_i: \mathbb{U} \to \{0,\dots, m - 1\}$}
    \item<5-> Idea: runtime should be
      $\color{MainA} O(1+\frac{\vert \mathbb{S}\vert}{m})$,
      \rlap{where $\color{MainA}\frac{\vert \mathbb{S} \vert}{m}$ is the
      table load}
  \end{itemize}%\vspace*{-2em}
  \begin{figure}[!b]%
    \begin{adjustbox}{height=0.32\linewidth}%
      \input{Images/UniversalHashing/HashFunction.tikz}%
    \end{adjustbox}
    \vspace*{-1.0em}%
    \onslide<3->\caption{Hash function $h_1$}%
    \label{fig:universal_hashing:hash_function_definition}
  \end{figure}
\end{frame}

%-------------------------------------------------------------------------------

\begin{frame}{Universal Hashing}{Definition}
  \begin{columns}
    \begin{column}{0.5\linewidth}
      \begin{itemize}
        \item<1->
          We choose two random keys
          {\color{MainA}$x, y \in \mathbb{U} \mid x \neq y$}
        \item<2->
          An average of 3 out of 15 functions produce collisions
      \end{itemize}
    \end{column}
    \begin{column}{0.5\linewidth}
      \begin{figure}[!t]%
        \begin{adjustbox}{width=\linewidth}
          \input{Images/UniversalHashing/HashUniverse.tikz}%
        \end{adjustbox}
        \caption{Set of hash functions $\mathbb{H}$}%
        \label{fig:universal_hashing:hash_universe}
      \end{figure}
    \end{column}
  \end{columns}
\end{frame}

%-------------------------------------------------------------------------------

\begin{frame}{Universal Hashing}{Definition}
  \textbf{Definition:}
  {\color{MainA}$\mathbb{H}$} is {\color{MainA}$c$-universal} if
  {\color{MainA}$\forall x, y \in \mathbb{U} \mid x \neq y:$
  \begin{displaymath}
    \overbrace{
      \frac{
        \vert \{h \in \mathbb{H}\!: h(x) = h(y)\} \vert
      }{
      \underbrace{\vert \mathbb{H} \vert}_\text{{\color{black}Number of hash functions}}
      }
    }^\text{
      {\color{black}Number of hash functions that create collisions}
    }
    \leq c \cdot \frac{1}{m}, \hspace*{1.5em} c \in \mathbb{R}
  \end{displaymath}}
  \vspace{-1em}
  \begin{itemize}
  \item<2->
      In other words, given an arbitrary but fixed pair
      {\color{MainA}$x, y$}.\\
      If {\color{MainA}$h \in \mathbb{H}$} is chosen randomly then\\
      \onslide<3->{
        \begin{center}
          \color{MainA}
          $Prob ( h(x) = h(y) ) \leq c \cdot \frac{1}{m}$
        \end{center}
      }
  \end{itemize}
  \onslide <4->
  \begin{block}{Note: If the hash function assigns each key $x$ and $y$
      randomly to buckets then:}
    {\onslide<5->$Prob( Collision ) = \frac{1}{m} \Leftrightarrow c = 1$}
  \end{block}
\end{frame}

%-------------------------------------------------------------------------------

\begin{frame}{Universal Hashing}{Definition}
  \begin{columns}
    \begin{column}{0.5\linewidth}
      \begin{itemize}
        \item
          {\color{MainA}$\mathbb{U}$}:
          key universe
        \item
          {\color{MainA}$\mathbb{S}$}:
          used Keys
        \item
          {\color{MainA}$\mathbb{S}_i \subseteq \mathbb{S}$}:
          keys mapping to Bucket {\color{MainA}$i$} (\enquote{synonyms})
       \item
         Ideal would be
         {\color{MainA}$\vert \mathbb{S}_i \vert =\dfrac{\vert \mathbb{S} \vert}{m}$}
      \end{itemize}
    \end{column}
    \begin{column}{0.5\linewidth}
      \begin{figure}[!h]%
        \begin{adjustbox}{width=\linewidth}%
          \input{Images/UniversalHashing/HashFunctionToBucket.tikz}%
        \end{adjustbox}
        \caption{Hash function {\color{MainA}$h \in \mathbb{H}$}}%
        \label{fig:universal_hashing:hash_function_to_bucket}
      \end{figure}
    \end{column}
  \end{columns}
\end{frame}

%-------------------------------------------------------------------------------

\begin{frame}{Universal Hashing}{Definition}
  \begin{itemize}
    \item<1->
      Let {\color{MainA}$\mathbb{H}$} be a {\color{MainA}$c$}-universal class of hash functions
    \item<2->
      Let {\color{MainA}$\mathbb{S}$} be a set of keys and {\color{MainA}$h \in \mathbb{H}$} selected randomly
    \item<3->
      Let {\color{MainA}$\mathbb{S}_i$} be the key {\color{MainA}$x$} for which {\color{MainA}$h(x) = i$}
    \item<4->
      The expected average number of elements to search through per
      bucket is {\color{MainA}\[\E{}\left[\vert \mathbb{S}_i \vert\right]
        \leq 1 + c \cdot \frac{\vert \mathbb{S} \vert}{m}\]}
    \item<5->
      Particulary: if  {\color{MainA}($m = \Omega(\vert \mathbb{S} \vert)$)} then
      {\color{MainA}$\E{}\left[\vert \mathbb{S}_i \vert\right] = \mathcal{O}(n)$}
  \end{itemize}
\end{frame}


\section{Differential Geometry of Space Curves}
\subsection{Parameterized Curve by Arc Length}
\begin{definition}
    A parameterized curve $C$ is the image of a continuous map $[a,b]\to \mathbb R^3$ sending $t\mapsto \underline{x}(t)$.
    We say $C$ is a differentiable parameterized curve if each component $x_i(t)$ is differentiable.
    We say $C$ is regular if $\underline{x}^\prime(t)\neq\underline{0}$ for any $t$.\\
    A regular and differentiable curve is called smooth.
\end{definition}
Since it is an applied course (sadly), we will assert that our curve is as differentiable as we like.\\
To find the length of this curve, we partition the interval $[a,b]$ by $a=t_0<t_1<t_2<\cdots <t_{n-1}<t_n=b$.
We define the length $l(C,P)$ with respect to this partition $P$ to be
$$l(C,P)=\sum_{i=0}^{n-1}|\underline{x}(t_{i+1})-\underline{x}(t_i)|$$
By some applied-maths-intuition nonsense, we get that if we make the differences $t_{i+1}-t_i$ small enough, we are going to approach the length of the curve $C$, independent of the way we approach the limit.
So an applied mathematician will then set
\begin{definition}
    The length $l(C)$ of the curve $C$ is
    $$\lim_{t_{i+1}-t_i\to 0}l(C,P)$$
    which, as that applied mathematician will discover joyfully, equals
    $$\int_{a}^b|\underline{x}^\prime(t)|\,\mathrm dt$$
    Sometimes we write it as
    $$\int_C\mathrm ds$$
\end{definition}
Again by intuition we are gonna write $\mathrm ds=\sqrt{\sum_i\dot{x}_i^2}\mathrm dt=\sqrt{\sum_i\mathrm dx_i^2}$.
\begin{definition}
    We define
    $$\int_Cf\,\mathrm ds=\int_a^bf(\underline{x}(t))|\underline{\dot{x}}(t)|\,\mathrm dt$$
    for smooth curve $C$.
    And for piecewise smooth curve $C=C_1\cup C_2\cup\cdots\cup C_n$, we set
    $$\int_Cf\,\mathrm ds=\sum_{i=1}^n\int_{C_i}f\,\mathrm ds$$
\end{definition}
\begin{example}
    1. Let $C$ be a circle of radius $r>0$, so we can parameterize it by $(r\cos t,r\sin t,0), t\in [0,2\pi]$, and we unsurprisingly find that its length is $2\pi r$.\\
    2. Take $C$ be the same circle as in 1, we have
    $$\int_C x^2y\,\mathrm ds=\int_a^b (r\cos t)^2(r\sin t) r\,\mathrm dt=0$$
\end{example}
\begin{proposition}
    The way we define curve integrals is independent of parameterization.
\end{proposition}
\begin{example}
    If we parameterize the circle as $(r\cos(2t),r\sin(2t),0),t\in [0,\pi]$, we still get the same thing.
\end{example}
\begin{proof}
    Let $\underline{s_1}(t),\underline{s_2}(\tau),t\in[a,b],\tau\in[\alpha,\beta]$ be two different parameterizations of $C$, then there exists a function $\tau\to t(\tau)$ such that $\underline{s_1}(t(\tau))=\underline{s_2}(\tau)$.
    Assume that $\mathrm dt/\mathrm d\tau$ is nonzero and $t(\tau)$ is a differentiable, invertible, and have differentiable inverse, then we have
    $$\underline{s_2}^\prime(\tau)=\frac{\mathrm d\underline{s_1}\circ t}{\mathrm d\tau}=\underline{s_1}^\prime(t)t^\prime(\tau)$$
    If $\mathrm dt/\mathrm d\tau>0$, we have
    $$\int_\alpha^\beta|\underline{s_2}^\prime(\tau)|\,\mathrm d\tau=\int_\alpha^\beta|\underline{s_1}^\prime(t(\tau))|t^\prime(\tau)\,\mathrm d\tau=\int_a^b|\underline{s_1}^\prime(t)|\,\mathrm dt$$
    Similar for other cases.
\end{proof}
We now know the arc length is
$$s(t)=\int_{t_0}^t|\underline{\dot{x}}(u)|\,\mathrm du$$
On a regular curve, $\mathrm ds/\mathrm dt=|\underline{\dot{r}}(t)|>0$, this tells us that we can indeed parameterize each regular curve wrt arc length.
This is done by observing $\mathrm dt/\mathrm ds=1/|\underline{\dot{r}}(t)|$ which means we can write $\underline{r}(s)=\underline{r}(t(s))$, where we have
$$\frac{\mathrm d\underline{r}}{\mathrm ds}=\frac{\underline{\dot{r}}(t)}{|\underline{\dot{r}}(t)|}$$
which is a unit vector.
Therefore,
\begin{lemma}
    Any smooth curve $C$ has a parameterization $\underline{r}(s)$ such that
    $$\left|\frac{\mathrm dr}{\mathrm ds}\right|\equiv 1$$
\end{lemma}
\begin{proof}
    Followed from above.
\end{proof}
\subsection{Curvature and Torsion}
Throughout this section, we are only interested in smooth curves $C$ parameterized by arc length $\underline{r}(s)$.
\begin{definition}
    The tangent vector is defined as $\underline{t}(s)=\underline{r}^\prime(s)$.
\end{definition}
Note that $\underline{t}$ is always unit as it is an arc length parameterization.
\begin{definition}
    The curvature of $\underline{r}(s)$ is defined as $\kappa(s)=|\underline{t}^\prime(s)|=|\underline{r}^{\prime\prime}(s)|$.
\end{definition}
Note that if we differentiate $\underline{t}\cdot\underline{t}=1$, then we have $\underline{t}\cdot\underline{t}^\prime=0$.
This shows that the unit vector in the direction $t^\prime$ has a geometric interpretation as the normal to a curve, so we define
\begin{definition}
    The principal normal $\underline{n}$ is the (unit) vector such that $\underline{t}^\prime=\kappa\underline{n}$.
\end{definition}
Naturally, when we already have a pair of orthonormal vectors in $\mathbb R^3$, adding a third one seems to be the next step to do.
\begin{definition}
    In $\mathbb R^3$, the binormal $\underline{b}$ is defined as $\underline{b}=\underline{t}\times\underline{n}$.
\end{definition}
Then the vectors $\underline{t},\underline{n},\underline{b}$ form an orthonormal basis for $\mathbb R^3$.
Again we have $\underline{b}\cdot\underline{b}^\prime=0$ as $\underline{b}$ is unit.
But we also have $\underline{t}\cdot\underline{b}=0$, we get $\underline{t}\cdot\underline{b}^\prime=0$.
Hence $\underline{n},\underline{b}^\prime$ are parallel.
\begin{definition}
    The torsion $\tau$ is defined as such that $\underline{b}^\prime=-\tau\underline{n}$.
\end{definition}
So we have got there
$$\begin{cases}
    \underline{t}^\prime=\kappa\underline{n}=\kappa(\underline{b}\times\underline{t})\\
    \underline{b}^\prime=-\tau\underline{n}=\tau(\underline{t}\times\underline{b})
\end{cases}$$
Intuitively and truthfully
\begin{proposition}
    The curvature and torsion uniquely defines a curve up to rigid motion.
\end{proposition}
\begin{proof}
    Picard-Lindel\"of Theorem.
\end{proof}
The Taylor expansion of $\underline{r}(t)$ around $0$ shows
$$\underline{r}(s)=\underline{r}(0)+s\underline{t}(0)+\frac{1}{2}s^2\kappa\underline{n}(0)+o(s^2)$$
Now we turn to consider the circle of best fit around $\underline{r_0}$.
Parameterize the circle (with radiu $r$) by and expand to see that the second order term is somewhat like $s^2\underline{n}/(2r)$, so it is natural to define
\begin{definition}
    The radius of curvature is defined as $r=1/\kappa$.
\end{definition}


\problemname{Limbo: Part 2}

\noindent Dominick Cobb and Arthur are ``extractors" who perform corporate espionage. Using experimental military technology that gives them access to shared dream worlds, they infiltrate their targets' subconscious to extract valuable information. Cobb and his entourage are contacted by a mysterious Japanese syndicate and given a seemingly impossible task: instead of extracting information, do the opposite -- plant a new idea in the target's mind.\\

Cobb just figured out how to calculate the slowness of time in each dream level, but he is still missing a vital piece of the plan -- the architecture. For this challenging mission he has hired the brilliant young architect Ariadne to design a dream space, complete with all the aesthetic and tactile details. Cobb's target will be brought into that dream space, where they will fill it with details from their own subconscious and memories.\\

As extractors go into deeper dream levels, the perception of time slows down. This means subjects will be able to explore exponentially more space. Since dreams can go infinitely deep (onwards to Limbo), the architecture of a dream should be infinite in area. The master layout is denoted by a two-dimensional grid that starts at row $0$, column $0$, and extends infinitely downwards and to the right. Ariadne cannot simply draw a map of this space (since it is infinite), so she must come up with a program that "generates" the dream space to extend as large as the team needs to go deeper. She has an infinite number of building blocks, numbered $0, 1, 2, 3, 4, \dots$, which must be used in that order.\\

In dream level $0$ (reality), the dream space consists of the single block $0$. With each deeper dream level, the area of the space doubles. To prevent the dream space from implosion due to growing too narrowly in a single direction, Ariadne has designed the space to double in \textit{alternating directions}, with new blocks filling in the space sequentially based on the direction of doubling. For example, the first few levels of the dream map are depicted as follows:\\

\begin{center}
\begin{minipage}{8cm}
\begin{verbatim}
    0          0 1         0 1       0 1 4 6
                           2 3       2 3 5 7

(Reality)   (Level 1)   (Level 2)   (Level 3)

   0  1  4  6         0  1  4  6 16 20 24 28
   2  3  5  7         2  3  5  7 17 21 25 29
   8  9 10 11         8  9 10 11 18 22 26 30
  12 13 14 15        12 13 14 15 19 23 27 31

   (Level 4)                (Level 5)

\end{verbatim}
\end{minipage}
\end{center}

Ariadne's program must be able to generate any part of the map at will. Given only the row and column coordinates for a particular location in the dream space, can you determine the number of the building block that will be used?

\section*{Input}
The first line of input consists of a single integer $T$ ($1 \leq T \leq 100$), the number of test cases.\\
$T$ lines follow, each of which is a test case consisting of two space-separated integers, $R$ and $C$ ($0 \leq R, C \leq 10^{9}$), specifying a particular row and column in the dream-space.\\

\section*{Output}
For each test case, print, on a separate line, the number of the building block at coordinates $(R, C)$.\\
Note: the answer can be large, and may not necessarily fit in a 32-bit integer.\\


%% This file is part of the CroMagnon project
%% Copyright 2015 David W. Hogg

\documentclass[12pt]{article}
\usepackage{url}
\input{vc}

\newcommand{\like}{L}
\newcommand{\dd}{\mathrm{d}}
\newcommand{\inverse}{^{-1}}
\newcommand{\transpose}{^{\mathsf{T}}}

\begin{document}

\section*{Notes on log-sum-exp%
\footnote{\raggedright This document is available (in source-code form) at \giturl.
This precise version has git hash \texttt{\githash~(\gitdate)}.}}
\noindent
David W. Hogg (NYU) (SCDA) (MPIA)

\bigskip

Generically in probabilistic inference problems we encounter quantities like
\begin{eqnarray}
  Q
  &=& \ln\sum_{k=1}^K\exp q_k
  \quad,
\end{eqnarray}
where the $q_k$ are simple functions (for example, they might have simple
derivatives with respect to parameters $\theta$).
Let's take the full derivative of $Q$:
\begin{eqnarray}
  \frac{\dd Q}{\dd\theta}
  &=& \left[\sum_{k=1}^K\exp q_k\right]\inverse
      \,\frac{\dd}{\dd\theta}\left[\sum_{k=1}^K\exp q_k\right] \\
  &=& \left[\sum_{k=1}^K\exp q_k\right]\inverse
      \,\left[\sum_{k=1}^K\frac{\dd q_k}{\dd\theta}\exp q_k\right]
  \quad;
\end{eqnarray}
that is, the derivative of $Q$ is just the $\exp q_k$-weighted average
of derivatives of the $q_k$.
That's good!

In the particular case of cryo-EM, the objective function is related
to a marginalized likelihood $\like$ which looks like
\begin{eqnarray}
  Q
  &=&
  \sum_{n=1}^N Q_n \\
  Q_n
  &=& -2\,\ln\like_n \\
  &=& -2\,\ln\sum_{k=1}^K P_k\,\exp(\ln\like_{nk}) \\
  &=& -2\,\ln\sum_{k=1}^K P_k\,\exp(-\frac{1}{2}\,\chi^2_{nk}) \\
  \chi^2_{nk}
  &=& [y_n - \mu_{nk}]\transpose\cdot C_n\inverse\cdot [y_n - \mu_{nk}]
  \quad,
\end{eqnarray}
where the sum is over $k$ samples or grid locations in angles and
offets, the $P_k$ are weights for those samples (typically roughly
$1/K$), $y_n$ is the $n$th data point (tiny image), the $\mu_{nk}$ are
the predictions for data point $n$ at angles and offsets $k$, and
$C_n$ is a covariance matrix for the (Gaussian) noise model.
The predictions $\mu_{nk}$ depend on the three-dimensional shape
parameters or representation $\theta$.

Taking derivatives with respect to parameters,
\begin{eqnarray}
  \frac{\dd Q}{\dd\theta}
  &=&
  \sum_{n=1}^N \frac{\dd Q_n}{\dd\theta} \\
  \frac{\dd Q_n}{\dd\theta}
  &=& -2\,\left[\sum_{k=1}^K P_k\,\exp(-\frac{1}{2}\,\chi^2_{nk})\right]\inverse
        \,\left[\sum_{k=1}^K -\frac{1}{2}\,P_k\,\exp(-\frac{1}{2}\,\chi^2_{nk})\,\frac{\dd\chi^2_{nk}}{\dd\theta}\right] \\
  \frac{\dd\chi^2_{nk}}{\dd\theta}
  &=& -2\,[y_n - \mu_{nk}]\transpose\cdot C_n\inverse\cdot\frac{\dd\mu_{nk}}{\dd\theta}
  \quad.
\end{eqnarray}

There is a literature on using the expectation-maximization (E-M)
algorithm to optimize marginalized likelihoods that have the logsumexp
form.
A good pedagogical (but not original) reference is Bishop (2006; ch
9).
The E-M algorithm is clever because it optimizes a marginalized
likelihood of the form of the $Q$ defined above, without ever
explicitly constructing the marginalized likelihood or its
derivatives.
And the proof is beautiful!
Rumors fly, however, that E-M is not the best optimizer for many
real problems (Salakhutdinov 2003a, 2003b), and that if we are willing
to compute the derivatives, we might get to the local optimum faster,
even given the extra cost per iteration.

\begin{trivlist}\raggedright
\item
Bishop,~C., 2006,
\textit{Pattern Recognition and Machine Learning},
Springer-Verlag, New York
{\footnotesize ISBN:978-0-387-31073-2}.
\item
Salakhutdinov,~R., Roweis,~S., \& Ghahramani,~Z., 2003a,
``Optimization with EM and Expectation-Conjugate-Gradient'',
\textit{Proc.~20~ICML},
{\footnotesize \url{http://www.cs.nyu.edu/~roweis/papers/emecgicml03.pdf}}.
\item
Salakhutdinov,~R., Roweis,~S., \& Ghahramani,~Z., 2003b,
``On the Convergence of Bound Optimization Algorithms'',
\textit{Proc.~19~UAI (UAI2003)},
{\footnotesize \url{http://arxiv.org/abs/1212.2490}}.
\end{trivlist}

\end{document}


\section{Algorithms}

\subsection{Cristofeledes algorithm}
Objective: solve TSP with $\frac{3}{2}$-approximation
\begin{enumerate}
    \item Construct an MST
    \item Extract the odd degree vertices
    \item Find a matching, using odd degree vertex from (2)
    \item Combine the edges from the tree with those in the matching
    \item Form a eularian circuit
    \item Short the the traversal path to form a hamiltonian cycle
\end{enumerate}

\subsection{Double-tree algorithm}
2-approximation
\begin{enumerate}
    \item Construct MST
    \item Give each node a redundant entry (graph can now be traversed like
            an~\nameref{eularian} graph)
    \item Traverse the nodes from start to finish (DFS), but only retain the first
        time occurence of a city
\end{enumerate}

\subsection{Dijkstra}
Assign all nodes distance = $\infty$
Start at given node $s$. Assign all neighboring nodes their distance from $s$
to $n$. Proceed to the lowest cost. Repeat. Whenever a better match is found,
use the new path instead. The result is a path from $s$ to $t$, or an MST.\

\subsection{K-center}
2-approximation. A form of clustering.
\begin{enumerate}
    \item Pick arbitrary $i \in V$
    \item $S \rightarrow \left\{i\right\}$
    \item pick other node furthest away from k, add to $S$
    \item repeat, furthest away from all previous picked nodes.
\end{enumerate}

\subsection{Kruskal's algorithm}
Always choose cheapest edge that does not include two pre-discovered nodes.
Returns MST.\

\subsection{Nearest addition}
2-approximation
\begin{enumerate}
    \item Find two closest cities
    \item Traverse from i to j and back
    \item Repeat, consider from each node
\end{enumerate}

\subsection{Prim's algorithm}
Start at a given node $s$. Choose the cheapest edge.
Now repeat, just that you consider $s$ and the node you added. Etc.
Never choose an edge that leads to a pre-discovered vertex.

\subsection{List scheduling algorithm}\label{listschedule}
    Whenever a machine is idle, assign it a job.
    This algorithm runs $\leq 2\times OPT$.

    \begin{proof}
        Note that $OPT = \frac{\sum{p_{i}}}{m}$
        We know that the last job, $l$, starts at time $t$. Since we've always
        assigned jobs whenever we could, that means that all machines have
        so far been busy. Hence we know:
        $$
            t \leq \frac{\sum{p_{j} - p_{l}}}{m} \leq OPT - \frac{p_{l}}{m}
        $$
        Since $OPT$ is lower bounded as the average work done by each machine.

        We can now bound the maximal finishing time:
        $$
            C_{\max} \leq t + p_{l} \leq OPT + p_{l}\times (1 - \frac{1}{m})
            \leq (2 - \frac{1}{m})\times OPT
        $$
    \end{proof}

    \subsection{Longest processing time rule}\label{srpt}
    As~\nameref{listschedule}, just that you first sort the jobs in order of
    length; put the longest jobs first. This algorithm has approximation ratio
    $\frac{4}{3} \times OPT$

    \subsection{Shortest remaining time, SRFT}\label{sprt}
    In this scheduling algorithm, the process with the smallest amount of time
    remaining until completion is selected to execute.
    This algorithm is applied to~\nameref{pre-emptive} schedules

\subsection{Knapsack DP}
    Fill out two arrays of $n \times B$, where $B$ is the capacity of
    the knapsack. In row $i$, consider item $b_{i}$ against the capacity given
    in column $j$. If $j \geq w_{i}$, compare the value of $A_{i,j}$ to
    $A_{i-1,j}$ and use whichever is greater. For all cases where $b_{i} \geq
    j$, consider which is better: to use $b_{i} + A_{i-1,j-w_{i}}$,
    or retain the value above. The last equation is: to use current item +
    whatever we can fit in on the remaining weight, given by the line above.
    Make sure to simeoltaneously maintain a ``keep-array'' that gives 1 or zero,
    indicating whether or not you've used item $b_{i}$.

    In backtracking, start in the lower right of the keep array.
    Whenever you get a 1, include item $i$ and decrement $i$ and $j$ by one.
    Whenever you get a zero, decrement $i$ alone.

    The above mentioned runs in $O(n\times W)$, where $W$ is the capasity of
    the knapsack. The algorithm is \textit{exact}, but pseudopolynomial, since
    $W = \sum{w_{i}}$, which in binary becomes $\log_{2} W$, which hence
    becomes $O(\log_{2}W^{n})$. An~\nameref{FPTAS} exists, see book.