Complex Analysis
Complex Analysis is the study of functions of a complex variable . It reveals a profound rigidity: if a complex function is differentiable once, it is differentiable infinitely many times.
Holomorphic Functions
A function is holomorphic if it is complex-differentiable. This requires the Cauchy-Riemann Equations:
python
1def check_cauchy_riemann(f, z, h=1e-7):
2 # Numerical gradient check
3 dz_x = f(z + h) - f(z)
4 dz_y = f(z + h*1j) - f(z)
5
6 df_dx = dz_x / h
7 df_dy = dz_y / (h*1j)
8
9 # In a holomorphic function, df/dz should be the same
10 # regardless of the direction of the limit.
11 is_holomorphic = abs(df_dx - df_dy) < 1e-5
12 return is_holomorphic, df_dx, df_dy
13
14# Test f(z) = z^2 (Holomorphic)
15f1 = lambda z: z**2
16print(f"z^2 at 1+i: {check_cauchy_riemann(f1, 1+1j)}")
17
18# Test f(z) = conj(z) (Non-holomorphic)
19f2 = lambda z: z.conjugate()
20print(f"conj(z) at 1+i: {check_cauchy_riemann(f2, 1+1j)}")
Complex Integration and Cauchy’s Theorem
If is holomorphic in a simply connected domain, the line integral along any closed path is zero:
However, if the domain has “holes” (singularities), we apply the Residue Theorem:
What is the integral of 1/z around a unit circle centered at the origin?
Conformal Mappings
Holomorphic functions are conformal maps, meaning they preserve angles between curves. This property is vital in fluid dynamics and electromagnetism.
python
1import numpy as np
2
3def transform_grid(f, points):
4 return [f(p) for p in points]
5
6# Grid of points
7grid = [x + y*1j for x in np.linspace(-1, 1, 5) for y in np.linspace(-1, 1, 5)]
8
9# Exponential map: mapping lines to circles/rays
10f_exp = lambda z: np.exp(z)
11transformed = transform_grid(f_exp, grid)
12
13print(f"First 5 Original: {grid[:5]}")
14print(f"First 5 Transformed: {[f'{t:.2f}' for t in transformed[:5]]}")
Laurent Series and Singularities
Functions can be expanded into Laurent series near singularities:
- Removable singularity: No negative power terms.
- Pole of order m: Finite negative terms up to .
- Essential singularity: Infinitely many negative power terms.