- Published on
Engineering Mathematics: Complex Analysis Complete Guide - Cauchy Theorem to Residues
- Authors

- Name
- Youngju Kim
- @fjvbn20031
Engineering Mathematics: Complex Analysis and Z-Transform Complete Guide
In electrical and control engineering, complex numbers are far more than a mathematical abstraction. Phasors in AC circuit analysis, in the Laplace transform, the unit circle in the Z-transform, complex frequency response in Bode plots — all of these are rooted in complex analysis. This guide takes you from the complex number system through the residue theorem, Z-transform, and digital filter design.
1. The Complex Number System
1.1 Representations of Complex Numbers
Rectangular Form:
(Electrical engineers use instead of , since denotes current.)
- Real part:
- Imaginary part:
Polar Form:
- Magnitude:
- Argument (phase): (accounting for quadrant)
Euler's Formula:
From this:
Often called the most beautiful formula in mathematics, Euler's Identity:
Five of the most important numbers (, , , , ) united in a single equation.
De Moivre's Formula:
n-th roots: ,
These represent equally-spaced points on the unit circle. (The n-th roots of unity: — you will see these in the FFT!)
1.2 Complex Arithmetic
Addition/Subtraction (rectangular form is convenient):
Multiplication (polar form is convenient):
Magnitudes multiply, phases add — the foundation of impedance multiplication in electrical engineering.
Division:
Complex Conjugate:
Useful properties:
1.3 Engineering Application: Phasor Analysis
The power of complex numbers is on full display in AC circuit analysis.
Expressing as a phasor:
Impedance:
Series RLC impedance:
Resonance condition: implies , (pure resistance).
2. Complex Functions and Analytic Functions
2.1 Complex Functions
where and are real-valued functions.
Examples:
2.2 Complex Differentiation and the Cauchy-Riemann Equations
The complex derivative of :
Unlike real analysis, can approach 0 from any direction in the complex plane, and the limit must be the same regardless of direction.
Along the real axis ():
Along the imaginary axis ():
For these two expressions to be equal:
These are the Cauchy-Riemann Equations.
If the partial derivatives of and are continuous and satisfy the Cauchy-Riemann equations, is an analytic function.
2.3 Harmonic Functions
The real and imaginary parts of an analytic function each satisfy Laplace's equation:
From Cauchy-Riemann: and , so .
Given , the Cauchy-Riemann equations allow you to find the harmonic conjugate .
Engineering significance: velocity potential and stream function in potential flow; electric potential and field lines in electrostatics.
import numpy as np
import matplotlib.pyplot as plt
# Visualize Cauchy-Riemann orthogonality for f(z) = z^2
x = np.linspace(-2, 2, 400)
y = np.linspace(-2, 2, 400)
X, Y = np.meshgrid(x, y)
U = X**2 - Y**2 # Re(z^2)
V = 2 * X * Y # Im(z^2)
fig, axes = plt.subplots(1, 2, figsize=(12, 5))
for ax, data, title in zip(axes, [U, V],
['Re(z^2) = x^2 - y^2', 'Im(z^2) = 2xy']):
c = ax.contour(X, Y, data, levels=20, cmap='RdBu')
ax.set_title(title)
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_aspect('equal')
plt.colorbar(c, ax=ax)
plt.suptitle('Level curves of f(z)=z^2: orthogonal grids (Cauchy-Riemann)', fontsize=12)
plt.tight_layout()
plt.savefig('cauchy_riemann_z2.png', dpi=150)
plt.show()
2.4 Important Analytic Functions
Trigonometric functions:
Unlike their real counterparts, they can become unbounded: .
Logarithm (multi-valued):
Principal value: , . Singularities occur at and along the negative real axis (branch cut).
3. Complex Integration
3.1 Contour Integrals
: a curve parameterized by ,
Example: along the straight line from to
Parameterization: , ,
3.2 Cauchy's Integral Theorem
Condition: analytic on and inside the simple closed curve .
Intuition: the integral of an analytic function is path-independent. Using Green's theorem together with the Cauchy-Riemann equations forces both real parts of the integral to vanish.
Antiderivative: if , then .
3.3 Cauchy's Integral Formula
Conditions: analytic on and inside ; lies inside .
Higher-order derivative formula:
This proves that analytic functions are infinitely differentiable.
import numpy as np
def cauchy_integral_formula(f, a, R=1.0, N=2000):
"""Numerically verify f(a) = (1/2pi*i) integral f(z)/(z-a) dz."""
theta = np.linspace(0, 2*np.pi, N, endpoint=False)
z = a + R * np.exp(1j * theta)
dz = np.diff(np.append(z, z[0]))
integrand = f(z[:-1]) / (z[:-1] - a)
return np.sum(integrand * dz) / (2 * np.pi * 1j)
a = 1 + 1j
numerical = cauchy_integral_formula(np.exp, a)
print(f"Cauchy formula result : {numerical:.6f}")
print(f"Exact exp(1+j) : {np.exp(a):.6f}")
print(f"Error : {abs(numerical - np.exp(a)):.2e}")
4. Laurent Series and the Residue Theorem
4.1 Taylor Series vs Laurent Series
Taylor series (analytic at ):
Laurent series (annular region ):
The negative-power terms form the principal part. The difference: Laurent series can represent functions with singularities; the structure of the principal part classifies the singularity.
4.2 Classification of Singularities
Removable: no negative-power terms. Example: at .
Pole of order m: finitely many negative-power terms; with analytic and .
Essential singularity: infinitely many negative-power terms. Example: at .
Picard's theorem: near an essential singularity, takes almost every complex value.
4.3 The Residue Theorem
Residue: the coefficient of in the Laurent expansion.
Computing residues:
Simple pole:
Rational at a simple pole:
Pole of order :
Residue Theorem:
where are all singularities inside .
4.4 Evaluating Real Integrals
Example 1:
Pole in the upper half-plane: . Residue: . By the residue theorem and Jordan's lemma:
Example 2:
Consider . Pole at , residue . Taking the real part: .
Example 3:
Substitute , :
4.5 Inverse Laplace Transform via Residues
Bromwich Integral:
Example: , poles
5. Conformal Mappings
5.1 Definition and Angle Preservation
An analytic function with defines a conformal mapping: it preserves angles and orientation between curves at every point.
5.2 Mobius Transformation
Properties:
- Maps circles and lines to circles and lines
- Any three distinct points can be mapped to any other three
- Composition of Mobius maps is again a Mobius map
Key examples:
- : inversion
- : maps the unit disk to itself
- : maps the unit disk to the right half-plane
5.3 Engineering Applications
Potential flow: conformal mappings transform complicated domain geometries (e.g., airfoils) into simple ones (half-plane, disk), enabling analytic solutions.
Electrostatics: find field distributions between irregular electrodes by mapping to standard geometries.
Digital filter design: the bilinear transform is a conformal map converting the axis exactly onto the unit circle.
import numpy as np
import matplotlib.pyplot as plt
def mobius(z, a=1, b=-1, c=1, d=1):
return (a * z + b) / (c * z + d)
theta = np.linspace(0, 2*np.pi, 300)
r_vals = [0.3, 0.6, 0.9, 1.0]
fig, axes = plt.subplots(1, 2, figsize=(12, 6))
for r in r_vals:
z_c = r * np.exp(1j * theta)
w_c = mobius(z_c)
axes[0].plot(z_c.real, z_c.imag, linewidth=1.5)
axes[1].plot(w_c.real, w_c.imag, linewidth=1.5)
for phi in np.linspace(0, 2*np.pi, 12, endpoint=False):
r_line = np.linspace(0.01, 0.99, 100)
z_l = r_line * np.exp(1j * phi)
w_l = mobius(z_l)
axes[0].plot(z_l.real, z_l.imag, 'gray', alpha=0.4, linewidth=0.8)
axes[1].plot(w_l.real, w_l.imag, 'gray', alpha=0.4, linewidth=0.8)
for ax, title in zip(axes, ['z-plane (unit disk)', 'w-plane: w = (z-1)/(z+1)']):
ax.set_xlim([-2, 2])
ax.set_ylim([-2, 2])
ax.axhline(0, color='k', linewidth=0.5)
ax.axvline(0, color='k', linewidth=0.5)
ax.set_aspect('equal')
ax.set_title(title)
ax.grid(True, alpha=0.3)
plt.tight_layout()
plt.savefig('mobius_transform.png', dpi=150)
plt.show()
6. Z-Transform
6.1 Definition and Region of Convergence
Region of Convergence (ROC):
- Causal signal:
- Anti-causal signal:
- Two-sided signal: annular region
6.2 Key Z-Transform Pairs
| Signal | | ROC | | --------------------------- | ------------------------------------------ | ------- | --- | --- | --- | --- | | | | all | | | | | | | | | | | | | | | | |
6.3 Properties of the Z-Transform
- Time shift: ( = unit delay operator)
- Convolution:
- Final value:
6.4 Digital Filter Design
Transfer function:
Stability: all poles must satisfy .
FIR: poles only at origin — always stable, can achieve linear phase.
IIR: feedback poles can be anywhere — sharper characteristics with fewer coefficients, but requires stability check.
from scipy import signal
import numpy as np
import matplotlib.pyplot as plt
b, a = signal.butter(4, 0.2, btype='low')
w, h = signal.freqz(b, a, worN=2048)
zeros, poles, gain = signal.tf2zpk(b, a)
fig, axes = plt.subplots(1, 2, figsize=(12, 5))
axes[0].plot(w/np.pi, 20*np.log10(abs(h) + 1e-15), 'b-', linewidth=2)
axes[0].axhline(-3, color='r', linestyle='--', label='-3 dB')
axes[0].set_xlabel('Normalized Frequency')
axes[0].set_ylabel('Magnitude (dB)')
axes[0].set_title('Butterworth LPF (order 4)')
axes[0].set_xlim([0, 1])
axes[0].legend()
axes[0].grid(True, alpha=0.3)
unit_circle = np.exp(1j * np.linspace(0, 2*np.pi, 200))
axes[1].plot(unit_circle.real, unit_circle.imag, 'k--', alpha=0.5)
axes[1].scatter(zeros.real, zeros.imag, s=100, marker='o', color='blue', label='Zeros')
axes[1].scatter(poles.real, poles.imag, s=100, marker='x', color='red', linewidths=2, label='Poles')
axes[1].set_title('Pole-Zero Plot (z-plane)')
axes[1].set_aspect('equal')
axes[1].legend()
axes[1].grid(True, alpha=0.3)
plt.tight_layout()
plt.savefig('butterworth_lpf.png', dpi=150)
plt.show()
print(f"Pole magnitudes: {np.abs(poles)}")
6.5 s-Plane to z-Plane Correspondence
| s-plane | z-plane | | ------------------------------- | ------------- | --- | ---- | | axis () | Unit circle | | Left half-plane () | Interior | | Right half-plane () | Exterior |
Stability: continuous poles in left half-plane correspond to discrete poles inside the unit circle.
Bilinear transform (analog to digital without aliasing):
7. Applications to AI and Signal Processing
7.1 Complex-Valued Neural Networks
Complex-valued neural networks process signals in the amplitude-phase domain. The Wirtinger derivative generalizes complex differentiation to non-analytic functions used in machine learning, enabling gradient-based optimization in the complex domain.
7.2 Loss Landscape Geometry
Complex analysis tools characterize critical points of neural network loss functions. Saddle points, local minima, and their basins of attraction can be studied through the lens of analytic function theory and conformal geometry.
import numpy as np
import matplotlib.pyplot as plt
# Domain coloring of sin(z)/z — removable singularity at z=0
x = np.linspace(-5, 5, 600)
y = np.linspace(-3, 3, 600)
X, Y = np.meshgrid(x, y)
Z = X + 1j * Y
with np.errstate(invalid='ignore', divide='ignore'):
F = np.where(np.abs(Z) < 1e-10, 1.0 + 0j, np.sin(Z) / Z)
fig, axes = plt.subplots(1, 2, figsize=(14, 5))
im1 = axes[0].pcolormesh(X, Y, np.abs(F), cmap='viridis', vmax=2.5)
axes[0].set_title('|sin(z)/z| — modulus')
axes[0].set_xlabel('Re(z)')
axes[0].set_ylabel('Im(z)')
axes[0].set_aspect('equal')
plt.colorbar(im1, ax=axes[0])
im2 = axes[1].pcolormesh(X, Y, np.angle(F), cmap='hsv')
axes[1].set_title('arg(sin(z)/z) — phase')
axes[1].set_xlabel('Re(z)')
axes[1].set_ylabel('Im(z)')
axes[1].set_aspect('equal')
plt.colorbar(im2, ax=axes[1])
plt.suptitle('Domain coloring of sin(z)/z (removable singularity at 0)', fontsize=12)
plt.tight_layout()
plt.savefig('domain_coloring_sinc.png', dpi=150)
plt.show()
Summary and Next Steps
Topics covered in this guide:
- Complex number system: rectangular form, polar form, Euler's formula, De Moivre, phasor analysis, impedance
- Complex functions and analytic functions: Cauchy-Riemann equations, harmonic functions
- Complex integration: contour integrals, Cauchy's theorem, Cauchy's integral formula
- Laurent series and the residue theorem: singularity classification, residue computation, real integrals, inverse Laplace
- Conformal mappings: Mobius transformation, angle preservation, engineering applications
- Z-transform: ROC, key transform pairs, solving difference equations
- Digital filter design: FIR/IIR, pole-zero plots, stability, bilinear transform
- AI applications: complex-valued networks, optimization landscape geometry
The next installment covers Numerical Methods: solving equations, numerical differentiation and integration, ODE solvers, and interpolation — all implemented in Python.
References
- Churchill, R. & Brown, J. "Complex Variables and Applications", 9th Edition
- Oppenheim, A. & Schafer, R. "Discrete-Time Signal Processing", 3rd Edition
- Proakis, J. & Manolakis, D. "Digital Signal Processing", 4th Edition
- Ogata, K. "Modern Control Engineering", 5th Edition
- SciPy signal processing documentation
Quiz
Q1. What do the Cauchy-Riemann equations state, and what do they imply about analytic functions?
Answer: The Cauchy-Riemann equations are and .
Explanation: For the complex derivative to exist, the limit must be the same regardless of the direction in which approaches 0. Taking horizontal and vertical limits and equating them yields these two PDE conditions. When satisfied (with continuous partials), is analytic — infinitely differentiable and locally representable as a convergent power series. A key consequence is that both and satisfy Laplace's equation (they are harmonic functions), linking complex analysis to potential theory in physics and engineering.
Q2. Why does Cauchy's theorem say the integral of an analytic function around a closed contour is zero?
Answer: Because analytic functions have path-independent integrals, so any closed-loop integral vanishes.
Explanation: Writing in terms of and , one obtains two real line integrals. Green's theorem converts each to a double integral over the enclosed region, and the Cauchy-Riemann equations force both integrands to zero. Geometrically, since the integral depends only on endpoints, starting and ending at the same point gives zero. This is the complex-analysis counterpart of conservative vector fields: the work integral around any closed loop is zero.
Q3. What is the difference between a Taylor series and a Laurent series?
Answer: A Taylor series contains only non-negative powers of ; a Laurent series also includes negative powers.
Explanation: A Taylor series is valid when is analytic at . A Laurent series is valid in an annular region and is necessary when has a singularity at . The negative-power terms (the principal part) classify the singularity: no negative terms means removable, finitely many means a pole, and infinitely many means an essential singularity. The coefficient of is the residue, the central quantity in the residue theorem.
Q4. How does the residue theorem simplify real integral calculations?
Answer: It converts a real integral into a contour integral in the complex plane, reducing the calculation to finding residues at poles — a straightforward algebraic step.
Explanation: Many definite real integrals are difficult by real-variable methods. By extending the integrand to the complex plane, choosing a contour (e.g., a large semicircle in the upper half-plane), and showing the extra arc contributes nothing (Jordan's lemma), the residue theorem gives the answer as times the sum of enclosed residues. For this approach reduces what might be an intractable antiderivative problem to computing limits at poles.
Q5. Conformal mappings preserve angles — what are their practical applications?
Answer: Conformal mappings are used in fluid dynamics, electrostatics, and digital filter design to transform complex geometries into tractable ones while preserving governing equations.
Explanation: Because conformal maps preserve angles and the Laplacian structure, boundary-value problems in complicated domains (fluid around an airfoil, field between irregular electrodes) can be mapped to simple domains (half-plane, disk) where solutions are known. In digital signal processing, the bilinear transform is a conformal map converting the axis exactly onto the unit circle, enabling analog-to-digital filter conversion while preserving stability. The Mobius transformation class is especially versatile because it maps circles and lines to circles and lines.