# Calculus/Complex analysis

Complex analysis is the study of functions of complex variables. Complex analysis is a widely used and powerful tool in certain areas of electrical engineering, and others.
Before we begin, you may want to review Complex numbers

## Complex Numbers

Complex Numbers

## Complex Functions

A function of a complex variable is a function that can take on complex values, as well as strictly real ones. For example, suppose f(z) = z$^2$. This function sets up a correspondence between the complex number z and its square, z$^2$, just like a function of a real variable, but with complex numbers. Note that, for f(z) = z$^2$, f(z) will be strictly real if z is strictly real.
Generally we can write a function f(z) in the form f(z) = f(x+iy) = a(x,y) + ib(x,y), where a and b are real-valued functions.

## Limits and continuity

As with real-valued functions, we have concepts of limits and continuity with complex-valued functions also – our usual delta-epsilon limit definition:
    $\lim _{z\to w}f(z)=L$ iff for each $\epsilon >0$, there is a $\delta >0$ such that $|f(z)-L|<\epsilon$ for all $z$ such that $0<|z-w|<\delta$.
Note that ε and δ are real values. This is implicit in the use of inequalities: only real values are "greater than zero".
One difference between this definition of limit and the definition for real-valued functions is the meaning of the absolute value. Here we mean the complex absolute value instead of the real-valued one. Another difference is that of how z approaches w. For real-valued functions, we would only be concerned about z approaching w from the left, or from the right. In a complex setting, z can approach w from any direction in the two-dimensional complex plane: along any line passing through w, along a spiral centered at w, etc.
For example, let $f(z)=z^{2}$. Suppose we want to show that the $\lim _{z\to i}f(z)=-1$. We can write z as $i+\gamma$ where we think of γ being a small complex quantity. Note then that $z-i=\gamma$. Then, with L in our definition being -1, and w being i, we have
    $|f(z)-L|=|z^{2}+1|=|(i+\gamma )^{2}+1|=|2i\gamma +\gamma ;^{2}|$
By the triangle inequality, this last expression is less than
    $2|\gamma |+|\gamma |^{2}$
In order for this to be less than ε, we can require that
    $|\gamma |<{\frac {1}{2}}\min({\frac {\epsilon }{2}},{\sqrt {\epsilon }})$
Thus, for any $\epsilon >0$, if $\delta ={\frac {1}{2}}\min({\frac {\epsilon }{2}},{\sqrt {\epsilon }})$, and $|z-i|<\delta$, then $|f(z)-(-1)|<\epsilon$. Hence, the limit of $f(z)=z^{2}$ as z approaches i is -1.

## Differentiation and Holomorphic Functions

Since we have limits defined, we can go ahead to define the derivative of a complex function, in the usual way:
    $\lim _{\Delta z\rightarrow 0}{f(z+\Delta z)-f(z) \over \Delta z}$
provided that the limit is the same no matter how Δz approaches zero (since we are working now in the complex plane, we have more freedom!).
If such a limit exists for some value z, or some set of values - a region, we call the function holomorphic at that point or region. Continuity and being single-valued are necessary for being analytic; however, continuity and being single-valued are not sufficient for being analytic.
Many elementary functions of complex values have the same derivatives as those for real functions: for example D z$^2$ = 2z.

### Problem set

Given the above, answer the following questions.
* Find the derivative of z$^3$ from the limit definition.
* Write e$^z$ in the form a(x, y)+b(x, y)i

#### Answers

1. $\lim _{\Delta z\rightarrow 0}{(z+\Delta z)^{3}-z^{3} \over \Delta z}=\lim _{\Delta z\rightarrow 0}3z^{2}+3z\Delta z+{\Delta z}^{2}=3z^{2},$
2. $\ e^{z}=e^{x+yi}=e^{x}e^{yi}=e^{x}(\cos(y)+i\sin(y))=e^{x}\cos(y)+e^{x}\sin(y)i\,$

## Cauchy-Riemann Equations

