The previous chapter introduced a probabilistic framework that can be used to design algorithms for robot localization and state estimation. The chapter concluded with the introduction of the Bayes filter, which is a fundamental algorithm for maintaining and updating a belief distribution (a probability distribution over possible states). While the Bayes filter is generally intractable to implement in practice, it lays a mathematical foundation for the development of algorithms that can exploit structure or other approximations to generate tractable approaches. One such example is the discrete Bayes filter, which assumes that the number of possible states is finite such that the belief distribution can be represented by simply storing the probability of each state individually. This type of distribution is referred to as \textit{non-parametric} since the belief distribution is not required to have a particular structure.

Alternatively, it is possible to develop tractable algorithms for probabilistic localization and state estimation by leveraging \textit{parametric} belief distributions. Parametric distributions are distributions that are fully specified by a fixed number of parameters, for example Gaussian distributions are defined by the mean and covariance parameters. These \textit{parametric filters} can generally be viewed as practical implementations of Bayes filter that exploit structure for efficiency, and include the Kalman filter family of algorithms.

\notessection{Parametric Filters}
Parametric filters\cite{ThrunBurgardEtAl2005} are a family of algorithms for robot localization and state estimation that model the robot's belief with parametric distributions. Therefore, as the robot's state evolves and new measurement information arrives, updating the belief distribution is accomplished by simply updating the parameters that define the distribution. This can lead to practically implementable algorithms since the number of parameters is generally not too large. For example, a Gaussian distribution in one dimension only requires the specification of two parameters: the mean and standard deviation. Yet with these two parameters a probability distribution is defined over an infinite number of values! This is an example of how parametric filters exploit structure for efficiency.

\subsection{Gaussian Distribution}
The Gaussian distribution (also referred to as a normal distribution) is likely the most commonly used parametric distribution in many disciplines, including robotics. The probability density function for a one-dimensional (univariate) Gaussian distribution is given by:
\begin{equation}
p(x) = \frac{1}{\sqrt{2\pi \sigma^2}} e^{-\frac{1}{2}\frac{(x-\mu)^2}{\sigma^2}},
\end{equation}
where the parameters are the mean $\mu$ and standard deviation $\sigma$ (the quantity $\sigma^2$ is referred to as the variance). A shorthand notation for saying that a random variable $X$ is distributed according to a Gaussian (normal) distribution is $X \sim \mathcal{N}(\mu,\sigma^2)$.
For the multi-dimensional case, the multivariate Gaussian distribution is defined by the probability density function:
\begin{equation}
p(\x) = \frac{1}{\sqrt{\text{det}(2\pi \bSigma)}} \text{exp}\big( -\frac{1}{2}(\x-\bmu)^\top  \bSigma^{-1} (\x-\bmu) \big),
\end{equation}
where $\x\in \R^n$ and the parameters are the mean $\bmu \in \R^n$ and the covariance matrix $\bSigma \in \R^{n \times n}$. Again, a shorthand to say a random variable $X$ is distributed according to the multivariate Gaussian distribution is $X \sim \mathcal{N}(\bmu,\bSigma)$. These distributions are represented graphically for the univariate and bivariate case in Figure \ref{fig:Gaussians}.
\begin{figure}[ht]
\centering
\includegraphics[width=.85\textwidth]{tex/figs/ch14_figs/gaussians.png}
\caption{Univariate and multivariate Gaussian distributions.}
\label{fig:Gaussians}
\end{figure}
These distributions exhibit several important properties which make them particularly attractive for algorithm development:
\begin{enumerate}
    \item The affine transformation of a Gaussian random variable is also a Gaussian random variable. In particular, suppose the random variable $X$ has a multivariate Gaussian distribution with mean $\bmu$ and covariance $\bSigma$. Then the random variable $Y$ resulting from an affine transformation:
    \begin{equation*}
        Y = AX + b,
    \end{equation*}
    also has a multivariate Gaussian distribution with expected value $A\bmu + b$ and covariance $A\bSigma A^\top $. In other words, if $X \sim \mathcal{N}(\bmu, \bSigma)$ then $Y \sim \mathcal{N}(A\bmu+b, A\bSigma A^\top )$.
    \item The sum of two independent Gaussian random variables is also a Gaussian random variable. In particular, suppose $X_1$ and $X_2$ have multivariate Gaussian distributions with means $\bmu_1$ and $\bmu_2$ and covariances $\bSigma_1$ and $\bSigma_2$. Then the random variable $Y$ given by the sum:
    \begin{equation*}
        Y = X_1 + X_2,
    \end{equation*}
    also has a multivariate Gaussian distribution with expected value $\bmu_1 + \bmu_2$ and covariance $\bSigma_1 + \bSigma_2$. In other words, if $X_1 \sim \mathcal{N}(\bmu_1, \bSigma_1)$ and $X_2 \sim \mathcal{N}(\bmu_2, \bSigma_2)$ then $Y \sim \mathcal{N}(\bmu_1 + \bmu_2, \bSigma_1 + \bSigma_2)$.
    \item The product of two Gaussian random variables is also a Gaussian random variable.
\end{enumerate}

\subsection{Kalman Filter}
The Kalman filter is an extremely well known algorithm for state estimation that leverages the Gaussian distribution for efficiency. Unlike the discrete Bayes filter from the previous chapter, this filter can be applied to problems with \textit{continuous} states.
In particular, a multivariate Gaussian distribution is used to parameterize the belief distribution over possible states, in other words the state $\x_t \sim \mathcal{N}(\bmu_t, \bSigma_t)$, and in long form this can be expressed as:
\begin{equation*}
bel(\x_t) = p(\x_t) = \frac{1}{\sqrt{\text{det}(2\pi \bSigma_t)}} \text{exp}\big( -\frac{1}{2}(\x_t-\bmu_t)^\top  \bSigma_t^{-1} (\x_t-\bmu_t) \big).
\end{equation*}

\subsubsection{Assumptions}
To ensure that the belief \textit{remains} Gaussian after the prediction and measurement update steps of the filtering algorithm, several additional assumptions are required.
First, it is assumed that the initial belief $bel(\x_0)$ is Gaussian with $\x_0 \sim \mathcal{N}(\bmu_0, \bSigma_0)$ and that the state transition model is linear and is given by:
\begin{equation} \label{eq:KFdynamics}
    \x_t = A_t \x_{t-1} + B_t \bu_t + \bm{\epsilon}_t,
\end{equation}
where $\x_{t-1}$ is the previous state, $\bu_t$ is the most recent control input, and $\bm{\epsilon}_{t}$ is an independent \textit{process noise} that is normally distributed with $\bm{\epsilon}_t \sim \mathcal{N}(\bm{0},\bm{R}_t)$.
Because of the properties of the Gaussian distribution presented earlier, this affine model preserves the Gaussian structure. In particular, the state transition model can be explicitly written as:
\begin{equation*}
p(\x_t \mid \x_{t-1}, \bu_t) = \frac{1}{\sqrt{\text{det}(2\pi \bm{R}_t)}} \text{exp}\big( -\frac{1}{2}(\x_t-A_t \x_{t-1} - B_t \bu_t)^\top  \bm{R}_t^{-1} (\x_t-A_t \x_{t-1} - B_t \bu_t) \big).
\end{equation*}
In other words, this can be expressed in shorthand as $\x_t \sim \mathcal{N}(A_t \x_{t-1} + B_t \bu_t, \bm{R}_t)$.

Second, the measurement model is also assumed to be linear, which again preserves the Gaussian structure:
\begin{equation} \label{eq:measure}
\z_t = C_t \x_t + \bm{\delta}_t,
\end{equation}
where $\bm{\delta}_t$ is an independent measurement noise that is normally distributed with $\mathcal{N}(\bm{0},\bm{Q}_t)$.
Again, this implies the measurement model can be expressed probabilistically as:
\begin{equation*}
p(\z_t \mid \x_t) = \frac{1}{\sqrt{\text{det}(2\pi \bm{Q}_t)}} \text{exp}\big( -\frac{1}{2}(\z_t-C_t\x_t)^\top  \bm{Q}_t^{-1} (\z_t-C_t\x_t) \big),
\end{equation*}
and in shorthand as $\z_t \sim \mathcal{N}(C_t \x_{t}, \bm{Q}_t)$.

To summarize, if the belief is modeled as a Gaussian distribution and the state transition and measurement models are both linear with Gaussian noise, then the Bayes filter updates can be applied and the belief will always remain Gaussian (i.e. the prediction and measurement correction steps will not warp or alter the \textit{structure} of the belief distribution)! This results in a very practically efficient algorithm since now only the parameters $\bmu$ and $\bSigma$ need to be updated by the algorithm.

\subsubsection{Algorithm}
The Kalman filter algorithm is a recursive Bayes filter whose prediction and measurement correction steps take on a special form due to the structure of the Gaussian belief distributions and the assumptions listed above.
In particular, the Kalman filter algorithm is given in Algorithm \ref{alg:KF}.

\begin{algorithm}[ht]
 \KwData{$\bmu_{t-1}, \bSigma_{t-1}, \bu_{t},\z_{t}$}
 \KwResult{$\bmu_t, \bSigma_t$}
 $\bar{\bmu}_t = A_t\bmu_{t-1}+B_t \bu_t$\\
 $\bar{\bSigma}_t = A_t\bSigma_{t-1} A_t^{T} + \bm{R}_t$\\
 $K_t = \bar{\bSigma}_{t}C_t^{T}(C_t\bar{\bSigma}_{t}C_t^{T}+\bm{Q}_t)^{-1}$\\
 $\bmu_t = \bar{\bmu}_t + K_t(\z_t-C_t\bar\bmu_{t})$\\
 $\bSigma_t = (I-K_tC_t )\bar{\bSigma}_t$\\
 \Return $\bmu_t, \bSigma_t$
 \caption{Kalman Filter Algorithm}
 \label{alg:KF}
\end{algorithm}
In this algorithm, the first two steps define the predicted mean $\bar{\bmu}_t$ and covariance $\bar{\bSigma}_t$, and the remaining steps perform the measurement correction. The matrix $K_t$ that is computed for the measurement correction is typically referred to as the \textit{Kalman gain}.

\subsubsection{Practical Considerations}
Due to the exploitation of the Gaussian distribution, the Kalman filter is a computationally efficient algorithm that can handle continuous state values. However, the consideration of Gaussian beliefs also restricts the flexibility of the probabilistic model. In particular, the belief is forced to be unimodal which may limit performance. Additionally, the assumption about the linearity of the state transition and measurement models may not be very accurate for some robots and certain sensors, which can make the Kalman filter not perform well for some robotics applications.

