Definition of Analytic Functions
i) A complex function $f(z)$ is said at a point $z_0$, if $f$ is differentiable not only at $z_0$ but at every point of some neighborhood.
ii) A function $f(z)$ is analytic in a domain if it is analytic at every point of that domain.
iii) The point at which the function is not differentiable is called a singular point of the function.
iv) An entire function is a function which is analytic everywhere. Example is polynomial rational functions are entire.
There are two theorems that supports the analyticity of Functions. They are called Necessary condition and sufficient condition.

Theorem: Necessary Condition for $f(z)$ to be Analytic.
The necessary condition for a function to $f(z)=u+iv$ to be analytic at all the points in a region R are:
i) $\frac{\delta{u}}{\delta{x}}= \frac{\delta{v}}{\delta{y}}$
ii) $\frac{\delta{u}}{\delta{y}}= \frac{—\delta{v}}{\delta{x}}$
Provided $\frac{\delta{u}}{\delta{x}}, \frac{\delta{u}}{\delta{y}}, \frac{\delta{v}}{\delta{x}}, \frac{\delta{v}}{\delta{y}}$ exists.

Proof: Let $f(z)$ be an Analytic function in a region R, $f(z)=u+iv$ where $u$ and $v$ are the functions of $x$ and $y$.
Let $\delta{u}$ and $\delta{v}$ be the increment of $u$ and $v$ respectively corresponding to increments $\delta{x}$ and $\delta{y}$ of $x$ and $y$.
Therefore \begin{equation*} f(z+\delta{z})=(u+\delta{u})+i(v+\delta{v})\end{equation*}
Now
\begin{equation*}
\frac{f(z+\delta{z})—f(z)}{\delta{z}}= \frac{(u+\delta{u}) +i(v+dv)—(u+iv)}{\delta{z}}
\end{equation*}

\begin{equation*}=\frac{u+\delta{u}+iv+i\delta{v}—u—vi}{\delta{z}}
= \frac{\delta{u}+i\delta{v} }{\delta{z}}
\end{equation*}
\begin{equation*} =\frac{\delta{u}}{\delta{z}}+i\frac{\delta{v}}{\delta{z}}
\end{equation*}
Now we take the limits
$\lim_{dz\rightarrow{0}}[\frac{\delta{u}}{\delta{z}}+i\frac{\delta{v}}{\delta{z}}]$......(i)
Now along the real axis: $z=x+iy$ but on x-axis, y=0, z=x,
$\delta{z}= \delta{x}$,
$\delta{y}=0$ so putting these values in (i) we have
$f'(z)=\lim_{dz\rightarrow{0}}[\frac{\delta{u}}{\delta{z}}+i\frac{\delta{v}}{\delta{z}}]
=\frac{du}{dx}+i\frac{dv}{dx}$....... (ii)
Now along the imaginary axis(y-axis) : since $z=x+iy$ but on y-axis, x=0 so $z=0+iy$, $\delta{x}=0$, $\delta{z}=i\delta{y}$ putting this values into (i)
\begin{equation*}
f'(z)= \lim_{dy\rightarrow{0}} [\frac{\delta{u}}{i\delta{y}}+\frac{i\delta{v}}{i\delta{y}}
\end{equation*}
\begin{equation*}= \lim_{dy\rightarrow{0}} [\frac{—i\delta{u}}{\delta{y}}+
\frac{\delta{v}} {\delta{y}}]
= \frac{—du}{dy}+
\frac{dv}{dy}
\end{equation*}...... (iii)
If f(z) is differentiable then the two
Values of f(z)  must be the same. Hence equation (ii) and (iii)
$\frac{du}{dx}+\frac{idv}{dx}= \frac{—idu}{dy}+\frac{dv}{dy}$
Equating real  and imaginary parts Yields
$\frac{du}{dx}= \frac{dv}{dy}$ and $\frac{dv}{dx}= \frac{—du}{dy}$
And this is known as the cauchy Riemann equation, hence we can conclude that for a function to be analytic then it must satisfy the cauchy Riemann equation.