We might wonder which sorts of complex functions are in fact differentiable. It would appear that the criterion for holomorphicity is much stricter than that of differentiability for real functions, and this is indeed the case. Suppose we have a complex function
    $f(z)=f(x+iy)=u(x,y)+i\;v(x,y)$,
where u and v are real functions. Assume furthermore that u and v are differentiable functions in the real sense. Then we can let $\Delta z$ in the definition of differentiability approach 0 by varying only x or only y. Therefore f can only be differentiable in the complex sense if
    ${\begin{cases}{\frac {\partial u}{\partial x}}={\frac {\partial v}{\partial y}}\\{\frac {\partial u}{\partial y}}=-{\frac {\partial v}{\partial x}}.\end{cases}}$
In fact, if u and v are differentiable in the real sense and satisfy these two equations, then f is holomorphic. These two equations are known as the Cauchy-Riemann equations.

## Integration

In single variable Calculus, integrals are typically evaluated between two real numbers
    $\int _{x_{1}}^{x_{2}}f(x)dx$
On the real line, there is one way to get from $x_{1}$ to $x_{2}$. In the complex plane, however, there are infinitely many different paths which can be taken between two points, $z_{0}$ and $z_{1}$. For this reason, complex integration is always done over a path, rather than between two points.
Let $\gamma$ be a path in the complex plane parametrized by $z:[a,b]\to \mathbb {C}$, and let $f(z)$ be a complex-valued function. Then the contour integral is defined analogously to the line integral from multivariable calculus:
    $\int _{\gamma }f(z)dz=\int _{a}^{b}f(z(t))z'(t)dt$
Example Let $f(z)=z$, and let $\gamma$ be a line from 0 to 1+i. This curve can be parametrized by $z(t)=t(1+i)$, with $t$ ranging from 0 to 1. Now we can compute
    $\int _{\gamma }f(z)dz=\int _{0}^{1}(t(1+i))(1+i)dt={\frac {(1+i)^{2}}{2}}=i$
Note that we also have
    $\int _{\gamma }f(z)dz={\frac {(1+i)^{2}}{2}}-{\frac {0^{2}}{2}}=i$
This indicates that complex antiderivatives can be used to simplify the evaluation of integrals, just as real antiderivatives are used to evaluate real integrals.

### Cauchy's Theorem

Cauchy's theorem states that if a function $f$ is holomorphic in the closure of an open set $\Omega$, and $\gamma$ is a simple closed curve in $\Omega$, then
    $\int _{\gamma }f(z)dz=0$
This can be understood in terms of Green's theorem, though this does not readily lead to a proof, since Green's theorem only applies under the assumption that f has continuous first partial derivatives...

#### Contour Integration

Cauchy's theorem allows for the evaluation of many improper real integrals (improper here means that one of the limits of integration is infinite). As an example, consider
    $\int _{0}^{\infty }{\frac {\sin x}{x}}dx=\lim _{\epsilon \to 0,R\to \infty }\int _{\epsilon }^{R}{\frac {\sin x}{x}}dx$
Since
    $\Im (e^{iz})=\sin z$
we consider
    $f(z)={\frac {e^{iz}}{z}}$
We now integrate over the indented semicircle contour, pictured above. We parametrize each segment of the contour as follows
    $\gamma _{1}(t)=t$, $t\in [-R,-\epsilon ]$
    $\gamma _{2}(t)=t$, $t\in [\epsilon ,R]$
    $\gamma _{3}(t)=\epsilon e^{it}$, $t\in [0,\pi ]$
    $\gamma _{4}(t)=Re^{it}$, $t\in [0,\pi ]$
By Cauchy's Theorem, the integral over the whole contour is zero. So,
    $0=\int _{\gamma }f(z)dz=\int _{\gamma _{1}}f(z)dz+\int _{\gamma _{2}}f(z)dz-\int _{\gamma _{3}}f(z)dz+\int _{\gamma _{4}}f(z)dz$