\subsubsection{Derivation}
While it is possible to derive the Kalman filter algorithm by evaluating the Bayes filter updates from the previous chapter (i.e. computing the integral of $p(\x_t \mid \x_{t-1}, \bu_t) p(\x_{t-1}$, etc.), it is more intuitive to directly leverage the properties of Gaussians presented in the preceding section. First, from the prior belief distribution $bel(\x_{t-1}) \sim \mathcal{N}(\bmu_{t-1},\bSigma_{t-1})$ the predicted belief $\overline{bel}(\x_{t-1})$ can be computed by using the affine transformation property of Gaussian random variables and the sum of two independent Gaussian random variables property. Specifically, these properties can be applied to the assumed linear state transition model \eqref{eq:KFdynamics} to give:
\begin{equation*}
\begin{split}
\bar{\bmu}_t &= A_t \bmu_{t-1} + B_t\bar{\bu}_t + \bm{0}, \\
\end{split}
\end{equation*}
where the $\bm{0}$ is the mean of the independent noise $\bm{\epsilon}_t \sim \mathcal{N}(\bm{0},\bm{R}_t)$. The covariance properties can similarly be used to give:
\begin{equation*}
\begin{split}
\bar{\bSigma}_t &= A_t \bSigma_{t-1}A_t^\top  + \bm{R}_t. \\
\end{split}
\end{equation*}

For the measurement update it is possible to again use the properties of Gaussians to simplify the derivation of the Kalman filter measurement correction step. In particular, that the product of two Gaussians is also Gaussian. In fact, the product of the two Gaussians:
\begin{equation*}
\begin{split}
bel(x_t) = p(\z_t \mid \x_t)\overline{bel}(\x_t) &= \mathcal{N}(C_t\x_t,\bm{Q}_t) \mathcal{N}(\bar{\bmu}_{t},\bar{\bSigma}_{t}), \\
\end{split}
\end{equation*}
can be expressed as:
\begin{equation*}
\begin{split}
bel(x_t) = \eta\: \text{exp}\big(-\frac{1}2 J_t \big),
\end{split}
\end{equation*}
where $\eta$ is a normalization constant and:
\begin{equation*}
    J_t = (\z_t-C_t\x_t)^\top  \bm{Q}_t^{-1} (\z_t-C_t\x_t) + (\x_t-\bar{\bmu}_t)^\top  \bar{\bSigma}_t^{-1} (\x_t-\bar{\bmu}_t).
\end{equation*}
To determine the mean $\bmu_t$ and covariance $\bSigma_t$ of this new Gaussian, one simple approach is just take the first and second derivative of $J_t$ with respect to $\x_t$. The mean is found where the first derivative is zero, and the covariance is the (inverse) of the constant second derivative:
\begin{equation*}
\begin{split}
0 &= -C_t^\top  \bm{Q}_t^{-1}(\z_t - C_t \bmu_t) + \bar{\bSigma}_t^{-1}(\bmu_t - \bar{\bmu}_t), \\
\bSigma_t^{-1} &= C_t^\top  \bm{Q}_t^{-1} C_t + \bar{\bSigma}_t^{-1}.
\end{split}
\end{equation*}
Through some algebraic manipulation the mean can be written in terms of the covariance $\bSigma_t$:
\begin{equation*}
\begin{split}
\bmu_t &= \bar{\bmu}_t + \bSigma_t C_t^\top  \bm{Q}_t^{-1}(\z_t - C_t \bar{\bmu}_t), \\
\end{split}
\end{equation*}
and of course the covariance can be written as:
\begin{equation*}
\begin{split}
\bSigma_t &= (C_t^\top  \bm{Q}_t^{-1} C_t + \bar{\bSigma}_t^{-1})^{-1}.
\end{split}
\end{equation*}
While it is technically possible to stop here, this is not quite the form of the Kalman filter equations. In particular a few more algebraic steps are needed, based on the matrix inversion lemma result:
\begin{equation*}
(C_t^\top  \bm{Q}_t^{-1} C_t + \bar{\bSigma}_t^{-1})^{-1} = \bar{\bSigma}_t - \bar{\bSigma}_tC_t^\top (C_t\bar{\bSigma}_tC_t^\top  + \bm{Q}_t)^{-1}C_t\bar{\bSigma}_t.
\end{equation*}
By choosing to define the Kalman gain as $K_t = \bar{\bSigma}_{t}C_t^{T}(C_t\bar{\bSigma}_{t}C_t^{T}+\bm{Q}_t)^{-1}$ it can be seen that the covariance can be expressed as:
\begin{equation*}
\begin{split}
\bSigma_t &= \bar{\bSigma}_t - K_tC_t\bar{\bSigma}_t,
\end{split}
\end{equation*}
Through some additional algebra, the expression for the mean can also be expressed in terms of the Kalman gain and simplified to its final form:
\begin{equation*}
\bmu_t = \bar{\bmu}_t + K_t(\z_t-C_t\bar\bmu_{t}).
\end{equation*}
For more details on the algebraic steps see Thrun et al.\cite{ThrunBurgardEtAl2005}.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Extended Kalman Filter (EKF)}
The extended Kalman filter (EKF) is a modified version of the Kalman filter that revisits the assumption of linearity for the state transition and measurement models. This extension still exploits the Gaussian distribution to represent the belief in a computationally efficient parametric way, but by generalizing to more complex models the EKF can be applied to a wider variety of robotics state estimation and localization problems. In particular, the EKF considers general nonlinear state transition and measurement models defined as:
\begin{equation}
\begin{split}
\x_t &= g(\bu_t, \x_{t-1}) + \bm{\epsilon}_{t}, \\
\z_t &= h(\x_t) + \bm{\delta}_{t},
\end{split}
\end{equation}
where again $\bm{\epsilon}_{t}\sim \mathcal{N}(\bm{0},\bm{R}_t)$ and $\bm{\delta}_{t}\sim \mathcal{N}(\bm{0},\bm{Q}_t)$ are normally distributed noise terms.

The EKF handles these nonlinear functions by taking advantage of their first order Taylor series expansions (which are linear functions, similar to those used in the Kalman filter). In particular the Taylor series expansion of the state transition model $g$ is performed about the \textit{most likely state} from the current belief distribution, which is the expected value $\bmu_{t-1}$:
\begin{equation*}
\begin{split}
g(\bu_t, \x_{t-1}) &\approx g(\bu_t, \bmu_{t-1}) + G_t (\x_{t-1}-\bmu_{t-1}), \\
\end{split}
\end{equation*}
where $G_t = \nabla_{\x} g(\bu_t, \bmu_{t-1})$ is the Jacobian of $g$ evaluated at $\bmu_{t-1}$. From this linear approximation the state transition model can be expressed as:
\begin{equation*}
p(\x_t \mid \x_{t-1}, \bu_t) = \frac{1}{\sqrt{\text{det}(2\pi \bm{R}_t)}} \text{exp}\big( -\frac{1}{2}\Delta \x_t^\top  \bm{R}_t^{-1} \Delta \x_t \big),
\end{equation*}
where
\begin{equation*}
\Delta \x_t = \x_t-g(\bu_t, \bmu_{t-1}) - G_t (\x_{t-1}-\bmu_{t-1}).
\end{equation*}
From this result, the linear predictions that are used in the Kalman filter algorithm can be replaced by the nonlinear generalizations:
\begin{equation*}
\begin{split}
\bar{\bmu}_t &= g(\bu_t,\bmu_{t-1}), \\
\bar{\bSigma}_t &= G_t\bSigma_{t-1} G_t^{T} + \bm{R}_t.
\end{split}
\end{equation*}
As can be seen the prediction of the new mean is simply an evaluation of the nonlinear function $g$, and the updated covariance is very similar to the Kalman filter but leverages the Jacobian $G_t$.

A very similar procedure is used for the measurement corrections. The measurement model is also Taylor series expanded to yield (this time about the \textit{predicted} point $\bar{\bmu}_t$):
\begin{equation*}
\begin{split}
h(\x_t) \approx h(\bar{\bmu}_t) + H_t (\x_{t}-\bar{\bmu}_{t}), \\
\end{split}
\end{equation*}
where $H_t = \nabla_{\x} h(\bar{\bmu}_{t})$ is the Jacobian of $h$ evaluated at $\bar{\bmu}_{t}$. The measurement model can then be expressed using this approximation as:
\begin{equation*}
p(\z_t \mid \x_t) = \frac{1}{\sqrt{\text{det}(2\pi \bm{Q}_t)}} \text{exp}\big( -\frac{1}{2}\Delta \z_t^\top  \bm{Q}_t^{-1} \Delta \z_t \big),
\end{equation*}
where $\Delta \z_t = \z_t-h(\bar{\bmu}_t) - H_t (\x_{t}-\bar{\bmu}_{t})$. From this result the measurement correction in the EKF can be shown to be similar to the Kalman filter, but where the Jacobians $H_t$ are used:
\begin{equation*}
\begin{split}
\bmu_t &= \bar{\bmu}_t + K_t(\z_t - h(\bar{\bmu}_{t})), \\
\bSigma_t &= (I - K_t H_t)\bar{\bSigma}_t,
\end{split}
\end{equation*}
where the Kalman gain is $K_t = \bar{\bSigma}_{t}H_t^{T}(H_t\bar{\bSigma}_{t}H_t^{T}+\bm{Q}_t)^{-1}$.

\subsubsection{Algorithm}
The extended Kalman filter algorithm is quite similar to the Kalman filter algorithm outlined in Algorithm \ref{alg:KF}. In particular the main differences are that the updates use the nonlinear functions and their Jacobians rather than assuming strictly linear models. The EKF algorithm is outlined in Algorithm \ref{alg:ekf}.
\begin{algorithm}[ht]
 \KwData{$\bmu_{t-1}, \bSigma_{t-1}, \bu_{t},\z_{t}$}
 \KwResult{$\bmu_t, \bSigma_t$}
 $\bar{\bmu}_t = g(\bu_t,\bmu_{t-1})$\\
 $\bar{\bSigma}_t = G_t\bSigma_{t-1} G_t^{T} + \bm{R}_t$\\
 $K_t = \bar{\bSigma}_{t}H_t^{T}(H_t\bar{\bSigma}_{t}H_t^{T}+\bm{Q}_t)^{-1}$\\
 $\bmu_t = \bar{\bmu}_t + K_t(\z_t - h(\bar{\bmu}_{t}))$\\
 $\bSigma_t = (I - K_t H_t)\bar{\bSigma}_t$\\
 \Return $\bmu_t, \bSigma_t$
 \caption{Extended Kalman Filter Algorithm}
 \label{alg:ekf}
\end{algorithm}

\subsubsection{Practical Considerations}
The extended Kalman filter can provide more accurate results than the Kalman filter in many applications due to its ability to consider more general nonlinear models. However, the approximation of the nonlinear models by a Taylor series expansion can lead to the filter to diverge if the approximation is not accurate enough.
Additionally, the EKF still suffers from the same unimodal modeling assumption as the Kalman filter since the beliefs are still represented by a single Gaussian distribution.

\subsection{Unscented Kalman Filter}
The unscented Kalman filter (UKF) is another variation of the Kalman filter (still uses Gaussian distribution to parameterize the belief). This filter is also similar to the EKF in that it can handle nonlinear state transition and measurement models. However, this filter improves upon the EKF by not relying on Taylor series expansions, which can cause filter divergence due to approximation errors.
This is accomplished by representing the Gaussian through a set of \textit{sigma-points} that are transformed through the nonlinear functions. Once each sigma-point has been updated, a new Gaussian distribution is computed to represent the updated belief.

\subsection{Exercises}
\subsubsection{EKF Localization}
Complete \textit{Problem 1: EKF Localization} located in the online repository:

\vspace{\baselineskip}

\url{https://github.com/PrinciplesofRobotAutonomy/AA274A_HW4},

\vspace{\baselineskip}

where you will implement an EKF for robot localization based on linear feature extraction and a map of known features.


\chapter{Complex Analysis}
A simple algebraic equation like $x^{2}=-1$ may not have a real solution. Introducing complex numbers validates the existence of 'root' for every polynomial with a positive degree . Which then proves the fundamental theorem of algebra. The idea of complex numbers are widely used in Physics and Mathematics.
\begin{definition}
	A number of the form {${x+i y}$} , where $x$ and $y$ are real numbers and $i=\sqrt{(-1)},$ is called a complex number.
\end{definition}
	\textbf{\large Real Part\ \hspace{1.08cm}:} $x$ is called the real part of the complex number,  $x+i y$ and is written as,\ ${{R(x+i y)}}$.\\\\
	\textbf{\large Imaginary Part\ :} $y$ is called the imaginary part of the complex number and is written as,\ ${I(x+i y)}$.
	\section{Representation of a Complex number}
The point whose cartesian coordinates are $(x, y)$ uniquely
represents the complex number, {${z=x+i y}$} on the complex plane $z$. The diagram in which this representation is carried out is called the Argand's diagram. It's shown in the figure \ref{Argand Diagram}.  Since $x$ is the real part of $z$ we call the $x$ -axis the real axis. Likewise, the $y$ -axis is the imaginary axis.

		\begin{figure}[H]
				\begin{center}
			\includegraphics[width=0.30\textwidth]{cn1}
				\end{center}
			\caption{Argand Diagram}
			\label{Argand Diagram}
	    \end{figure}
    In terms of the polar coordinates  , we have
    \begin{align}
    x&=r \cos \theta, \quad y=r \sin \theta\\
    z&=x+\text { iy }=re^{i\theta} \notag \\&=r(\cos \theta+i \sin \theta)
    \label{Euler's equation}
    \end{align}
    Then, the  equation \ref{Euler's equation} is known as, Euler's formula
    \begin{figure}[H]
    	\begin{minipage}{0.40\textwidth}
    		\begin{center}
    		\includegraphics[width=0.70\textwidth]{cn2}
    	\end{center}
    	\end{minipage}\hfil
    	\begin{minipage}{0.40\textwidth}
    	\begin{center}
    		\includegraphics[width=0.70\textwidth]{cn3}
    	\end{center}
    \end{minipage}

    \caption{Polar representation}
    \end{figure}
   \subsection{Absolute Value}
    We define the absolute value of a complex number $x+i y$ to be the length ${r}$ of the vector from the origin to $P(x, y)$.
    $$
    r=|x+i y|=\sqrt{x^{2}+y^{2}}
    $$
    \\\textbf{Properties:}
    \begin{itemize}
    	\item $\left|z_{1}+z_{2}\right| \leq\left|z_{1}\right|+\left|z_{2}\right|$
    	\item $\left|z_{1}-z_{2}\right| \geq\left|z_{1}\right|-\left|z_{2}\right|$
    	\item $\left|z_{1} z_{2}\right|=\left|z_{1}\right|\left|z_{2}\right|$
    	\item $\left|\frac{z_{1}}{z_{2}}\right|=\frac{\left|z_{1}\right|}{\left|z_{2}\right|}$
    \end{itemize}
    \subsection{Argument of }
    The polar angle $\theta$ is called the {argument} of $z$ and it is written as, $${\theta=\arg z }$$ Any integer multiple of $2 \pi$ may be added to $\theta$ to produce another appropriate  angle.\\From the figure \ref{Argand Diagram},
    $${\theta=\arg z }=\tan ^{-1}\left(\frac{y}{x}\right)$$
    \\\textbf{Properties:}
    \begin{itemize}
    	\item $\operatorname{Arg}\left(z_{1}  z_{2} \cdot z_{3} \ldots \ldots z_{n}\right)=\operatorname{Arg} \left(z_{1}\right)+\operatorname{Arg}  \left(z_{2}\right)+\operatorname{Arg}  \left(z_{3}\right)+\ldots \ldots . .+\operatorname{Arg}\left(z_{n}\right)$
    	\item $\operatorname{Arg}\left(\frac{z_{1}}{z_{2}}\right)=\operatorname{Arg}\left(z_{1}\right)-\operatorname{Arg}\left(z_{2}\right)$
    \end{itemize}
\begin{exercise}
	Find the modulus and principal argument of the complex number
	$\frac{1+2 i}{1-(1-i)^{2}}$
\end{exercise}
\begin{answer}
	\begin{align*}
	\frac{1+2 i}{1-(1-i)^{2}}&=\frac{1+2 i}{1-(1-1-2 i)}=\frac{1+2 i}{1+2 i}\\&=1=1+0 i \\
	\therefore \quad\left|\frac{1+2 i}{1-(1-i)^{2}}\right|&=|1+0 i|=\sqrt{1^{2}}=1\\
	\text{Principal argument of}\ \frac{1+2 i}{1-(1-i)^{2}}&= \text{Principal argument of} \quad \left( 1+0 i\right) \\
	\tan ^{-1} \frac{0}{1}&=\tan ^{-1} 0\\&=0^{\circ}
	\end{align*}
\end{answer}
     \subsection{Conjugate of a Complex number}
	The conjugate of a complex number $z$ is represented by, $${\bar{z}=x-i y}$$
	\begin{note}\newline
	$ \left. \right. $ \hspace{1.5cm}
	$\begin{aligned}
		\frac{z + \bar{z}}{2}&=Re\left\lbrace z\right\rbrace \\
		\frac{z - \bar{z}}{2i}&=Im\left\lbrace z\right\rbrace\\
		z \cdot \bar{z}&=|z|^{2}
		\end{aligned}$
	\end{note}
\section{Algebra of Complex numbers}
For two Complex numbers, $a+i b$ and $c+i d $
\subsubsection{Equality:}
	\begin{align*}
	a+i b&=c+i d \quad
	\end{align*}
	Two complex numbers $(a, b)$
 and $(c, d)$ are equal if and only $a=c$ and $b=d$.
 \subsubsection{Addition:}
 \begin{align*}
 (a+i b)+(c+i d) \quad&=(a+c)+i(b+d) \quad
 \end{align*}
 \subsubsection{Multiplication:} \begin{align*}
 (a+i b)(c+i d) &=(a c-b d)+i(a d+b c) \\
 c(a+i b)&=a c+i(b c)
 \end{align*}
 \textbf{Polar form:}
 \begin{align*}
 \text{Let,} \quad z_{1}&=r_{1}\left(\cos \theta_{1}+i \sin \theta_{1}\right) \quad \text{and}\quad z_{2}=r_{2}\left(\cos \theta_{2}+i \sin \theta_{2}\right)\\
 z_{1} . z_{2} &=r_{1} r_{2}\left(\cos \theta_{1}+i \sin \theta_{1}\right)\left(\cos \theta_{2}+i \sin \theta_{2}\right) \\ &=r_{1} r_{2}\left[\cos \theta_{1} \cos \theta_{2}-\sin \theta_{1} \sin \theta_{2}+i\left(\sin \theta_{1} \cos \theta_{2}+\cos \theta_{1} \sin \theta_{2}\right)\right] \\ &=r_{1} r_{1}\left[\cos \left(\theta_{1}+\theta_{2}\right)+i \sin \left(\theta_{1}+\theta_{2}\right)\right], \end{align*}

 \subsubsection{Division:}\begin{align*}
 \frac{c+i d}{a+i b}&=\frac{(c+i d)(a-i b)}{(a+i b)(a-i b)}\\&=\frac{(a c+b d)+i(a d-b c)}{a^{2}+b^{2}}\\
 \text{Where,}\quad x&=\frac{a c+b d}{a^{2}+b^{2}},\quad \text{and} \quad y=\frac{a d-b c}{a^{2}+b^{2}}
 \end{align*}

\section{Important Identities}
\subsection{Circular functions of Complex numbers}

\begin{align*}
	\bullet\quad\sin \theta=\frac{e^{i \theta}-e^{-i \theta}}{2 i}\quad\bullet&\quad\cos \theta=\frac{e^{i \theta}+e^{-i \theta}}{2}\\\\
\bullet\quad\sin z=\frac{e^{i z}-e^{-i z}}{2 i}\quad\bullet&\quad\cos z=\frac{e^{i z}+e^{-i z}}{2}
\end{align*}

\subsection{Hyperbolic functions of Complex numbers}
\begin{alignat*}{2}
&\bullet\quad \sinh x=\frac{e^{x}-e^{-x}}{2}\quad&&\bullet\quad \cosh x=\frac{e^{x}+e^{-x}}{2}\\
&\bullet\quad\tanh x=\frac{e^{x}-e^{-x}}{e^{x}+e^{-x}}\quad&&\bullet \quad {\coth} x=\frac{e^{x}+e^{-x}}{e^{x}-e^{-x}}
\\
&\bullet\quad{\operatorname{sech}} x=\frac{2}{e^{x}+e^{-x}} \quad&&\bullet \quad {\operatorname{cosech}} x=\frac{2}{e^{x}-e^{-x}}\\
&\bullet\quad\cosh x+\sinh x=\frac{e^{x}+e^{-x}}{2}+\frac{e^{x}-e^{-x}}{2}=e^{x} \quad&& \quad
\end{alignat*}
\begin{note}
\textbf{\textbf{Relation between Circular and Hyperbolic functions:}}\\\\
$\begin{array}{ll}\bullet\quad\sin i x=i \sinh x & \bullet\quad \sinh i x=i \sin x \\ \bullet\quad\cos i x=\cosh x & \bullet\quad \cosh i x=\cos x \\ \bullet\quad\tan i x=i \tanh x& \bullet\quad \tanh i x=i \tan x\end{array}$

\end{note}

\begin{theorem}
	\textbf{De Moivre's Theorem:}
	\begin{enumerate}
		\item For any integer $n,$ $(\cos \theta+i \sin \theta)^{n}=\cos n \theta+i \sin n \theta$
		\item 	If $n$ is a fraction, then $(\cos n \theta+i \sin n \theta)$ is one of the values .
	\end{enumerate}
\end{theorem}
\begin{exercise}
  Express $\frac{(\cos \theta+i \sin \theta)^{8}}{(\sin \theta+i \cos \theta)^{4}}$ in the form $(x+i y)$
\end{exercise}
\begin{answer}
	$$
	\begin{aligned}
	\frac{(\cos \theta+i \sin \theta)^{8}}{(\sin \theta+i \cos \theta)^{4}}=&\frac{(\cos \theta+i \sin \theta)^{8}}{(i)^{4}\left(\cos \theta+\frac{1}{i} \sin \theta\right)^{4}} \\
	=& \frac{(\cos \theta+i \sin \theta)^{8}}{(\cos \theta-i \sin \theta)^{4}}=\frac{(\cos \theta+i \sin \theta)^{8}}{[\cos (-\theta)+i \sin (-\theta)]^{4}} \\
	=& \frac{(\cos \theta+i \sin \theta)^{8}}{\left[(\cos \theta+i \sin \theta)^{-1}\right]^{4}}=\frac{(\cos \theta+i \sin \theta)^{8}}{(\cos \theta+i \sin \theta)^{-4}}=(\cos \theta+i \sin \theta)^{12} \\
	=& \cos 12 \theta+i \sin 12 \theta
	\end{aligned}
	$$
\end{answer}
\begin{note}
	Series expansion of different functions
	\begin{align*}
	e^{x}&=1+x+\frac{x^{2}}{2 !}+\frac{x^{3}}{3 !}+\frac{x^{4}}{4 !}+\ldots \\
	\sin x&=x-\frac{x^{3}}{3 !}+\frac{x^{5}}{5 !}-\frac{x^{7}}{7 !}+\ldots \\
	\cos x&=1-\frac{x^{2}}{2 !}+\frac{x^{4}}{4 !}-\frac{x^{6}}{6 !}+\ldots \\
	\tan x&=x+\frac{x^{3}}{3}+\frac{2 x^{5}}{15}+\frac{17 x^{7}}{315}+\frac{62 x^{9}}{2835} +\cdots\\
	\ln (1+x)&=x-\frac{x^{2}}{2}+\frac{x^{3}}{3}-\frac{x^{4}}{4}+\ldots \\
    \tan ^{-1}(x)&=x-\frac{x^{3}}{3}+\frac{x^{5}}{5}-\frac{x^{7}}{7}+\ldots
	\end{align*}
	\end{note}
	\section{Function of a Complex Variable}
	\subsection{Basic Representation}
	\begin{align*}
	W&=f(z)=v(x, y)+i v(x, y)\hspace{4cm}\text{Real part (u)},\left(x^{2}-y^{2}\right)^{2}\\
	f(z)&=z^{2}=(x+i y)^{2}=\left(x^{2}-y^{2}\right)^{2}+i 2 x y\hspace{3cm}\text{Imaginary part (v)}, 2 x y
	\end{align*}
\subsection{Existance of $\lim _{z \rightarrow z_{0}} f(z)$ :}
		The limit will exists only if the limiting value is independent of the path along which $z$ approaches $z_0$
	\begin{exercise}
		Find whether the limit $\lim _{z \rightarrow 0} \frac{z}{|z|}$ exist or not.
	\end{exercise}
	\begin{answer}
		\begin{align*}
		z \rightarrow 0\text{ means }&x \rightarrow 0 \& y \rightarrow 0\\
		\text{	For }\mathrm{z}&=0,\text{ we have to choose a path passing through a origin.}
	\intertext{	Therefore, we have choosen a straight line passing through the origin i.e. $y=m x$}
		\lim _{z \rightarrow 0} \frac{z}{|z|}&=\lim _{\substack{z \rightarrow 0 \\ y \rightarrow 0}} \frac{x+i y}{\sqrt{x^{2}+y^{2}}}=\lim _{x \rightarrow 0} \frac{x+i m x}{\sqrt{x^{2}+m^{2} x^{2}}}=\frac{1+i m}{\sqrt{1+m^{2}}}
		\intertext{Therefore, the limit depends on m i.e. slope of the straight line. Thus, the limiting values is dependent on the path and the limit does not exists.}
		\end{align*}
	\end{answer}
	\begin{exercise}
		Calculate the vahue $\lim _{z \rightarrow \infty} \frac{i z^{3}+i z-1}{(2 z+3 i)(z-i)^{2}}$
	\end{exercise}
	\begin{answer}
		\begin{align*}
		\lim _{z \rightarrow \infty} \frac{i z^{3}+i z-1}{(2 z+3 i)(z-i)^{2}}=\lim _{z \rightarrow \infty} \frac{z^{3}\left(i+\frac{i}{z^{2}}-\frac{1}{z^{3}}\right)}{z\left(2+\frac{3 i}{z}\right) z^{2}\left(1-\frac{i}{z}\right)^{2}}=\frac{i}{2}
		\end{align*}
	\end{answer}
	\subsection{Differentiability of Complex Function}
	\begin{align*}
	\mathrm{f}^{\prime}(\mathrm{z})&=\underset{\delta \mathrm{z} \rightarrow 0}{\mathrm{Lt}} \frac{[\mathrm{f}(\mathrm{z}+\delta \mathrm{z})-\mathrm{f}(\mathrm{z})]}{\delta \mathrm{z}}
\intertext{	The function will be differentiable if limit should exists and it is independent of path along with $\delta z \rightarrow 0$.}
\text{	Ex: }\quad \mathrm{f}(z)&=(4 x+y)+i(4 y-x) \Rightarrow u=(4 x+y)\text{ and }v=(4 y-x)\\
	&\Rightarrow f(z+\delta z)=4(x+\delta x)+(y+\delta y)+i[4(y+\delta y)-(x+\delta x)] \\
	&\Rightarrow f(z+\delta z)-f(z)=4 \delta x+\delta y+i(4 \delta y-\delta x)\\
	&\Rightarrow \frac{f(z+\delta z)-f(z)}{\delta z}=\frac{4 \delta x+\delta y+i(4 \delta y-\delta x)}{\delta z} \Rightarrow \frac{\delta f}{\delta z}=\frac{4 \delta x+\delta y-i \delta x+4 i \delta y}{\delta x+i \delta y}\\
	&\text{Along real axis : }\delta x=\delta z, \delta y=0, \Rightarrow \frac{\delta f}{\delta z}=4-i\\
	&\text{Along imaginary axis : }i \delta y=\delta z, \delta x=0, \Rightarrow \frac{\delta f}{\delta z}=4-i\\
	&\text{Along a line }: y=x, \delta y=\delta x, \delta z=(1+i) \delta x, \Rightarrow \frac{\delta f}{\delta z}=\frac{5 \delta x+3 i \delta x}{(1+i) \delta \dot{x}}=\frac{5+3 i}{1+i}=4-i
		\end{align*}
	\section{Complex Analysis Function}
	A function $f(z)$ is said to be analytic at a point $z=z_{0}$ if it is single valued and has the derivative at every point in some neighhourhood of $z_{0}$. The function $f(z)$ is said to be analytic in a domain $D$ if it is single valued and is differentiable at every point of domain D.
	\subsection{Cauchy Reamann Equations}
	\begin{align*}
	\intertext{	For a function $f(z)=u+i v$ to be analytic at all points in some region ' $\mathrm{R}$ ', the necessary conditions are:}
		\frac{\partial u}{\partial x}&=\frac{\partial v}{\partial y} \text { and } \frac{\partial u}{\partial y}=-\frac{\partial v}{\partial x}\\
		\text{Sufficient Condition: }&\frac{\partial u}{\partial x}, \frac{\partial u}{\partial y}, \frac{\partial v}{\partial x}, \frac{\partial v}{\partial y}\text{ are continuous functions of $x$ and $y$.}\\
		\text{	Derivative of }\mathrm{f}(\mathrm{z}): f^{\prime}(\mathrm{z})&=\frac{\partial u}{\partial x}+i \frac{\partial v}{\partial x}=\frac{\partial v}{\partial y}-i \frac{\partial u}{\partial y}
	\end{align*}
	\begin{exercise}
		Check whether $f(z)=\sin z$ is analytic or not.
	\end{exercise}
	\begin{answer}
		\begin{align*}
		&f(z)=\sin z=\sin (x+i y)=\sin x \cdot \cos (i y)+\cos x \cdot \sin (i y)=\sin x \cdot \cosh y+i \cos x \cdot \sinh y\\
		&\text{Therefore, }u=\sin x \cdot \cosh y\text{ and }v=\cos x.sinhy \\
		&\frac{\partial u}{\partial x}=\cos x \cdot \cosh y ; \frac{\partial u}{\partial y}=\sin x \cdot \sinh y ; \frac{\partial v}{\partial x}=-\sin x \cdot \sinh y ; \frac{\partial v}{\partial y}=\cos x \cdot \cosh y\\
		&\text { So, C-R equation is satisfied, given } \mathrm{f}(\mathrm{z}) \text { is analytic. }
		\end{align*}
	\end{answer}
	\begin{exercise}
		If the real part of a complex analytic function is $u(x, y)=x+\frac{1}{2}\left(x^{2}-y^{2}\right)$, find the corresponding imaginary part.
	\end{exercise}
	\begin{answer}
		\begin{align*}
		\frac{\partial u}{\partial x}=x+1=\frac{\partial v}{\partial y} & \Rightarrow v(x, y)=y+x y+f(x) \\
		\frac{\partial u}{\partial y}=-y=-\frac{\partial v}{\partial x} & \Rightarrow v(x, y)=x y+g(y)\\
	\text{	Therefore, the imaginary }&\text{part will be }v(x, y)=y+x y+C
	\text{	( $C=$ numerical constant )}
		\end{align*}
	\end{answer}
	\begin{exercise}
		Example-7: If $f(x, y)=(1+x+y)(1+x-y)+a\left(x^{2}-y^{2}\right)-1+2 i y(1-x-a x)$ is a complex analytic function then find the value of ' $a$ '.
	\end{exercise}
	\begin{answer}
		\begin{align*}
		u(\mathrm{x}, \mathrm{y})&=(1+x+y)(1+x-y)+a\left(x^{2}-y^{2}\right)-1 \quad \Rightarrow \frac{\partial u}{\partial x}=2 x+2+2 a x \\
		v(x, y)&=2 y(1-x-a x) \quad \Rightarrow \frac{\partial v}{\partial y}=2(1-x-a x)\\
		\text{According to Cauchy  }&\text{ Reamann equation,}\frac{\partial \mathrm{u}}{\partial \mathrm{x}}=\frac{\partial \mathrm{v}}{\partial \mathrm{y}} \Rightarrow 4 \mathrm{x}=-4 \mathrm{ax} \Rightarrow \mathrm{a}=-1
		\end{align*}
	\end{answer}
	\begin{exercise}
		The harmonic conjugate function of $u(x, y)=2 x(1-y)$ corresponding to a complex analytic function $\omega=u(x, y)+i v(x, y)$ is given $v(x, y)=\alpha x^{2}+\beta y+\gamma y^{2}$ (Taking the integration constant to be zero).
		Which of the following statement is true ?
		 \begin{tasks}(2)
			\task[\textbf{a.}]$\alpha-\gamma=\beta$
			\task[\textbf{b.}]$\alpha+\gamma+\beta=0$
			\task[\textbf{c.}]$\alpha+\gamma=\beta$
			\task[\textbf{d.}] $\alpha \gamma \beta=1$.
		\end{tasks}
	\end{exercise}
	\begin{answer}
		\begin{align*}
		u(x, y)&=2 x(1-y) \\
		\Rightarrow \frac{\partial u}{\partial x}&=2(1-y)=\frac{\partial v}{\partial y} \Rightarrow v=2 y-y^{2}+f_{1}(x) \\
		\Rightarrow \frac{\partial u}{\partial y}&=-2 x=-\frac{\partial v}{\partial x} \Rightarrow v=x^{2}+f_{2}(y)
		\end{align*}
			Therefore, the imaginary part of the complex function $v=x^{2}-y^{2}+2 y$ \\Comparing with the question, $\alpha=1, \beta=2, \gamma=-1 \quad \Rightarrow \alpha-\gamma=\beta$
	\end{answer}
\
	\subsection{Method for Finding Conjugate Function }
		\begin{align*}
		\textbf{Case 1: }f(z)&=u+i v,\text{ and $u$ is known.}\\
		d v&=\frac{\partial v}{\partial x} d x+\frac{\partial v}{\partial y} d y=-\frac{\partial u}{\partial y} d x+\frac{\partial u}{\partial x} d y \Rightarrow v=-\int \frac{\partial u}{\partial y} d x+\int \frac{\partial u}{\partial x} d y\\
		\textbf{Case 2: }f(z)&=u+i v,\text{ and $v$ is known}\\
		d u&=\frac{\partial u}{\partial x} d x+\frac{\partial u}{\partial y} d y=\frac{\partial v}{\partial y} d x-\frac{\partial v}{\partial x} d y \Rightarrow u=\int \frac{\partial v}{\partial y} d x-\int \frac{\partial v}{\partial x} d y
		\end{align*}
	\begin{exercise}
		 Find the imaginary part of the complex analytic function whose real part is $u(x, y)=x^{3}-3 x y^{2}+3 x^{2}-3 y^{2}+1$
	\end{exercise}
	\begin{answer}
		\begin{align*}
		&\frac{\partial u}{\partial x}=3 x^{2}-3 y^{2}+6 x=\frac{\partial v}{\partial y} \Rightarrow v=3 x^{2} y-y^{3}+6 x y+f_{1}(x) \\
		&\frac{\partial u}{\partial y}=-6 x y-6 y=-\frac{\partial v}{\partial x} \Rightarrow v=3 x^{2} y+6 x y+f_{2}(y) \\
		&v(x, y)=3 x^{2} y-y^{3}+6 x y+C
		\end{align*}
	\end{answer}
	\subsection{Milne-Thomson Method : (To find Analytic function if either ' $u$ ' or ' $v$ ' is given)}
	\begin{align*}
\textbf{	Case 1:}&\text{ When 'u' is given,}\\
	&\text{(1) Find }\frac{\partial u}{\partial x}=\phi_{1}(x, y) \text{and }\frac{\partial u}{\partial y}=\phi_{2}(x, y)\\
	&\text{(2) Replace }\text{$x$ by $z$ and $y$ by 0 in $\phi_{1}(x, y)$ and $\phi_{2}(x, y)$ to get $\phi_{1}(z, 0)$ and $\phi_{2}(z, 0)$.}\\
	&\text{(3) Find }f(z)=\int\left\{\phi_{1}(z, 0)-i \phi_{2}(z, 0)\right\} d z+c\\
\textbf{	Case 2: }&\text{When ' $v$ ' is given,}\\
&\text{	(1) Find }\frac{\partial v}{\partial x}=\psi_{2}(x, y)\text{ and }\frac{\partial v}{\partial y}=\psi_{1}(x, y)\\
&\text{(2) Replace }\text{$x$ by $z$ and $y$ by 0 in $\psi_{1}(x, y)$ and $\psi_{2}(x, y)$ to get $\psi_{1}(z, 0)$ and $\psi_{1}(z, 0)$.}\\
&\text{(3) Find }f(z)=\int\left\{\psi_{1}(z, 0)+i \psi_{2}(z, 0)\right\} d z+c
	\end{align*}
	\begin{exercise}
		Find the analytical function whose imaginary part is $v(x, y)=e^{x}(x \cos y-y \sin y)$
	\end{exercise}
	\begin{answer}
		\begin{align*}
		\frac{\partial v}{\partial x}=e^{x}(x \cos y-y \sin y)+e^{x} \cos y=\Psi_{2}(x, y) \quad& \Rightarrow \frac{\partial v}{\partial y}=-e^{x} x \sin y-e^{x}(\sin y+y \cos y)=\Psi_{1}(x, y) \\
		\Psi_{1}(z, 0)=0 \text { and } \Psi_{1}(z, 0)=e^{z} z+e^{z} \quad& \Rightarrow f(z)=\int 0+i\left[e^{z} z+e^{z}\right] d z=i z e^{z}+C
		\end{align*}
	\end{answer}
	\begin{exercise}
		 If the real part of a complex analytic function $\mathrm{f}(\mathrm{z})$ is given as, $u(x, y)=e^{-2 x y} \sin \left(x^{2}-y^{2}\right)$, then $\mathrm{f}(\mathrm{z})$ can be written as
		 \begin{tasks}(2)
			\task[\textbf{a.}]$i e^{i^{2}}+C$
			\task[\textbf{b.}] $-i e^{i x^{2}}+C$
			\task[\textbf{c.}] $-i e^{-i z^{2}}+C$
			\task[\textbf{d.}] $i e^{-i i^{2}}+C$
		\end{tasks}
	\end{exercise}
	\begin{answer}
		\begin{align*}
		u(x, y)&=e^{-2 x y} \sin \left(x^{-2}-y^{2}\right) \\
		\Rightarrow \frac{\partial u}{\partial x}&=e^{-2 x y}(-2 y) \sin \left(x^{2}-y^{2}\right)+e^{-2 x y} \cos \left(x^{2}-y^{2}\right) 2 x=\phi_{1}(x, y) \\
		\Rightarrow \frac{\partial u}{\partial y}&=e^{-2 x y}(-2 x) \sin \left(x^{2}-y^{2}\right)+e^{-2 x y} \cos \left(x^{2}-y^{2}\right)(-2 y)=\phi_{2}(x, y)\\
		\therefore \quad \phi_{1}(z, 0) &=\cos z^{2} \cdot 2 z, \phi_{2}(z, 0)=\sin z^{2}(-2 z) \\
		\therefore \quad f(z) &=\int\left(\cos z^{2} \cdot 2 z-i \sin z^{2} \cdot(-2 z)\right) d z+c=2 \int\left(\cos z^{2}+i \sin z^{2}\right) \cdot z d z+c \\
		&=2 \int e^{i z^{2}} \cdot z d z+c=-i e^{i z^{2}}+c
		\end{align*}
		So the correct answer is \textbf{option (b)}
	\end{answer}
\subsection{Harmonic Function}
Any function which satisfies the Laplace's equation, is known as harmonic function. If $u+i v$ is an analytic function, then $u, v$ are conjugate harmonic functions i.e.
$$
\frac{\partial^{2} u}{\partial x^{2}}+\frac{\partial^{2} u}{\partial y^{2}}=0 \text { and } \frac{\partial^{2} v}{\partial x^{2}}+\frac{\partial^{2} v}{\partial y^{2}}=0
$$
\begin{exercise}
	Find the values of $\mathrm{m}, \mathrm{n}$ such that $f(x, y)=x^{2}+m x y+n y^{2}$ is harmonic in nature.
\end{exercise}
\begin{answer}
	\begin{align*}
	\text { Since, } \frac{\partial^{2} f}{\partial x^{2}}+\frac{\partial^{2} f}{d y^{2}}=0 \Rightarrow 2 n+2=0 \Rightarrow n=-1 ;^{\prime} m^{\prime} \text { can take any value. }
	\end{align*}
\end{answer}
\section{Cauchy's Integral Theorem}
If a funciion $f(z)$ is analytic and its derivative $f^{\prime}(z)$ is continuous at all points inside and on a simple closed curve ' $C$ ', then $\oint_{C} f(z) d z=0$\\
\subsection{Cauchy's Integral Formula}

	If $f(z)$ is analytic within or on a closed curve $\mathrm{C}$ and if ' $\mathrm{a}$ ' is any point within ${\mathrm{C}}$, where $\frac{f(z)}{z-a}$ is not analytic at $z=a$ then
	\begin{align*}
	f(a)&=\frac{1}{2 \pi i} \oint_{C} \frac{f(z)}{z-a} d z \qquad \text { and } f^{\prime}(a)=\frac{1}{2 \pi i} \oint_{C} \frac{f(z)}{(z-a)^{2}} d z\\
	\text{Similarly, }\qquad f^{\prime \prime}(\mathrm{a})&=\frac{2 !}{2 \pi i} \oint_{C} \frac{f(z)}{(z-a)^{3}} d z \quad\text{ and } \mathrm{f}^{\mathrm{n}}(\mathrm{a})=\frac{n !}{2 \pi i} \oint_{C} \frac{f(z)}{(z-a)^{n+1}} d z
	\end{align*}

\begin{exercise}
	Evaluate the integral $\frac{1}{2 \pi i} \oint \frac{z e^{z}}{(z-a)^{3}}$
\end{exercise}
\begin{answer}
	\begin{align*}
	\frac{1}{2 \pi i} \oint \frac{z e^{z}}{(z-a)^{3}}&=\left.\frac{1}{2 \pi i} 2 \pi i \frac{1}{2 !} \frac{d^{2}}{d z^{2}}\left(z e^{z}\right)\right|_{z=a}\\&=\frac{a e^{a}+2 e^{a}}{2}\\&=\frac{1}{2}(a+{2}) e^{a}
	\end{align*}
\end{answer}
\section{Power Series Expansion of Complex Function}
	\begin{align*}
	\intertext{Every analytic function which is analytic at $z=z_{0}$ can be expanded into power series about $z=z_{0}$.}
	f(z)&=\sum_{n=0}^{\infty} a_{n}\left(z-z_{0}\right)^{n}=a_{0}+a_{1}\left(z-z_{0}\right)+a_{2}\left(z-z_{0}\right)^{2}+\ldots \ldots
	\intertext{where, $z_{0}$ is the centre of power series.}
\end{align*}
\subsection{Radius of Convergence}
Imagine a circle of centre $z_{0}$ and radius $r$, then $\left|z-z_{0}\right|=R$,
The power series is convergent in the region $\left|z-z_{0}\right|<R$ (i.e. within the circle) and divergent $\left|z-z_{0}\right|>R$ (outside the circle). Therefore, $R$ is known as the radius of convergence of power series and defined as\\
$$R=\lim _{n \rightarrow \infty}\left|\frac{a_{n}}{a_{n+1}}\right|$$
\begin{exercise}
	Find the radius of convergence of the series
	$$
	\frac{z}{2}+\frac{1.3}{2.5} z^{2}+\frac{1.3 .5}{2.5 .8} z^{3}+\ldots \ldots .
	$$
\end{exercise}
\begin{answer}
	The coefficient of $z^{n}$ of the given power series is given by
	\begin{align*}
	a_{n}&=\frac{1.3 .5 \ldots(2 n-1)}{2.5 .8 \ldots(3 n-1)} \\
	a_{n+1}&=\frac{1.3 .5 \ldots(2 n-1)(2 n+1)}{25.8 \ldots(3 n-1)(3 n+2)}\\
	\text{So }\frac{a_{n+1}}{a_{n}}&=\frac{2 n+1}{3 n+2}=\frac{2}{3} \cdot \frac{\left(1+\frac{1}{2 n}\right)}{\left(1+\frac{2}{3 n}\right)}\\
	\text{Therefore,}\quad
	\frac{1}{R}&=\lim _{n \rightarrow \infty}\left|\frac{a_{n+1}}{a_{n}}\right|=\frac{2}{3} \cdot \frac{(1+0)}{(1+0)}=\frac{2}{3} \Rightarrow R=\frac{3}{2}
	\end{align*}
\end{answer}
\subsubsection{Taylor Series Expansion}
If a function $\mathrm{f}(\mathrm{z})$ is analytic at all points inside and on a circle $C$, with its center at the point ' $a$ ' and radius ' $r$ ', then at each point $z$ inside $C$, the function $f(z)$ can be expanded as,
\begin{align*}
	f(z) &=f(a)+\frac{f^{\prime}(a)}{1 !}(z-a)+\frac{f^{\prime \prime}(a)}{2 !}(z-a)^{2}+\ldots .+\frac{f^{n}(a)}{n !}(z-a)^{n}+\ldots \\
	& \Rightarrow f(z)=\sum_{n=0}^{\infty} \frac{f^{n}\left(z_{0}\right)}{n !}\left(z-z_{0}\right)^{n}
\end{align*}
\begin{exercise}
	Expand the function $\ln (\cosh x)$ about the point $x=0$.
\end{exercise}
\begin{answer}
	\begin{align*}
	\begin{aligned}
	f(x)&=f(0)+(x-0) f^{\prime}(0)+\frac{1}{2 !}(x-0)^{2} f^{\prime \prime}(0)+\ldots \ldots \\
	f^{\prime}(x)&=\frac{1}{\cosh x} \cdot \sinh x=\tanh x, f^{\prime \prime}(x)=\sec h^{2} x \\
	f^{\prime \prime \prime}(x)&=2 \operatorname{sech} x(-\operatorname{sech} x \tanh x)=-2 \sec h^{2} x \tanh x \\
	f^{\prime \prime \prime}(x)&=4 \operatorname{sech} h^{2} x \cdot \tanh ^{2} x-2 \sec h^{4} x\\
	\text { Therefore, } f(x)&=0+0+\frac{x^{2}}{2}+0-\frac{x^{4}}{12}+\ldots \ldots=\frac{x^{2}}{2}-\frac{x^{4}}{12}+\ldots . .
	\end{aligned}
	\end{align*}
\end{answer}
\section{Laurent Series}
Let $C_{1}$ and $C_{2}$ be two circles with center at $z_{0}$. Let $f(z)$ be analytic in the region $R$ between the circles. Then $f(z)$ can be expanded in a series of the form,
\begin{equation}
f(z)=a_{0}+a_{1}\left(z-z_{0}\right)+a_{2}\left(z-z_{0}\right)^{2}+\cdots+\frac{b_{1}}{z-z_{0}}+\frac{b_{2}}{\left(z-z_{0}\right)^{2}}+\cdots \label{complex1}
\end{equation}
convergent in $R$. Such a series is called a Laurent series. The "b" series in equation \ref{complex1} is called the principal part of the Laurent series.\\
 Consider the Laurent series in equation.\label{complex1}
\begin{align}
f(z)=1+\frac{z}{2}+\frac{z^{2}}{4}+\frac{z^{3}}{8}+\cdots+&\left(\frac{z}{2}\right)^{n}+\cdots \notag\\
&+\frac{2}{z}+4\left(\frac{1}{z^{2}}-\frac{1}{z^{3}}+\cdots+\frac{(-1)^{n}}{z^{n}}+\cdots\right)\label{complex2}
\end{align}
Let us see where this series converges. First consider the series of positive powers; by the ratio test (see Chapters 1 and 2), this series converges for $|z / 2|<1$, that is, for $|z|<2$. Similarly, the series of negative powers converges for $|1| z \mid<1$, that is, $|z|>1$. Then both series converge (and so the Laurent series converges) for $|z|$ between 1 and 2 , that is, in a ring between two circles of radii 1 and 2 .\\
We expect this result in general. The ``$a$'' series is a power series, and a power series converges inside some circle (say $C_{2}$ in Figure .\ref{Laurent series}). The  ``$b$'' series is a series of inverse powers of $z$, and so converges for $|1 / z|<$ some constant. Thus the ``$b$'' series converges outside some circle. Then a Laurent series converges between two circles (if it converges at all). (Note that the inner circle may be a point and the outer circle may have infinite radius).
\begin{figure}[H]
	\centering
	\includegraphics[height=3.7cm,width=7cm]{CN.01}
	\caption{Laurent series}
	\label{Laurent series}
\end{figure}
The formulas for the coefficients are
$$
a_{n}=\frac{1}{2 \pi i} \oint_{C} \frac{f(z) d z}{\left(z-z_{0}\right)^{n+1}}, \quad b_{n}=\frac{1}{2 \pi i} \oint_{C} \frac{f(z) d z}{\left(z-z_{0}\right)^{-n+1}}
$$
Where $C$ is any simple closed curve surrounding $z_{0}$ and lying in $R$. However, this is not usually the easiest way to find a Laurent series. Like power series about a point, the Laurent series (about $z_{0}$ ) for a function in a given annular ring (about $z_{0}$ ) where the function is analytic, is unique, and we can find it by any method we choose. (See examples below.) If $f(z)$ has several isolated singularities, there are several annular rings, $R_{1}, R_{2}, \cdots$, in which $f(z)$ is analytic; then there are several different Laurent series for $f(z)$, one for each ring. The Laurent series which we usually want is the one that converges near $z_{0}$. If you have any doubt about the ring of convergence of a Laurent series, you can find out by testing the ``$a$'' series and the ``$b$'' series separately.
\section{Singularity of Complex Function}
\textbf{\large{Singular Point of an Analytic Function}}\\\\
A point at which the function ceases to be analytic is called a singular point.\\
\begin{example}
$f(z)=\frac{1}{(z-2)}$ has a singularity at $\mathrm{z}=2$.
\end{example}
Different kinds of singularities exist.they are,
\subsection{Isolated Singularity}
A point $\mathrm{z}=\mathrm{z}_{0}$ is said to be isolated singularity of $f(z)$ if,
\begin{enumerate}[label=(\alph*)]
	\item  $f(z)$ is not analytic at $\mathrm{z}=\mathrm{z}_{0}$.
	\item  $f(z)$ is analytic in the neighbourhood of $\mathrm{z}=\mathrm{z}_{0}$ i.e. there exists a neighbourhood of $\mathrm{z}=\mathrm{z}_{0}$, containing no other singularity.
\end{enumerate}

\begin{example}$\left. \right. $\\\\
	\textbf{(i)} Function $f(z)=\frac{1}{z}$ is analytic everywhere except at $\mathrm{z}=0$, therefore $\mathrm{z}=0$ is an isolated singularity.\\\\
	\textbf{(ii)} The function $f(z)=\frac{z+2}{(z-1)(z-2)(z-3)}$ has three isolated singularities at $z=1,2$ and 3 .
\end{example}
\subsection{Non-isolated Singularity}
A singular point $z_{0}$ is said to be an non-isolated singularity if $z_{0}$ is not an isolated singular point.
\begin{example}$\left. \right. $\\\\
	$f(z)=\frac{1}{\left[\sin \frac{\pi}{z}\right]}$
	\begin{align*}
	f(z)&=\frac{1}{\left[\sin \frac{\pi}{z}\right]} \text { is not analytic when } \sin \frac{\pi}{z}=0 \\\frac{\pi}{\mathrm{z}}&=\mathrm{n} \pi \\ z&=\frac{1}{n}(n=0,1,2,3 \ldots \ldots \ldots \ldots)\\
	\intertext { Thus,$z=0$  is an non-isolated singularity of $ f(z)$ surrounded by a infinite number of other singularity $z=\frac{1}{n}$}
	f(z)&=\frac{1}{\sin \pi / z} \text { has non-isolated singularity at } \mathrm{z}=0
	\end{align*}
\end{example}

\subsection{Types of Isolated Singularity}
 If  $\mathrm{f}(\mathrm{z})$  is an isolated singular point at  $\mathrm{z}=\mathrm{a}$ , the we can expand $ f(\mathrm{z})$ about $ \mathrm{z}=\mathrm{a}$ into laurent series as:
\begin{align*}
\mathrm{f}(\mathrm{z})=\sum_{n=0}^{\infty} a_{n}(z-a)^{n}+\sum_{n=1}^{\infty} \frac{b_{n}}{(z-a)^{n}}=\left[a_{0}+a_{1}(z-a)+a_{2}(z-a)^{2}+\ldots . .\right]+\left[\frac{b_{1}}{(z-a)}+\frac{b_{2}}{(z-a)^{2}}+\ldots . .\right]
\end{align*}
Therefore, three types of singularity exists and they are as follows.
\subsubsection{1.\ Removable Singularity } If the principal part of the Laurrent series expansion of $f(z)$ about $z=a$ contains no term i.e. if $b_{n}=0$ for all ' $n$ ', then $\mathrm{f}(\mathrm{z})$ has a removable singularity at $\mathrm{z}=\mathrm{a}$. In this case, Laurent series expansion is $f(z)=\sum_{n=0}^{\infty} a_{n}(z-a)^{n}$
\begin{example}$\left. \right. $\\
	Suppose $f(z)=\frac{\sin z}{z}$, then $\lim _{z \rightarrow 0}\left(\frac{\sin z}{z}\right)=1$, therefore, $z=0$ is a removable singularity of $f(z)$.\\
	Again, $\frac{\sin z}{z}=\frac{1}{z}\left(z-\frac{z^{3}}{3 !}+\ldots \ldots \ldots\right)=1-\frac{z^{2}}{3 !}+\frac{z^{4}}{5 !} \ldots \ldots$\\
	Since, there is no negative term in the laurent series expansion of $f(z)$ about $z=0$, hence $z=0$ is a removable singularity of $f(z)$.
\end{example}
\subsubsection{2.\ Non-essential singularity or Pole:} If the principal part of the Laurrent series expansion of $f(z)$ about $z=$ a contains a finite number of terms, saym, i.e. $b_{n}=0$ for all $n>m$, then $f(z)$ has a non-essential singularity or a pole of order ' $m$ ' at $z=a$. A polc of order one is also known as simple pole.\\
Thus if $\mathrm{z}=\mathrm{a}$ is pole of order mof function $\mathrm{f}(\mathrm{z})$, then $\mathrm{f}(\mathrm{z})$ will have the Laurent series expansion of the form
$$
f(z)=\sum_{n=0}^{\infty} a_{n}\left(z-z_{0}\right)^{n}+\sum_{n=1}^{m} b_{n}\left(z-z_{0}\right)^{-n}
$$
\begin{example}
	$f(z)=\frac{z}{(z-1)(z+2)^{2}}$ has a simple pole at $z=1$ and a pole of order 2 at $z=-2$.
\end{example}
\subsubsection{3.\ Essential singularity: }If the principal part of the Laurrent series expansion of $f(z)$ about $z=a$, contains infinite number of terms i.e. $b_{n} \neq 0$ for infinitely many values of $n$, then $f(z)$ has an essential singularity at $z=a$.\\
\begin{example}
	$f(z)=e^{1 / 2}$ has an essential singularity at $z=0$, since the expansion $e^{\frac{1}{z}}=1+\frac{1}{z}+\frac{1}{z^{2}} 2 !+\ldots . .$ is an infinite series of-ve powers of $\mathrm{z}$.
\end{example}
\begin{exercise}
	Examine the nature of singularity of the functions: (a) $\sin \left(\frac{1}{1-z}\right)$, (b) $(z-3) \sin \left(\frac{1}{z+2}\right)$.
\end{exercise}
\begin{answer}
	\begin{align*}
	\text{(a) }&\sin \left(\frac{1}{1-z}\right)=\frac{1}{1-z}-\frac{1}{(1-z)^{3} \cdot 3 !}+\frac{1}{(1-z)^{5} \cdot 5 !}-.\\
&\text{	so, $z=1$ is an isolated essential singular point.}\\
\text { (b) }&(z-3) \sin \left(\frac{1}{z+2}\right)=(z-3)\left[\frac{1}{z+2}-\frac{1}{(z+2)^{3} \cdot 3 !}+\frac{1}{(z+2)^{5} .5 !}-\ldots \ldots . .\right] \\ &\text { so, $\mathrm{z}=-2$  is an isolated essential point}
	\end{align*}
\end{answer}
\section{Zero of an Analytic Function}
A zero of an analytic function $f(z)$ is a value of $z$ such that $$f(z)=0$$
An analytic function $\mathrm{f}(\mathrm{z})$ is said to have a zero of order ' $\mathrm{m}$ ' at $\mathrm{z}=\mathrm{z}_{0}$ if $\mathrm{f}(\mathrm{z})$ is expressible as, $$f(z)\left(z-z_{0}\right)^{m} \phi(z)$$
where $\phi(z)$ is analytic and $\phi\left(z_{0}\right) \neq 0$. For $m=1, f(z)$ is said to have a simple zero at $z=z_{0}$

\section{Residue of Complex Fuction}
\subsection{Definition of residue at a pole:}
Let, $\mathrm{z}=$ a be a pole of order ' $m$ ' of $\mathrm{f}(\mathrm{z})$ and $\mathrm{C}_{1}$ is a circle of radius ' $r$ ' with center at $\mathrm{z}=$ a which does not contain singularities except $\mathrm{z}=\mathrm{a}$, then $\mathrm{f}(\mathrm{z})$ is analytic within the annular region $\mathrm{r}<|\mathrm{z}-\mathrm{a}|<\mathrm{R}$ can be expanded into Laurrent series within the annulur region as:
$$f(z)=\sum_{n=0}^{\infty} a_{n}(z-a)^{n}+\sum_{n=1}^{\infty} b_{n}(z-a)^{-n}$$
Co-efficient $\mathrm{b}_{n}$ is known as residue of $\mathrm{f}(\mathrm{z})$ at $\mathrm{z}=\mathrm{a}$ i.e.
\begin{equation}
\text{Res.} \mathrm{f}(\mathrm{z}=\mathrm{a})=\mathrm{b}_{n}=\frac{1}{2 \pi i} \oint f(z) d z
\end{equation}
\subsection{Methods of Finding Residues}
\begin{enumerate}[label=(\alph*)]
	\item $\left. \right. $\\
	\textbf{Method 1:}  Res. $f(z=a)=\underset{z \rightarrow a}{L t}(z-a) f(z)$\\
	\textbf{Method 2: }If $f(z)=\frac{\phi(z)}{\psi(z)}$ where $\psi(a)=0$ but $\phi(a) \neq 0$, then $$\operatorname{Res} . f(z=a)=\frac{\phi(a)}{\psi^{\prime}(a)}$$
	\item Residue at a pole of order ' $n$ '\\
	\textbf{Method 1:} Res. $f(z=a)=\frac{1}{(n-1) !}\left\{\frac{d^{n-1}}{d z^{n-1}}\left[(z-a)^{n} f(z)\right]\right\}_{z=a}$\\
	\textbf{Method 2:} First put $z+a=t$ and expand it into series, then Res. $f(z=a)=$ co-efficient of $1 / t$
	\item Residue at $\mathrm{z}=\infty$ : Res. $f(z=\infty) \underset{z \rightarrow \infty}{L t}[-z f(z)]$
\end{enumerate}

\begin{exercise}
	 Find the singular points of the following function and the corresponding residues:\\
	(a) $f(z)=\frac{1-2 z}{z(z-1)(z-2)}$\quad
	(b) $f(z)=\frac{z^{2}}{z^{2}+a^{2}}$\quad
	(c) $f(z)=z^{2} e^{1 / z}$
\end{exercise}
\begin{answer}
	\begin{align*}
	\text{(a )}f(z)&=\frac{1-2 z}{z(z-1)(z-2)} \Rightarrow \text { Poles }: z=0, z=1, z=2\\
	\text{Res. }f(z=0)&=\operatorname{Lt}_{z \rightarrow 0}(z-0) f(z)=\operatorname{Lt}_{z \rightarrow 0} \frac{1-2 z}{(z-1)(z-2)}=\frac{1}{2}.\\
	\text{Res. } f(z=1)&=L_{z \rightarrow 1}(z-1) f(z)=L_{z \rightarrow 1} \frac{1-2 z}{z(z-2)}=1\\
	\text{Res. }f(z=2)&=\underset{z \rightarrow 2}{L t}(z-2) f(z)=\underset{z \rightarrow 2}{L t} \frac{1-2 z}{z(z-1)}=-\frac{3}{2}\\\\
\text{	(b) }f(z)&=\frac{z^{2}}{z^{2}+a^{2}} \Rightarrow\text{ Poles : }z=i a, z=-i a\\
	\text { Res. } f(z=i a)&=\left(\frac{z^{2}}{2 z}\right)_{z=i a}=\frac{1}{2} i a ; \operatorname{Res} . f(z=-i a)=\left(\frac{z^{2}}{2 z}\right)_{z=-i a}=-\frac{1}{2} i a\\\\
	\text{(c) }f(z)&=z^{2} e^{1 / z}=z^{2}\left[1+\frac{1}{z}+\frac{1}{z^{2} \cdot 2 !}+\frac{1}{z^{3} \cdot 3 !}+\ldots \ldots .\right] \Rightarrow\text{ Poles :} z=0\\
	\text{Res. }f(z=0)&=\text{ Coefficient of }\frac{1}{z}=\frac{1}{3 !}=\frac{1}{6}
	\end{align*}
\end{answer}
\section{Cauchy's Residue Theorem }
If $\mathrm{f}(\mathrm{z})$ in single-valued and analytic in a closed curve ' $\mathrm{C}$ ', except at a finite number of poles within ' $\mathrm{C}$, then,
\begin{equation}
\oint_{C} \mathrm{f}(\mathrm{z}) \mathrm{dz}=2 \pi \mathrm{i}\ \text{(Sum of the residues at poles within `$\mathrm{C}$')}
\end{equation}
\begin{exercise}
	Evaluate the integral: $\oint_{C} \frac{4-3 z}{z(z-1)(z-3)} d z$ where $|z|=\frac{3}{2}$
\end{exercise}
\begin{answer}
	\begin{align*}
	\hat{f}(z)&=\frac{4-3 z}{z(z-1)(z-3)} \Rightarrow\text{ Poles : }z=0, z=1, z=3\\
\intertext{	But, the given contour is circle centered at the origin and radius $3 / 2$ units.}
\text{Therefore, only $z=0$ }&\text{and $z=1$ within the contour.}\\
	I&=2 \pi i[\operatorname{Re} s . f(z=0)+\operatorname{Re} s . f(z=1)]=2 \pi i\left[\frac{4}{3}-\frac{1}{2}\right]=\frac{5 \pi i}{3}
	\end{align*}
\end{answer}
\begin{exercise}
	Evaluate the integral: $\oint_{C} \frac{e^{2 z}+z^{2}}{(z-1)^{5}} d z$ where $|z|=2$
\end{exercise}
\begin{answer}
	\begin{align*}
	\begin{aligned}
	f(z)&=\frac{e^{2 z}+z^{2}}{(z-1)^{5}} \Rightarrow \text { Poles }: z=1(\text { order } 5) \\
	I&=2 \pi i \times \operatorname{Re} s . f(z=1)=2 \pi i \times \frac{1}{4 !} \frac{d^{4}}{d z^{4}}\left[e^{2 z}+z^{2}\right]_{z=1}=2 \pi i \times \frac{2 e^{2}}{3}=\frac{4 \pi i e^{2}}{3} .
	\end{aligned}
	\end{align*}
\end{answer}
\subsection{Definite Integrals of Trigonometric Functions of $\cos\theta$ and $\sin\theta$ : (Integration round the unit circle)}
	\textbf{Method:} Consider the contour to be a circle centered at the origin and having radius one unit i.e. $|\mathrm{z}|=1$
\begin{align*}
	\text{Assume, }z&=e^{i \theta} \Rightarrow d z=i e^{i \theta} d \theta \\ d \theta&=\frac{d z}{i z}\\
	\text{Therefore, }\cos \theta&=\frac{e^{i \theta}+e^{-i \theta}}{2}=\frac{1}{2}\left(z+\frac{1}{z}\right)
	\\ \text{and }\sin \theta&=\frac{e^{i \theta}-e^{-i \theta}}{2 i}=\frac{1}{2 i}\left(z-\frac{1}{z}\right)
	 \intertext { And the limit will be changed from $ 0 \rightarrow 2 \pi \text { to } \oint_{C}$}
\end{align*}
The replacements regarding $\cos \theta$ and $\sin \theta$ is to be done only in the denominator of the given integral.
\begin{exercise}
	Evaluate the integral: $\int_{0}^{2 \pi} \frac{d \theta}{a+b \cos \theta} ; \quad a>b>0$
\end{exercise}
\begin{answer}
	\begin{align*}
	\int_{0}^{2 \pi} \frac{d \theta}{a+b \cos \theta}&=\int_{0}^{2 \pi} \frac{d z / i z}{a+b\left(\frac{z^{2}+1}{2 z}\right)}\\&=\int_{0}^{2 \pi} \frac{2 d z}{i\left(b z^{2}+2 a z+b\right)}\\
	\text { The singular points are at ($z=\alpha$) }  &=\frac{-a+\sqrt{a^{2}-b^{2}}}{b}  \\ 	\text { The singular points are at ($z=\beta$) }&=\frac{-a-\sqrt{a^{2}-b^{2}}}{b}\\
	\intertext{The singular point $z=\beta$ will lie outside the unit circle as $a>b>0$ while the singular point $z=\alpha$ will lie inside the unit circle which is a simple pole.}
	\text { Res. } f(z=\alpha)&=\lim _{z \rightarrow \alpha}(z-\alpha) f(z)\\&=\lim _{z \rightarrow \alpha} \frac{2}{i b} \frac{(z-\alpha)}{(z-\alpha)(z-\beta)}=\frac{2}{i b(\alpha-\beta)}\\&=\frac{2}{i b} \times \frac{b}{2 \sqrt{a^{2}-b^{2}}}\\&=\frac{1}{i \sqrt{a^{2}-b^{2}}}\\
\text { Therefore,by cauchy Residue theorem.}\
I&=2 \pi i \times \text { Residue }\\&=2 \pi \mathrm{i} \times \frac{1}{i \sqrt{a^{2}-b^{2}}}\\&=\frac{2 \pi}{\sqrt{a^{2}-b^{2}}}
	\end{align*}
\end{answer}
\subsection{ Evaluation of improper integrals between the limit $-\infty$ to $+\infty$ : }
$\left. \right. $\\
\subsubsection{Theorem I:}
\begin{align*}
\intertext{If $f(x)$ contain  only polynomial terms}
\text{Then }f(x)&=f(x)
\intertext{$\rightarrow$ find singular points}
\intertext{$\rightarrow$ check point lie in upper half}
\intertext{\textbf{A.}\quad If singular point lie on imaginary axis}
\int\limits_{-\infty}^{\infty}f(z)dz&=\int\limits_{-\infty}^{\infty}f(x)dx
=2\pi i[\Sigma \text{ Res}]-\left( \stackrel{\text{lim}}{z\rightarrow \infty}\quad zf(x)\right) x\pi i
\intertext{\textbf{B.}\quad If singular point lie on real axis }
\int\limits_{-\infty}^{\infty}f(x)dx=&
\int\limits_{-\infty}^{\infty}f(z)dz=\pi i[\Sigma \text{ Res}]-\pi i \left[\stackrel{\text{lim}}{z\rightarrow \infty}\quad zf(z) \right]
\end{align*}
\subsubsection{Theorem II:}
\begin{align*}
\intertext{If $f(x)$ contains sine and cosine function along with polynomial function rule is same, except second term which is $0$ in this case.}
\intertext{\textbf{A.}\quad If singular point lie on imaginary axis}\\
\int\limits_{-\infty}^{\infty}f(z)dz&=\int\limits_{-\infty}^{\infty}f(x)dx
=2\pi i[\Sigma \text{ Res}]
\intertext{\textbf{B.}\quad If singular point lie on real axis }
\int\limits_{-\infty}^{\infty}f(x)dx&=
\int\limits_{-\infty}^{\infty}f(z)dz=\pi i[\Sigma \text{ Res}]
\end{align*}
\newpage
\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}

	\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}

	\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}

	\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}

	\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}

	\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}

	\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}

	\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}

	\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}

	\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}

	\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}

	\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}

	\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}

	\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}

	\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}

	\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}

	\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}

	\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}

	\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}

	\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}

	\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}

	\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}

	\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}

\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}
	\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}
	\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}}
	\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}
	\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}
	\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}
	\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}
	\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}
	\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}}
	\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}}
	\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}}
	\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}
	\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}
\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}
\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}
\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}
\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}
\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}
\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}
\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}
\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}
\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}
\newpage
\begin{abox}
	Practise Set-3
\end{abox}
\begin{enumerate}
	\item The amplitude of $\frac{1+i \sqrt{3}}{\sqrt{3}+i}$ is
	\begin{tasks}(2)
		\task[\textbf{a.}]$\frac{\pi}{3}$
		\task[\textbf{b.}]$-\frac{\pi}{3}$
		\task[\textbf{c.}]$\frac{\pi}{6}$
		\task[\textbf{d.}]  $-\frac{\pi}{6}$
	\end{tasks}
	\begin{answer}
	\begin{align*}
	\frac{1+i \sqrt{3}}{\sqrt{3}+i}&=\frac{(1+i \sqrt{3})(\sqrt{3}-i)}{(\sqrt{3}+i)(\sqrt{3}-i)}\\&=\frac{2 \sqrt{3}+2 i}{4}\\&=\frac{\sqrt{3}}{2}+\frac{1}{2} i\\
	\intertext{	Since both the real and complex parts are greater than zero, hence the argument is the acute angle given by $\tan ^{-1}\left|\frac{\frac{1}{2}}{\frac{\sqrt{3}}{2}}\right|=\tan ^{-1} \frac{1}{\sqrt{3}}=\frac{\pi}{6}$}
	\end{align*}
	So the correct answer is \textbf{Option (c)}
\end{answer}
	\item If $\frac{1-i x}{1+i x}=a+i b$, then $a^{2}+b^{2}$ is
	\begin{tasks}(2)
		\task[\textbf{a.}]1
		\task[\textbf{b.}]$-1$
		\task[\textbf{c.}] 0
		\task[\textbf{d.}] none of these
	\end{tasks}
	\begin{answer}
	\begin{align*}
	a+i b&=\frac{1-i x}{1+i x} \Rightarrow a-i b=\frac{1+i x}{1-i x}\\
	\therefore \quad(a+i b)(a-i b)&=\frac{1-i x}{1+i x} \cdot \frac{1+i x}{1-i x} \Rightarrow a^{2}+b^{2}=\frac{1+x^{2}}{1+x^{2}}=1
	\end{align*}
	So the correct answer is \textbf{Option (a)}
\end{answer}
	\item If $z=1-\cos \theta+i \sin \theta$, then $|z|$ equals
	\begin{tasks}(2)
		\task[\textbf{a.}]$2 \sin \frac{\theta}{2}$
		\task[\textbf{b.}]$2 \cos \frac{\theta}{2}$
		\task[\textbf{c.}]$2\left|\sin \frac{\theta}{2}\right|$
		\task[\textbf{d.}] $2\left|\cos \frac{\theta}{2}\right|$
	\end{tasks}
\begin{answer}
	\begin{align*}
	|z|&=\sqrt{(1-\cos \theta)^{2}+\sin ^{2} \theta}\\&=\sqrt{2-2 \cos \theta}\\&=\sqrt{4 \sin ^{2} \frac{\theta}{2}}\\&=2\left|\sin \frac{\theta}{2}\right|
	\end{align*}
	So the correct answer is \textbf{Option (c)}
\end{answer}
	\item If $z=\frac{1}{(2+3 i)^{2}}$, then $|z|$ equals
	\begin{tasks}(2)
		\task[\textbf{a.}]$\frac{1}{13}$
		\task[\textbf{b.}]$\frac{1}{15}$
		\task[\textbf{c.}]$\frac{1}{12}$
		\task[\textbf{d.}] none of these
	\end{tasks}
	\begin{answer}
		\begin{align*}
		|z|=\frac{1}{|2+3 i|^{2}}=\frac{1}{\left(\sqrt{2^{2}+3^{2}}\right)^{2}} \quad|z|=\frac{1}{13}
		\end{align*}
		So the correct answer is \textbf{Option (a)}
	\end{answer}
	\item If the number $\frac{z-1}{z+1}$ is purely imaginary, then
\begin{tasks}(2)
	\task[\textbf{a.}]$|z|=1$
	\task[\textbf{b.}]$|z|>1$
	\task[\textbf{c.}]$|z|<1$
	\task[\textbf{d.}] $|z|>2$
\end{tasks}
\begin{answer}
	\begin{align*}
		&\text{we have: }\frac{z-1}{z+1}\text{ is purely imaginary}\\
		&\Rightarrow \quad\text{ argument of }\frac{z-1}{z+1}\text{ is }\pm \frac{\pi}{2} \Rightarrow \arg \left(\frac{\mathrm{z}-1}{\mathrm{z}+1}\right)=\pm \frac{\pi}{2}\\
		&\Rightarrow \quad z\text{ lies on a circle having $(1,0)$ and $(-1,0)$ as the end point of a diameter.}\\
		&\Rightarrow \quad z\text{ lies on a circle with centre at the origin and radius are unit}\\
		&\Rightarrow \quad z\text{ lies on }|z|=1 \Rightarrow|z|=1
	\end{align*}
	So the correct answer is \textbf{Option (a)}
\end{answer}
\item The value of integral $I=\int_{0}^{\pi} \frac{2 d \theta}{R-\cos \theta}$ is given by where $R$ is real constant.
\begin{tasks}(2)
	\task[\textbf{a.}]$\frac{-1}{2 \sqrt{R^{2}-1}}$
	\task[\textbf{b.}]$\frac{2 \pi}{\sqrt{R^{2}-1}}$
	\task[\textbf{c.}]$\frac{\pi}{\sqrt{1-R^{2}}}$
	\task[\textbf{d.}] $\frac{\pi}{\sqrt{R^{2}-1}}$
\end{tasks}
\begin{answer}
	\begin{align*}
		\int_{0}^{\pi} \frac{2 d \theta}{R-\cos \theta}&=\frac{1}{2} \int_{0}^{2 \pi} \frac{2 d \theta}{R-\cos \theta}=\int_{0}^{2 \pi} \frac{d \theta}{R-\cos \theta}\\
		z&=e^{i \theta} \Rightarrow d z=i e^{i \theta} d \theta=i z d \theta \Rightarrow d \theta=\frac{d z}{i z} \\
		\therefore \int_{0}^{\pi} \frac{2 d \theta}{R-\cos \theta}&=\oint_{c} \frac{d z / i z}{R-\frac{1}{2}\left(z+z^{-1}\right)}\\&=\oint_{C} \frac{d z / i z}{R-\frac{1}{2}\left(\frac{z^{2}+1}{z}\right)}\\&=\oint_{C} \frac{d z / i z}{\frac{2 R z-\left(z^{2}+1\right)}{2 z}}\\
		&=-\frac{2}{i} \oint_{c} \frac{d z}{z^{2}-2 R z+1}\hspace{2cm}
		\text{	where $C$; unit circle}\\
		\text{Poles are }&: z^{2}-2 R z+1=0\\
		\Rightarrow z&=\frac{-(-2 R) \pm \sqrt{4 R^{2}-4 \times 1 \times 1}}{2 \times 1} \quad \\\Rightarrow z&=\frac{2 R \pm \sqrt{4 R^{2}-4}}{2} \\\Rightarrow z&=\frac{2 R \pm 2 \sqrt{R^{2}-1}}{2}\\
		&=R \pm \sqrt{R^{2}-1}\\
		z_{1}&=R+\sqrt{R^{2}-1} z_{2}=R-\sqrt{R^{2}-1} \quad(\text{ inside }C)\\
		\operatorname{Res}\left(z=z_{2}\right)&=\lim _{z \rightarrow z_{2}}\left(z-z_{2}\right) \frac{1}{\left(z-z_{1}\right)\left(z-z_{2}\right)}\\
		&=\frac{1}{z_{2}-z_{1}}=\frac{1}{R-\sqrt{R^{2}-1-R-\sqrt{R^{2}-1}}}=\frac{-1}{2 \sqrt{R^{2}-1}}\\
		\therefore \int_{0}^{\pi} \frac{2 d \theta}{(R-\cos \theta)}&=\frac{-2}{i} \times 2 \pi i \times \frac{-1}{2 \sqrt{R^{2}-1}}\\&=\frac{2 \pi}{\sqrt{R^{2}-1}}
	\end{align*}
	So the correct answer is \textbf{Option (b)}
\end{answer}
	\item The value of integral $\int_{-\infty}^{+\infty} \frac{d x}{\left(1+x^{2}\right)^{2}}$ is given by
\begin{tasks}(2)
	\task[\textbf{a.}]$\frac{\pi}{2}$
	\task[\textbf{b.}]$\pi$
	\task[\textbf{c.}] $i \frac{\pi}{2}$
	\task[\textbf{d.}]  $\frac{1}{4 i}$
\end{tasks}
\begin{answer}
	\begin{align*}
		\oint_{C} \frac{d z}{\left(1+z^{2}\right)^{2}}&=\int_{-\infty}^{+\infty} \frac{d x}{\left(1+x^{2}\right)^{2}}+\int_{\Gamma} \frac{d z}{\left(1+z^{2}\right)^{2}}\\
		\text{	poles, }1+z^{2}&=0 \quad z=\pm i\text{ of order $2 \quad z=i$ is inside } c\\
		\therefore \operatorname{Res}(z=i)&=\lim _{z \rightarrow i} \frac{1}{\lfloor} \frac{d}{d z}\left[(z-i)^{2} \frac{1}{(z-i)^{2}(z+i)^{2}}\right]=\lim _{z \rightarrow i} \frac{-2}{(z+i)^{3}}=\frac{1}{4 i}\\
		\oint_{C} \frac{d z}{\left(1+z^{2}\right)^{2}}&=2 \pi i \times \frac{1}{4 i}=\frac{\pi}{2}\text{ also }\int_{\Gamma} \frac{d z}{\left(1+z^{2}\right)^{2}}=0\\
		\therefore \int_{-\infty}^{+\infty} \frac{d x}{\left(1+x^{2}\right)^{2}}&=\frac{\pi}{2}
	\end{align*}
	So the correct answer is \textbf{Option (a)}
\end{answer}
\item The value of $\oint_{C} \frac{\sin 3 z}{z^{2}} d z$
$c:|z|=\pi$ is given by
\begin{tasks}(2)
	\task[\textbf{a.}]$6 \pi i$
	\task[\textbf{b.}]$-6 \pi i$
	\task[\textbf{c.}]0
	\task[\textbf{d.}]  3
\end{tasks}
\begin{answer}
	\begin{align*}
		\frac{\sin 3 z}{z^{2}}&=\frac{1}{z^{2}}\left[3 z-\frac{(3 z)^{3}}{\lfloor 3}+\ldots\right]=\frac{3}{z}-\frac{9}{2} z+\ldots\\
		\text{Residue }&=3\\
		\therefore \oint_{C} \frac{\sin 3 z}{z^{2}} d z&=2 \pi i \times 3\\&=6 \pi i
	\end{align*}
	So the correct answer is \textbf{Option (a)}
\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?
\begin{tasks}(2)
	\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}&\text{ order pole $\because \lim _{z \rightarrow a}(z-a)^{n} f(z)=$ finite and $\neq 0$}\\
	\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 \cdot \cos z \pi+z \cdot \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 (b)}
\end{answer}
	\item The value of integral
$$
I=\oint_{c} \frac{\sin z}{2 z-\pi} d z
$$
with $c$ a circle $|z|=2$, is
\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} \quad\text{ pole }\Rightarrow 2 z-\pi=0 \Rightarrow z=\frac{\pi}{2}\\
	\text{	Residue at }z&=\frac{\pi}{2} \quad \because|z|=2\text{ so it will be lies within the contour}\\
	I&=\oint_{C} \frac{e^{i z}}{2\left(z-\frac{\pi}{2}\right)}=\sum Res \times 2 \pi i\\
	\operatorname{Res} \mid&=\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}
\end{enumerate}

CSIR- Mathematical Physics/chapter/Complex Analysis.tex


\section{Piecewise (bi-)linear functions on multilevel grids}\label{sec:functions}
An image can be viewed as a function on a grid.  Images
with different resolutions can then be viewed as functions on grids of
different sizes.  The use of such multiple-grids is a main technique
used in the standard multigrid method for solving discretized partial
differential equations,
and it can also be interpreted as a main ingredient used in
convolutional neural networks (CNN).

Without loss of generality, for simplicity, we assume that the initial
grid, $\mathcal T$, is of size
$$
m=2^{s}+1~~~n=2^{t}+1
$$
for some integers $t\ge 1$.
Starting from $\mathcal T_1=\mathcal T$,  we consider a sequence of
coarse grids (as depicted in Fig.~\ref{mgrid} with $J=4$):
\begin{equation}
\label{grids}
\mathcal T_1, \mathcal T_2, \ldots, \mathcal T_J
\end{equation}
such that ${\cal T}_\ell$ consist of $n_\ell\times n_\ell$ grid
points, with
\begin{equation}
\label{mn-ell}
 m_\ell=2^{s-\ell+1}+1,~~ n_\ell=2^{t-\ell+1}+1.
\end{equation}
\begin{figure}[!htbp]\label{mgrid}
	\begin{center}
		\includegraphics[width=0.15\textwidth]{grid2.png} \quad
		\includegraphics[width=0.15\textwidth]{grid1.png} \quad
		\includegraphics[width=0.15\textwidth]{grid0.png} \quad
		\includegraphics[width=0.15\textwidth]{grid.png}
	\end{center}
	$$
	\mathcal T_1\hskip1in \mathcal T_2\hskip1in \mathcal T_3\hskip1in\mathcal T_4
	$$
	\caption{multilevel grids for piecewise linear functions}
\end{figure}

The grid points of these grids can be given by
$$
x_i^{\ell}=i h_{\ell}, y_j^{\ell}=j h_{\ell},  i=1, \ldots, m_\ell,
j=1, \ldots, n_\ell.
$$
Here $h_{\ell} = 2^{-s + \ell -1}a$ for some $a >0$. The above geometric coordinates $(x_i^\ell, y_i^\ell)$
are usually not used in image precess literatures, but they are relevant
in the context of multigrid method for numerical solution of PDEs.
We now consider piecewise linear functions on the sequence of grids
\eqref{grids} and we obtain a nested sequence of linear vector spaces
\begin{equation}
\label{Vk}
\mathcal V_1\supset\mathcal V_2\supset\ldots\supset \mathcal
V_J.
\end{equation}
Here each $\mathcal V_\ell$ consists of all piecewise bilinear (or linear)
functions with respect to the grid \eqref{grids} and \eqref{mn-ell}.
Each $\mathcal V_\ell $ has a set of basis functions:
$\phi_{ij}^\ell\in \mathcal V_\ell$ satisfying:
$$
\phi_{ij}^\ell(x_p,y_q)=\delta_{(i,j), (p,q)} =
\begin{cases}
1 \quad &\text{if} \quad (p,q) = (i,j), \\
0 \quad &{\text{if}} \quad (p,q)\neq (i,j).
\end{cases}
$$
Thus, for each $v \in \mathcal V_{\ell}$, we have
\begin{equation}\label{expand}
v(x,y)=\sum_{i=1}^{m_\ell}\sum_{j=1}^{n_\ell}v^\ell_{ij}\phi_{ij}^\ell(x,y).
\end{equation}

Let $\mathcal  V_1=\mathcal  V_h$, then the finite element method: Find $u_h\in \mathcal  V_h$ such that
\begin{equation}\label{FEdis}
a(u_h, v_h)=(f, v_h)~~~\forall~~v_h\in \mathcal  V_h,
\end{equation}
where $a(u_h, v_h)=(\nabla u_h, \nabla v_h)$.
%\begin{lemma}
%FE $\rightarrow$ FD with $f_{i,j}=\int_{\Omega}f(x,y)\phi_{ij}(x,y)dxdy$.
%\end{lemma}

Finite element method: $A_h: \mathcal  V_h\rightarrow \mathcal  V_h, ~~(A_hu_h,v_h)_{L^2}=(\nabla u_h, \nabla v_h)$ (discrete Laplacian $A_h\approx -\Delta_h$. )
\begin{equation}\label{FE:eq}
A_hu_h=f_h,~~
\end{equation}
where~$f_h(x,y)=\sum_{i=1}^{m_1}\sum_{j=1}^{n_1}f_{i,j}\psi_{i,j}(x,y)$ and $\psi_{i,j}(x,y)\subset \mathcal V_h$ is also a basis,
which is dual to the nodal basis $\phi_{ij}(x,y)$. namely $(\psi_{i,j}(x,y), \phi_{i,j}(x,y))_{L^2}=\delta_{(i,j), (p,q)}$.

The gradient descent for \eqref{FE:eq} is equivalent to the damped Jacobi method for \eqref{FE:eq} and can be written as follows
$$
u^k=u^{k-1}+S_0(f-K_A\ast u^{k-1}),~~~1\le k\le m_1.
$$
Smoother  is equivalent to filter (filtering out high frequncies). Given any $u^0$, $u-u^k$ is much smoother than $u-u^0$.

%Fine grid smoothing $\Longleftrightarrow$ feature extraction.

After smoothing, we do coarse grid correction: for example, for
$\mathcal T_h,~\mathcal T_H,~H=2h, \mathcal V_2=\mathcal V_H\subset \mathcal V_h=\mathcal V_1$, we do
\begin{itemize}
\item $K_A\ast e=f- K_A\ast u^{m_1}=r^h$;
\item  $u=u^{m_1}+e$;
\item  $K_A\ast u=f$.
\end{itemize}
We need to solve the residual equation
$$
K_A\ast e=r^h.
$$
Multigrid idea: solve this residual  equation on coarse grid space $\mathcal V_H$ with $H=2h$

\subsection{Pooling or restriction}\label{sec:cnn-restriction}
Solving the residual equation
$$
K_A\ast e=r^h
$$
in matrix form is equivalent to solve the problem
\begin{equation}\label{FEres}
a(e_h, v_h)=(r_h,v_h)~~\forall~~v_h\in \mathcal V_h,
\end{equation}
where
\begin{equation}\label{expresion:residual}
e_h=\sum_{i=1}^{m_1}\sum_{j=1}^{n_1}e^h_{i,j}\phi^h_{i,j}(x,y), r_h=\sum_{i=1}^{m_1}\sum_{j=1}^{n_1}r^h_{i,j}\psi^h_{i,j}(x,y).
\end{equation}
We solve the equation \eqref{FEres} on the coarse grid space $\mathcal V_H$, namely
\begin{equation}\label{FEres:coarse}
a(e_{2h}, v_{2h})=(r_h,v_{2h})~~\forall~~v_{2h}\in \mathcal V_{2h},
\end{equation}
where $e_{2h}=\sum_{i=1}^{m_2}\sum_{j=1}^{n_2}e^{2h}_{i,j}\phi^{2h}_{i,j}(x,y)$, the matrix form for \eqref{FEres:coarse} is
\begin{equation}\label{coarse:matrix}
K_A\ast e^{2h}=r^{2h},~~r_{i,j}^{2h}=(r_h,\phi^{2h}_{i,j})
\end{equation}
\begin{equation}\label{restriction}
r_{i,j}^{2h}=(r_h,\phi^{2h}_{i,j})
\end{equation}
Now we consider the expression of nodal basis functions $(\phi_{i,j}^{2h})(x,y)\subset \mathcal V_{2h}$
by the nodal basis functions $(\phi_{i,j}^{h})(x,y)\subset \mathcal V_{h}$. Here, we only show the details of the case of
bilinear finite element space. The case of linear finite element space can be shown similarly.
\begin{equation}\label{basis:plongation}
\begin{split}
\phi_{i,j}^{2h}(x,y)&=\phi_{2i,2j}^{h}(x,y)+\frac{1}{2}\left(\phi_{2i-1,2j}^{h}(x,y)+\phi_{2i,2j-1}^{h}(x,y)
+\phi_{2i+1,2j}^{h}(x,y)+\phi_{2i,2j+1}^{h}(x,y)\right)\\
&+\frac{1}{4}\left(\phi_{2i-1,2j-1}^{h}(x,y)+\phi_{2i+1,2j-1}^{h}(x,y)
+\phi_{2i+1,2j+1}^{h}(x,y)+\phi_{2i-1,2j+1}^{h}(x,y)\right)
\end{split}
\end{equation}

\input{6DL/MgNet_ConvStride.tex}

\subsection{Prolongation under the convolution notation}
Denote $\phi^h=\{\phi^h_{i,j}\}\in \mathbb R^{m_1\times n_1}$,
by the definitions of convolution \eqref{con1} and stride \eqref{stride}, \eqref{basis:plongation} means that
$$
 \phi^{2h}=K_R\ast_2 \phi^{h},
$$
where
\begin{equation}\label{bi-restrict}
	K_R=
	\begin{pmatrix}
	\frac{1}{4} &\frac{1}{2}&\frac{1}{4}\\
	\frac{1}{2}& 1&\frac{1}{2}\\
	\frac{1}{4}&\frac{1}{2}&  \frac{1}{4}
	\end{pmatrix}.
	\end{equation}
Now we derivatve of restriction and prolongation as follows.

Let $r_{i,j}^{2h}=(r_h,\phi^{2h}_{i,j})_{L^2(\Omega)}$, then we have
\begin{equation}
\begin{split}
 r^{2h}&=\int_{\Omega} r_h \phi^{2h}=\sum\limits_{i=1}^{m_1}\sum\limits_{j=1}^{n_1}\int_{\Omega}r_{i,j}^{h}\psi_{i,j}(K_R\ast_2) \phi^h
=\sum\limits_{i=1}^{m_1}\sum\limits_{j=1}^{n_1}r_{i,j}^{h}(K_R\ast_2)\int_{\Omega}\psi_{i,j} \phi^h\\
&=\sum\limits_{i=1}^{m_1}\sum\limits_{j=1}^{n_1}(K_R\ast_2)r_{i,j}^{h}e_ie_j=K_R\ast_2 r^{h}.
\end{split}
\end{equation}
Hence the restriction
$$
R^{2h}_h: \mathbb R^{m_{1}\times n_{1}}\mapsto  \mathbb R^{m_{2}\times n_{2}}
$$
is obtain by $R^{2h}_h  r^{h}= K_R\ast_2  r^{h}$, namely
\begin{equation}\label{restriction:freedom}
\begin{split}
r_{i,j}^{2h}&=r^{h}_{2i,2j}+\frac{1}{2}(r^{h}_{2i-1,2j}+r^{h}_{2i,2j-1}+r^{h}_{2i+1,2j}+r^{h}_{2i,2j+1})\\
&+\frac{1}{4}\left(r^{h}_{2i-1,2j-1}+r^{h}_{2i+1,2j-1}+r^{h}_{2i+1,2j+1}+r^{h}_{2i-1,2j+1}\right).
\end{split}
\end{equation}
.

Next
let $u_{2h}=\sum\limits_{i=1}^{m_2}\sum\limits_{j=1}^{n_2}u_{i,j}^{2h}\phi^{2h}_{i,j}=( u^{2h}, \phi^{2h})_{l^2}$, then we have
\begin{equation}
%\begin{split}
u_{2h}=( u^{2h}, \phi^{2h})_{l^2}
=( u^{2h}, K_R\ast_2\phi^{h})_{l^2}=(K_R\ast_2^{\top} u^{2h}, \phi^{h})_{l^2}.
%\end{split}
\end{equation}
Thus the prolongation $P_{2h}^h u^{2h}=K_R\ast_2^{\top} u^{2h}$. Therefore by the definition of $K_R$ and equations
\eqref{eq:7} and \eqref{eq:9} for the expression of $K_R\ast_2^{\top}$, we have
 the prolongation
$$
P_{2h}^h: \mathbb R^{m_{2}\times n_{2}}\mapsto  \mathbb R^{m_{1}\times n_{1} }
$$
is defined by
$$
u^h_{2i,2j}=u^h_{i,j},
$$
$$
u^h_{2i-1,2j}=\frac{1}{2}(u^h_{i,j}+u^h_{i-1,j}),~~~ u^h_{2i,2j-1}=\frac{1}{2}(u^{2h}_{i,j}+u^{2h}_{i,j-1})
$$
and
$$
u^h_{2i-1,2j-1}=\frac{1}{4}(u^{2h}_{i,j}+u^{2h}_{i-1,j}+u^{2h}_{i-1,j-1}+u^{2h}_{i,j-1}).
$$
In summery, for general $\mathcal V_1=\mathcal  V_\ell,  \mathcal V_2=\mathcal  V_{\ell+1}$, we have the restriction and prolongation
as follows:
\begin{lemma}\label{ris:plon}
The restriction
$$
R^{\ell+1}_\ell: \mathbb R^{m_\ell\times n_\ell}\mapsto  \mathbb R^{m_{\ell+1}\times n_{\ell+1}}~~\hbox{is}~~ R^{\ell+1}_\ell = K_R\ast_2
$$
and the prolongation
$$
P_{\ell+1}^{\ell}: \mathbb R^{m_{\ell+1}\times n_{\ell+1}}\mapsto  \mathbb R^{m_{\ell}\times n_{\ell} } ~~\hbox{is}~~ P^{\ell}_{\ell+1} =K_R\ast_2^{\top}
$$
where
\begin{equation}\label{bi-restrict}
	K_R=
	\begin{pmatrix}
	\frac{1}{4} &\frac{1}{2}&\frac{1}{4}\\
	\frac{1}{2}& 1&\frac{1}{2}\\
	\frac{1}{4}&\frac{1}{2}&  \frac{1}{4}
	\end{pmatrix}.
	\end{equation}
	for bilinear finite element space or
\begin{equation}\label{li-restrict}
	K_R=
	\begin{pmatrix}
	0&\frac{1}{2}&\frac{1}{2}\\
	\frac{1}{2}& 1&\frac{1}{2}\\
	 \frac{1}{2} &\frac{1}{2}& 0
	\end{pmatrix}.
	\end{equation}
for bilinear finite element space.
\end{lemma}