We now handle each of these integrals separately.
    $\int _{\gamma _{1}}f(z)dz=\int _{-R}^{-\epsilon }{\frac {e^{iz}}{z}}dz=-\int _{\epsilon }^{R}{\frac {e^{-iz}}{z}}dz$
    $\int _{\gamma _{2}}f(z)dz=\int _{\epsilon }^{R}{\frac {e^{iz}}{z}}dz$
Recalling the definition of the sine of a complex number,
    $\int _{\gamma _{1}}f(z)dz+\int _{\gamma _{2}}f(z)dz=\int _{\epsilon }^{R}{\frac {e^{iz}-e^{-iz}}{z}}dz=2i\int _{\epsilon }^{R}{\frac {\sin x}{x}}dx$
Now we evaluate the other two integrals
    $\int _{\gamma _{3}}f(z)dz=\int _{0}^{\pi }{\frac {e^{-\epsilon e^{it}}i\epsilon e^{it}}{\epsilon e^{it}}}dt=i\int _{0}^{\pi }e^{-\epsilon e^{it}}dt$
As $\epsilon \to 0$, the integrand approaches one, so
    $\lim _{\epsilon \to 0}\int _{\gamma _{3}}f(z)dz=i\int _{0}^{\pi }dt=\pi i$
The fourth integral is equal to zero, but this is somewhat more difficult to show. Its form is similar to that of the third segment:
    $\int _{\gamma _{4}}f(z)dz=\int _{0}^{\pi }e^{-Re^{it}}dt$
This integrand is more difficult, since it need not approach zero everywhere. This difficulty can be overcome by splitting up the integral, but here we simply assume it to be zero.
Combining everything, we now have
    $\int _{\gamma }f(z)dz=0=2i\int _{0}^{\infty }{\frac {\sin x}{x}}dx-\pi i$
Hence,
    $\int _{0}^{\infty }{\frac {\sin x}{x}}dx={\frac {\pi }{2}}$

### Cauchy's Integral Formula

Cauchy's integral formula characterizes the behavior of holomorphics functions on a set based on their behavior on the boundary of that set. If $\Omega$ is an open set with a piecewise smooth boundary and $f$ is holomorphic in ${\bar {\Omega }}$, then
    $f(z)={\frac {1}{2\pi i}}\int _{\partial \Omega }{\frac {f(\zeta )d\zeta }{\zeta -z}}\ \ \ \forall z\in \Omega$
This is a remarkable fact which has no counterpart in multivariable calculus. It says that if we know the values of a holomorphic function along a closed curve, then we know its values everywhere in the interior of the curve.
Because $z\in \Omega$, an open set, it follows that $\zeta -z\neq 0$ for all $\zeta \in \partial \Omega$. Hence the integrand in Cauchy's integral formula is infinitely differentiable with respect to z, and by repeatedly taking derivatives of both sides, we get
    $f^{(n)}(z)={\frac {n!}{2\pi i}}\int _{\partial \Omega }{\frac {f(\zeta )d\zeta }{(\zeta -z)^{n+1}}}\ \ \ \forall z\in \Omega ,n\in \mathbb {N}$
This result shows that holomorphicity is a much stronger requirement than differentiability. In the complex plane, if a function has just a single derivative in an open set, then it has infinitely many derivatives in that set.

### Corollaries of Cauchy's Theorem

Cauchy's Theorem and integral formula have a number of powerful corollaries:
* Convergence of power series If a function is holomorphic in a disc, then its Taylor series converges in this disc.
* Liouville's Theorem If a function is bounded and holomorphic in all of $\mathbb {C}$ then it is equal to a constant.
* Fundamental Theorem of Algebra All polynomials of degree greater than zero with complex coefficients have a complex root. This is a simple corollary of Liouville's theorem.
* Equality of functions If two functions $f$ and $g$ are holomorphic on a connected, open set $\Omega$, and $f(z)=g(z)$ on any disc in this set, then $f(z)=g(z)$ for all $z\in \Omega$.