14. Complex Analysis (๋ณต์†Œํ•ด์„)

14. Complex Analysis (๋ณต์†Œํ•ด์„)

Learning Objectives

  • Understand the differentiability of complex functions and the Cauchy-Riemann conditions
  • Calculate complex integrals using Cauchy's integral theorem and integral formulas
  • Expand complex functions into series through Taylor and Laurent series
  • Efficiently solve real integral problems using the residue theorem
  • Understand the concept of conformal mapping and apply it to physics problems

Importance in Physics: Complex analysis is a core tool across all of physics, including wave functions in quantum mechanics, potential theory in electrodynamics, stream functions in fluid mechanics, and frequency analysis in signal processing. In particular, integral calculations via the residue theorem are among the most frequently used techniques in theoretical physics.


1. Analytic Functions (ํ•ด์„ํ•จ์ˆ˜)

1.1 Complex Differentiation and the Cauchy-Riemann Conditions

For a complex function $f(z) = u(x, y) + iv(x, y)$ to be differentiable at a point $z_0$, the limit

$$f'(z_0) = \lim_{\Delta z \to 0} \frac{f(z_0 + \Delta z) - f(z_0)}{\Delta z}$$

must converge to the same value regardless of the direction from which $\Delta z$ approaches. This leads to the Cauchy-Riemann equations:

$$\frac{\partial u}{\partial x} = \frac{\partial v}{\partial y}, \quad \frac{\partial u}{\partial y} = -\frac{\partial v}{\partial x}$$

A function that is differentiable at every point in a region is called analytic in that region.

Polar form ($z = re^{i\theta}$):

$$\frac{\partial u}{\partial r} = \frac{1}{r}\frac{\partial v}{\partial \theta}, \quad \frac{1}{r}\frac{\partial u}{\partial \theta} = -\frac{\partial v}{\partial r}$$

import numpy as np
import matplotlib.pyplot as plt

def check_cauchy_riemann(u_func, v_func, x, y, h=1e-7):
    """์ฝ”์‹œ-๋ฆฌ๋งŒ ์กฐ๊ฑด์„ ์ˆ˜์น˜์ ์œผ๋กœ ๊ฒ€์ฆ"""
    du_dx = (u_func(x + h, y) - u_func(x - h, y)) / (2 * h)
    du_dy = (u_func(x, y + h) - u_func(x, y - h)) / (2 * h)
    dv_dx = (v_func(x + h, y) - v_func(x - h, y)) / (2 * h)
    dv_dy = (v_func(x, y + h) - v_func(x, y - h)) / (2 * h)

    cond1 = np.abs(du_dx - dv_dy)   # โˆ‚u/โˆ‚x = โˆ‚v/โˆ‚y
    cond2 = np.abs(du_dy + dv_dx)   # โˆ‚u/โˆ‚y = -โˆ‚v/โˆ‚x

    print(f"์  ({x}, {y}): |โˆ‚u/โˆ‚x - โˆ‚v/โˆ‚y| = {cond1:.2e}, "
          f"|โˆ‚u/โˆ‚y + โˆ‚v/โˆ‚x| = {cond2:.2e}")
    return cond1 < 1e-5 and cond2 < 1e-5

# f(z) = zยฒ = (xยฒ - yยฒ) + i(2xy)
u = lambda x, y: x**2 - y**2
v = lambda x, y: 2 * x * y

print("=== f(z) = zยฒ ์ฝ”์‹œ-๋ฆฌ๋งŒ ๊ฒ€์ฆ ===")
for pt in [(1, 1), (2, -1), (0.5, 3)]:
    analytic = check_cauchy_riemann(u, v, *pt)
    print(f"  ํ•ด์„์ : {analytic}")

1.2 Harmonic Functions (์กฐํ™”ํ•จ์ˆ˜)

The real part $u$ and imaginary part $v$ of an analytic function each satisfy Laplace's equation:

$$\nabla^2 u = \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} = 0, \quad \nabla^2 v = 0$$

Such functions are called harmonic functions, and $u$ and $v$ are harmonic conjugates of each other.

Physical meaning: In two-dimensional electrostatics, the potential $\phi(x,y)$ satisfies Laplace's equation and is therefore a harmonic function. The real part of an analytic function can be interpreted as the potential and the imaginary part as the electric field line function.

import sympy as sp

x, y = sp.symbols('x y', real=True)

def is_harmonic(expr):
    """๋ผํ”Œ๋ผ์‹œ์•ˆ์ด 0์ธ์ง€ ํ™•์ธ"""
    lap = sp.simplify(sp.diff(expr, x, 2) + sp.diff(expr, y, 2))
    return lap, lap == 0

# f(z) = zยณ์˜ ์‹ค์ˆ˜๋ถ€/ํ—ˆ์ˆ˜๋ถ€
u_expr = x**3 - 3*x*y**2      # Re(zยณ)
v_expr = 3*x**2*y - y**3      # Im(zยณ)

for name, expr in [("Re(zยณ)", u_expr), ("Im(zยณ)", v_expr)]:
    lap, harmonic = is_harmonic(expr)
    print(f"{name} = {expr}: โˆ‡ยฒ = {lap}, ์กฐํ™”ํ•จ์ˆ˜: {harmonic}")

1.3 Examples of Analytic Functions

Analytic functions frequently appearing in physics:

Function Real part $u$ Imaginary part $v$ Physical application
$e^z$ $e^x \cos y$ $e^x \sin y$ Waves, damping
$\ln z$ $\ln r$ $\theta$ Line charge potential
$z^n$ $r^n \cos n\theta$ $r^n \sin n\theta$ Multipole expansion
$1/z$ $x/(x^2+y^2)$ $-y/(x^2+y^2)$ Point charge, source/sink
from matplotlib.colors import hsv_to_rgb

def domain_coloring(f, xlim=(-2, 2), ylim=(-2, 2), N=500):
    """๋ณต์†Œํ•จ์ˆ˜์˜ ๋„๋ฉ”์ธ ์ปฌ๋Ÿฌ๋ง ์‹œ๊ฐํ™” (์œ„์ƒโ†’์ƒ‰์ƒ, ํฌ๊ธฐโ†’๋ช…๋„)"""
    xv = np.linspace(*xlim, N)
    yv = np.linspace(*ylim, N)
    X, Y = np.meshgrid(xv, yv)
    Z = X + 1j * Y

    with np.errstate(divide='ignore', invalid='ignore'):
        W = f(Z)

    H = (np.angle(W) + np.pi) / (2 * np.pi)
    V = 1 - 1 / (1 + np.abs(W)**0.3)
    HSV = np.stack([H, np.ones_like(H), V], axis=-1)

    fig, ax = plt.subplots(figsize=(6, 6))
    ax.imshow(hsv_to_rgb(HSV), extent=[*xlim, *ylim], origin='lower')
    ax.set_xlabel('Re(z)'); ax.set_ylabel('Im(z)')
    plt.tight_layout(); plt.show()

# domain_coloring(lambda z: z**3)       # zยณ์˜ ๋„๋ฉ”์ธ ์ปฌ๋Ÿฌ๋ง
# domain_coloring(lambda z: np.exp(z))  # e^z์˜ ๋„๋ฉ”์ธ ์ปฌ๋Ÿฌ๋ง

2. Complex Integrals (๋ณต์†Œ ์ ๋ถ„)

2.1 Contour Integrals (๊ฒฝ๋กœ ์ ๋ถ„)

Integrating a complex function along a path $C$ is called a contour integral:

$$\oint_C f(z)\, dz = \int_a^b f(z(t))\, z'(t)\, dt$$

Key result: For counterclockwise integration over $|z - z_0| = r$:

$$\oint \frac{dz}{(z - z_0)^n} = \begin{cases} 2\pi i & n = 1 \\ 0 & n \neq 1 \end{cases}$$

def contour_integral_circle(f, z0=0, r=1, N=10000):
    """์›ํ˜• ๊ฒฝ๋กœ |z-z0|=r ์œ„์—์„œ์˜ ๊ฒฝ๋กœ ์ ๋ถ„ (์ˆ˜์น˜ ๊ณ„์‚ฐ)"""
    t = np.linspace(0, 2*np.pi, N, endpoint=False)
    dt = 2*np.pi / N
    z = z0 + r * np.exp(1j * t)
    dz_dt = 1j * r * np.exp(1j * t)
    return np.sum(f(z) * dz_dt) * dt

# โˆฎ 1/z dz = 2ฯ€i
I1 = contour_integral_circle(lambda z: 1/z)
print(f"โˆฎ 1/z dz = {I1:.6f}  (์ด๋ก ๊ฐ’: {2*np.pi*1j:.6f})")

# โˆฎ 1/zยฒ dz = 0
I2 = contour_integral_circle(lambda z: 1/z**2)
print(f"โˆฎ 1/zยฒ dz = {I2:.6f}  (์ด๋ก ๊ฐ’: 0)")

# โˆฎ e^z/z dz = 2ฯ€i (์ฝ”์‹œ ๊ณต์‹: f(0)=eโฐ=1)
I3 = contour_integral_circle(lambda z: np.exp(z)/z)
print(f"โˆฎ e^z/z dz = {I3:.6f}  (์ด๋ก ๊ฐ’: {2*np.pi*1j:.6f})")

2.2 Cauchy's Integral Theorem (์ฝ”์‹œ ์ ๋ถ„ ์ •๋ฆฌ)

If $f(z)$ is analytic in a simply connected region $D$, then for any closed curve $C$ in $D$:

$$\oint_C f(z)\, dz = 0$$

Physical meaning: This is equivalent to the circulation of a conservative force being zero. The integral of an analytic function is path-independent.

2.3 Cauchy's Integral Formula (์ฝ”์‹œ ์ ๋ถ„ ๊ณต์‹)

If $f(z)$ is analytic inside $C$ and $z_0$ is an interior point:

$$f(z_0) = \frac{1}{2\pi i} \oint_C \frac{f(z)}{z - z_0}\, dz$$

Generalization (nth derivative):

$$f^{(n)}(z_0) = \frac{n!}{2\pi i} \oint_C \frac{f(z)}{(z - z_0)^{n+1}}\, dz$$

This formula means that analytic functions are infinitely differentiable, and boundary values determine interior values.

from math import factorial

def cauchy_derivative(f, z0, n=0, r=1, N=10000):
    """์ฝ”์‹œ ์ ๋ถ„ ๊ณต์‹์œผ๋กœ f^(n)(z0) ๊ณ„์‚ฐ"""
    t = np.linspace(0, 2*np.pi, N, endpoint=False)
    dt = 2*np.pi / N
    z = z0 + r * np.exp(1j * t)
    dz_dt = 1j * r * np.exp(1j * t)
    integrand = f(z) / (z - z0)**(n + 1) * dz_dt
    return np.sum(integrand) * dt * factorial(n) / (2*np.pi*1j)

# ๊ฒ€์ฆ: f(z) = sin(z)
f = lambda z: np.sin(z)
print("์ฝ”์‹œ ๊ณต์‹ ๊ฒ€์ฆ: f(z) = sin(z)")
print(f"  f(0)   = {cauchy_derivative(f, 0, 0):.6f}  (์ •ํ™•๊ฐ’: 0)")
print(f"  f'(0)  = {cauchy_derivative(f, 0, 1):.6f}  (์ •ํ™•๊ฐ’: 1)")
print(f"  f''(0) = {cauchy_derivative(f, 0, 2):.6f}  (์ •ํ™•๊ฐ’: 0)")
print(f"  f'''(0)= {cauchy_derivative(f, 0, 3):.6f}  (์ •ํ™•๊ฐ’: -1)")

3. Series Expansions (๊ธ‰์ˆ˜ ์ „๊ฐœ)

3.1 Taylor Series

If $f(z)$ is analytic inside a circle of radius $R$ centered at $z_0$:

$$f(z) = \sum_{n=0}^{\infty} a_n (z - z_0)^n, \quad a_n = \frac{f^{(n)}(z_0)}{n!}$$

The radius of convergence $R$ is the distance from $z_0$ to the nearest singularity.

Example: The radius of convergence of the Taylor series of $f(z) = 1/(1+z^2)$ around $z=0$ is $R=1$. This is because there are poles at $z = \pm i$. Although there are no singularities on the real axis, singularities in the complex plane determine the radius of convergence.

3.2 Laurent Series (๋กœ๋ž‘ ๊ธ‰์ˆ˜)

If $f(z)$ is analytic in an annular region $r < |z - z_0| < R$:

$$f(z) = \sum_{n=-\infty}^{\infty} a_n (z - z_0)^n$$

Terms with $n < 0$ are called the principal part, and specifically $a_{-1}$ is called the residue.

z = sp.Symbol('z')

# ๋กœ๋ž‘ ๊ธ‰์ˆ˜: e^z / zยณ (z=0 ์ฃผ์œ„)
f1 = sp.exp(z) / z**3
print("e^z/zยณ ์˜ ๋กœ๋ž‘ ๊ธ‰์ˆ˜:")
print(f"  {sp.series(f1, z, 0, n=5)}")
print(f"  ์œ ์ˆ˜ (zโปยน ๊ณ„์ˆ˜) = 1/2\n")

# ๋กœ๋ž‘ ๊ธ‰์ˆ˜: 1/(z(z-1)) (z=0 ์ฃผ์œ„)
f2 = 1 / (z * (z - 1))
print("1/(z(z-1)) ์˜ ๋กœ๋ž‘ ๊ธ‰์ˆ˜ (z=0 ์ฃผ์œ„):")
print(f"  {sp.series(f2, z, 0, n=4)}")

# z=1 ์ฃผ์œ„
w = sp.Symbol('w')
print("\n1/(z(z-1)) ์˜ ๋กœ๋ž‘ ๊ธ‰์ˆ˜ (z=1 ์ฃผ์œ„, w=z-1):")
print(f"  {sp.series(f2.subs(z, w+1), w, 0, n=4)}")

3.3 Classification of Singularities (Removable, Pole, Essential)

Type Number of principal part terms Example $\lim_{z \to z_0} f(z)$
Removable singularity 0 $\sin z / z$ at $z=0$ Finite value
Pole of order $m$ $m$ $1/z^m$ at $z=0$ $\infty$
Essential singularity Infinitely many $e^{1/z}$ at $z=0$ Does not exist

Casorati-Weierstrass theorem: Near an essential singularity, the function takes on almost every complex value.

# ํŠน์ด์  ๋ถ„๋ฅ˜ ํ™•์ธ
cases = [
    ("sin(z)/z (z=0, ์ œ๊ฑฐ๊ฐ€๋Šฅ)", sp.sin(z)/z, z, 0),
    ("1/(z-1)ยณ (z=1, 3์ฐจ ๊ทน์ )", 1/(z-1)**3, z, 1),
    ("exp(1/z) (z=0, ๋ณธ์งˆ์ )", sp.exp(1/z), z, 0),
]

for name, expr, var, pt in cases:
    if pt != 0:
        w = sp.Symbol('w')
        s = sp.series(expr.subs(var, w + pt), w, 0, n=5)
    else:
        s = sp.series(expr, var, 0, n=5)
    print(f"{name}:\n  {s}\n")

4. Residue Theorem (์œ ์ˆ˜ ์ •๋ฆฌ)

4.1 Definition and Calculation of Residues

The residue of $f(z)$ at the point $z_0$ is the $a_{-1}$ coefficient of the Laurent series:

$$\text{Res}_{z=z_0} f(z) = \frac{1}{2\pi i} \oint_C f(z)\, dz$$

Methods for calculating residues:

  1. Simple pole: $\text{Res}_{z=z_0} f = \lim_{z \to z_0} (z - z_0) f(z)$
  2. Pole of order $m$: $\text{Res}_{z=z_0} f = \frac{1}{(m-1)!} \lim_{z \to z_0} \frac{d^{m-1}}{dz^{m-1}} [(z - z_0)^m f(z)]$
  3. Form $p/q$ (simple pole): $\text{Res}_{z=z_0} \frac{p}{q} = \frac{p(z_0)}{q'(z_0)}$
z = sp.Symbol('z')

examples = [
    ("1/(zยฒ+1)", 1/(z**2+1), sp.I),
    ("1/(zยฒ+1)", 1/(z**2+1), -sp.I),
    ("e^z/zยฒ", sp.exp(z)/z**2, 0),
    ("z/(zยฒ-3z+2)", z/(z**2-3*z+2), 1),
    ("z/(zยฒ-3z+2)", z/(z**2-3*z+2), 2),
]

print("=== ์œ ์ˆ˜ ๊ณ„์‚ฐ ===")
for name, expr, z0 in examples:
    print(f"Res[{name}, z={z0}] = {sp.residue(expr, z, z0)}")

4.2 Residue Theorem

If $f(z)$ is analytic inside a closed curve $C$ except for a finite number of singularities $z_1, \ldots, z_n$:

$$\oint_C f(z)\, dz = 2\pi i \sum_{k=1}^{n} \text{Res}_{z=z_k} f(z)$$

4.3 Jordan's Lemma (์กฐ๋ฅด๋‹น ๋ณด์กฐ์ •๋ฆฌ)

When calculating real integrals using the residue theorem, we must verify that the contribution from the infinite semicircular path is zero. Jordan's lemma guarantees this.

Theorem: If $f(z) \to 0$ uniformly as $|z| \to \infty$ (upper half-plane), then for $a > 0$:

$$\lim_{R \to \infty} \int_{C_R} f(z) e^{iaz}\, dz = 0$$

where $C_R$ is a semicircle of radius $R$ in the upper half-plane. The key is that $e^{iaz} = e^{ia(x+iy)} = e^{iax}e^{-ay}$, so in the upper half-plane ($y > 0$), $e^{-ay}$ decays exponentially.

Note: If $a < 0$, use the lower half-plane semicircle, and in this case the path direction is clockwise so $(-2\pi i)$ is multiplied to the residues.

4.4 Four Types of Real Integral Calculations

The most important application of the residue theorem is the calculation of real integrals. We systematically classify them according to the form of the integral.

Type 1: Rational functions of trigonometric functions โ€” $\int_0^{2\pi} R(\cos\theta, \sin\theta)\, d\theta$

Substitution $z = e^{i\theta}$: $\cos\theta = (z + z^{-1})/2$, $\sin\theta = (z - z^{-1})/(2i)$, $d\theta = dz/(iz)$.

The integral transforms into a contour integral over the unit circle $|z| = 1$. Calculate only the residues at poles inside the unit circle.

from scipy.integrate import quad
import sympy as sp
import numpy as np

z = sp.Symbol('z')

# --- ์œ ํ˜• 1: โˆซโ‚€ยฒฯ€ dฮธ/(2 + cosฮธ) ---
print("=== ์œ ํ˜• 1: โˆซโ‚€ยฒฯ€ dฮธ/(2 + cosฮธ) ===")
integrand1 = 2 / (sp.I * (z**2 + 4*z + 1))
inner_pole = -2 + sp.sqrt(3)  # |z| < 1์ธ ๊ทน์ 
res1 = sp.residue(integrand1, z, inner_pole)
result1 = sp.simplify(2 * sp.pi * sp.I * res1)
print(f"์œ ์ˆ˜ ์ •๋ฆฌ: {result1} = {float(result1):.6f}")
num1, _ = quad(lambda t: 1/(2 + np.cos(t)), 0, 2*np.pi)
print(f"์ˆ˜์น˜ ๊ฒ€์ฆ: {num1:.6f}\n")

Type 2: Rational functions โ€” $\int_{-\infty}^{\infty} \frac{P(x)}{Q(x)}\, dx$

Condition: $\deg(Q) \geq \deg(P) + 2$ (integral converges), $Q(x) \neq 0$ on the real axis.

Use an upper half-plane semicircular path. As $R \to \infty$, the integral over the semicircle becomes 0 (since $f(z) \to 0$ sufficiently fast):

$$\int_{-\infty}^{\infty} \frac{P(x)}{Q(x)}\, dx = 2\pi i \sum_{\text{Im}(z_k) > 0} \text{Res}_{z=z_k} \frac{P(z)}{Q(z)}$$

# --- ์œ ํ˜• 2: โˆซโ‚‹โˆž^โˆž dx/(xยฒ+1)ยฒ ---
print("=== ์œ ํ˜• 2: โˆซโ‚‹โˆž^โˆž dx/(xยฒ+1)ยฒ ===")
res2 = sp.residue(1/(z**2+1)**2, z, sp.I)
result2 = sp.simplify(2 * sp.pi * sp.I * res2)
print(f"์œ ์ˆ˜ ์ •๋ฆฌ: {result2} = {float(result2):.6f}")
num2, _ = quad(lambda x: 1/(x**2+1)**2, -100, 100)
print(f"์ˆ˜์น˜ ๊ฒ€์ฆ: {num2:.6f}\n")

Type 3: Fourier-type integrals โ€” $\int_{-\infty}^{\infty} f(x) e^{iax}\, dx$ ($a > 0$)

Apply Jordan's lemma. If $f(z) \to 0$ as $|z| \to \infty$ (first-order is sufficient), the contribution from the upper half-plane semicircle is 0:

$$\int_{-\infty}^{\infty} f(x) e^{iax}\, dx = 2\pi i \sum_{\text{Im}(z_k) > 0} \text{Res}_{z=z_k} f(z) e^{iaz}$$

Integrals containing $\cos(ax)$ or $\sin(ax)$ use $e^{iax}$ and then take the real or imaginary part.

# --- ์œ ํ˜• 3: โˆซโ‚‹โˆž^โˆž cos(x)/(xยฒ+1) dx = ฯ€/e ---
print("=== ์œ ํ˜• 3: โˆซโ‚‹โˆž^โˆž cos(x)/(xยฒ+1) dx ===")
f3 = sp.exp(sp.I*z) / (z**2 + 1)
res3 = sp.residue(f3, z, sp.I)
result3 = sp.simplify(2 * sp.pi * sp.I * res3)
print(f"์œ ์ˆ˜ ์ •๋ฆฌ: Re({result3}) = ฯ€/e = {float(sp.pi/sp.E):.6f}")
num3, _ = quad(lambda x: np.cos(x)/(x**2+1), -100, 100)
print(f"์ˆ˜์น˜ ๊ฒ€์ฆ: {num3:.6f}\n")

Type 4: Branch cut integrals โ€” $\int_0^{\infty} x^{a-1} f(x)\, dx$ ($0 < a < 1$)

If the integrand contains $x^a$ (where $a$ is not an integer), a branch cut is needed. Use a keyhole contour.

Representative example: $\int_0^{\infty} \frac{x^{a-1}}{1+x}\, dx = \frac{\pi}{\sin(\pi a)}$ ($0 < a < 1$)

Solution strategy: 1. Choose the positive real axis as the branch cut for $f(z) = z^{a-1}/(1+z)$ 2. Keyhole contour: above branch cut โ†’ large circle โ†’ below branch cut โ†’ small circle 3. Below the branch cut, $z^{a-1} = |z|^{a-1} e^{2\pi i(a-1)}$ 4. Residue at $z = -1$: $e^{i\pi(a-1)} = -e^{i\pi a}$

$$\int_0^{\infty} \frac{x^{a-1}}{1+x} dx - e^{2\pi i(a-1)} \int_0^{\infty} \frac{x^{a-1}}{1+x} dx = 2\pi i \cdot (-e^{i\pi a})$$

$$(1 - e^{2\pi i(a-1)}) I = -2\pi i e^{i\pi a} \implies I = \frac{\pi}{\sin(\pi a)}$$

# --- ์œ ํ˜• 4: โˆซโ‚€^โˆž x^{a-1}/(1+x) dx = ฯ€/sin(ฯ€a) ---
print("=== ์œ ํ˜• 4: โˆซโ‚€^โˆž x^{a-1}/(1+x) dx ===")
for a in [0.25, 0.5, 0.75]:
    theory = np.pi / np.sin(np.pi * a)
    numerical, _ = quad(lambda x: x**(a-1)/(1+x), 0, np.inf)
    print(f"  a = {a}: ฯ€/sin(ฯ€a) = {theory:.6f}, ์ˆ˜์น˜ = {numerical:.6f}")

5. Conformal Mapping (๋“ฑ๊ฐ์‚ฌ์ƒ)

5.1 Definition and Properties of Conformal Mapping

An analytic function $w = f(z)$ with $f'(z_0) \neq 0$ is conformal in the neighborhood of $z_0$:

  • Angle preservation: The angle of intersection of two curves is preserved after mapping
  • Laplace equation invariant: Harmonic functions remain harmonic after mapping
  • Boundary condition preservation: Physical boundary conditions remain valid after mapping

5.2 Mรถbius Transformations

$$w = \frac{az + b}{cz + d}, \quad ad - bc \neq 0$$

Properties: Maps circles and lines to circles and lines, uniquely determined by three points.

def mobius_transform(z, a, b, c, d):
    """๋ซผ๋น„์šฐ์Šค ๋ณ€ํ™˜ w = (az+b)/(cz+d)"""
    return (a*z + b) / (c*z + d)

def plot_mobius(a, b, c, d, title="๋ซผ๋น„์šฐ์Šค ๋ณ€ํ™˜"):
    """๊ฒฉ์ž์„ ์˜ ๋ซผ๋น„์šฐ์Šค ๋ณ€ํ™˜ ์‹œ๊ฐํ™”"""
    fig, axes = plt.subplots(1, 2, figsize=(12, 5))
    t = np.linspace(-2, 2, 300)

    for x0 in np.linspace(-2, 2, 9):
        zv = x0 + 1j*t; wv = mobius_transform(zv, a, b, c, d)
        axes[0].plot(zv.real, zv.imag, 'b-', alpha=0.4, lw=0.7)
        m = np.abs(wv) < 10
        axes[1].plot(wv.real[m], wv.imag[m], 'b-', alpha=0.4, lw=0.7)

    for y0 in np.linspace(-2, 2, 9):
        zv = t + 1j*y0; wv = mobius_transform(zv, a, b, c, d)
        axes[0].plot(zv.real, zv.imag, 'r-', alpha=0.4, lw=0.7)
        m = np.abs(wv) < 10
        axes[1].plot(wv.real[m], wv.imag[m], 'r-', alpha=0.4, lw=0.7)

    for ax, lab in zip(axes, ['z-ํ‰๋ฉด', 'w-ํ‰๋ฉด']):
        ax.set_xlim(-4,4); ax.set_ylim(-4,4)
        ax.set_aspect('equal'); ax.grid(True, alpha=0.3); ax.set_title(lab)
    fig.suptitle(f'{title}: w=({a}z+{b})/({c}z+{d})')
    plt.tight_layout(); plt.show()

# ์ผ€์ผ๋ฆฌ ๋ณ€ํ™˜ (์ƒ๋ฐ˜๋ฉดโ†’๋‹จ์œ„์›): w = (z-i)/(z+i)
# plot_mobius(1, -1j, 1, 1j, "์ผ€์ผ๋ฆฌ ๋ณ€ํ™˜")

5.3 Physics Applications (Fluid Mechanics, Electric Field)

Complex potential: In two-dimensional incompressible irrotational flow:

$$W(z) = \phi(x, y) + i\psi(x, y), \quad \frac{dW}{dz} = v_x - iv_y$$

$\phi$ is the velocity potential, $\psi$ is the streamline function.

Flow $W(z)$ Physical meaning
Uniform flow $Uz$ Velocity $U$
Source/sink $(Q/2\pi)\ln z$ Strength $Q$
Vortex $(-i\Gamma/2\pi)\ln z$ Circulation $\Gamma$
Doublet $\mu/z$ Dipole
Around cylinder $U(z + a^2/z)$ Radius $a$
def plot_flow(W_func, xlim=(-3,3), ylim=(-3,3), N=400, title="์œ ์„ ๋„"):
    """๋ณต์†Œ ํฌํ…์…œ๋กœ๋ถ€ํ„ฐ ์œ ์„ ๋„์™€ ๋“ฑํฌํ…์…œ์„  ์‹œ๊ฐํ™”"""
    xv = np.linspace(*xlim, N); yv = np.linspace(*ylim, N)
    X, Y = np.meshgrid(xv, yv); Z = X + 1j*Y

    with np.errstate(divide='ignore', invalid='ignore'):
        W = W_func(Z)
    phi, psi = np.real(W), np.imag(W)
    mask = np.abs(W) > 50; phi[mask] = np.nan; psi[mask] = np.nan

    fig, axes = plt.subplots(1, 2, figsize=(12, 5))
    axes[0].contour(X, Y, psi, levels=30, colors='blue', linewidths=0.8)
    axes[0].set_title(f'{title} - ์œ ์„  (ฯˆ=const)')
    axes[1].contour(X, Y, phi, levels=30, colors='red', linewidths=0.8)
    axes[1].set_title(f'{title} - ๋“ฑํฌํ…์…œ์„  (ฯ†=const)')
    for ax in axes:
        ax.set_aspect('equal'); ax.set_xlabel('x'); ax.set_ylabel('y')
    plt.tight_layout(); plt.show()

# ์ˆœํ™˜ ์žˆ๋Š” ์›์ฃผ ์ฃผ์œ„ ํ๋ฆ„
U, a, Gamma = 1.0, 1.0, 2*np.pi
W_cyl = lambda z: U*(z + a**2/z) - 1j*Gamma/(2*np.pi)*np.log(z)
# plot_flow(W_cyl, title="์ˆœํ™˜ ์žˆ๋Š” ์›์ฃผ ์ฃผ์œ„ ํ๋ฆ„")

# ์ „๊ธฐ ์Œ๊ทน์ž (+q at z=d, -q at z=-d)
W_dipole = lambda z: -1/(2*np.pi) * (np.log(z-0.5) - np.log(z+0.5))
# plot_flow(W_dipole, title="์ „๊ธฐ ์Œ๊ทน์ž ์ „์œ„")

Joukowski transformation and lift: $w = z + c^2/z$ maps a circle to an airfoil. Lift per unit length by the Kutta-Joukowski theorem:

$$L = \rho U \Gamma$$

This result is elegantly derived from the residue theorem.

5.4 Schwarz-Christoffel Mapping (์Šˆ๋ฐ”๋ฅด์ธ -ํฌ๋ฆฌ์Šคํ† ํŽ  ์‚ฌ์ƒ)

Problem: Find a conformal mapping that maps the upper half-plane to a polygonal region.

Schwarz-Christoffel formula: If points $x_1, x_2, \ldots, x_n$ on the real axis of the upper half-plane map to vertices $w_1, w_2, \ldots, w_n$ of a polygon, and the interior angle at each vertex is $\alpha_k \pi$:

$$\frac{dw}{dz} = A \prod_{k=1}^{n} (z - x_k)^{\alpha_k - 1}$$

where $A$ is a complex constant.

Example: The mapping from the upper half-plane to a rectangle is expressed in terms of elliptic integrals and is used in electrostatics to calculate the fringing field of parallel plate capacitors.


6. Analytic Continuation (ํ•ด์„์  ์—ฐ์†)

6.1 Basic Concept

When a function $f(z)$ is defined in a region $D_1$, if an analytic function $g(z)$ in a larger region $D_2 \supset D_1$ agrees with $f$ in $D_1$, then $g$ is called an analytic continuation of $f$.

Uniqueness: If an analytic continuation exists, it is unique (by the identity theorem).

6.2 Physics Applications

Gamma function: Originally $\Gamma(z) = \int_0^{\infty} t^{z-1} e^{-t} dt$ is only defined for $\text{Re}(z) > 0$, but using the recurrence relation $\Gamma(z) = \Gamma(z+1)/z$, it can be analytically continued to the entire complex plane except for negative integers.

Riemann zeta function: $\zeta(s) = \sum_{n=1}^{\infty} n^{-s}$ converges for $\text{Re}(s) > 1$, but through analytic continuation it extends to the entire complex plane except $s = 1$. This is used in physics for zeta function regularization (Casimir effect, etc.).

# ๊ฐ๋งˆ ํ•จ์ˆ˜์˜ ํ•ด์„์  ์—ฐ์† ์‹œ๊ฐํ™”
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import gamma

x = np.linspace(-4.5, 5, 2000)
y = np.array([gamma(xi) if abs(xi - round(xi)) > 0.02 or xi > 0.5
              else np.nan for xi in x])

plt.figure(figsize=(10, 6))
plt.plot(x, y, 'b-', linewidth=1.5)
plt.ylim(-10, 10)
for n in range(0, -5, -1):
    plt.axvline(x=n, color='red', linewidth=0.5, linestyle='--', alpha=0.5)

plt.xlabel('z')
plt.ylabel('ฮ“(z)')
plt.title('๊ฐ๋งˆ ํ•จ์ˆ˜์˜ ํ•ด์„์  ์—ฐ์† (์Œ์˜ ์ •์ˆ˜์—์„œ ๊ทน์ )')
plt.grid(True, alpha=0.3)
plt.axhline(0, color='k', linewidth=0.5)
plt.tight_layout()
plt.show()

Exercises (์—ฐ์Šต ๋ฌธ์ œ)

Basic Problems

  1. Determine whether the following functions are analytic using the Cauchy-Riemann conditions:
  2. (a) $f(z) = z^3$
  3. (b) $f(z) = |z|^2$
  4. (c) $f(z) = \bar{z}$
  5. (d) $f(z) = e^{-z}\sin z$

  6. Find the harmonic conjugate $v(x, y)$ of $u(x, y) = x^3 - 3xy^2 + 2x$.

  7. Calculate the following integrals ($C$: circle of radius 2 centered at origin):

  8. (a) $\oint_C e^z/z^2\, dz$
  9. (b) $\oint_C \cos z/z^3\, dz$
  10. (c) $\oint_C z^2/((z-1)(z+2))\, dz$

Intermediate Problems

  1. Calculate using the residue theorem:
  2. (a) $\displaystyle\int_0^{2\pi} \frac{d\theta}{5 + 4\cos\theta}$
  3. (b) $\displaystyle\int_0^{\infty} \frac{x^2}{(x^2+1)(x^2+4)}\, dx$
  4. (c) $\displaystyle\int_0^{\infty} \frac{\cos 3x}{x^2 + 1}\, dx$

  5. Find the residues of $f(z) = z/((z-1)^2(z+2))$ at all singularities, and find the integral value over $|z|=3$.

Advanced Problems

  1. Fluid mechanics: When there is a source at $z=a$ and a sink at $z=-a$, and the $x$-axis is a wall, find the streamline function in the upper half-plane using the method of images.

  2. Quantum mechanics: Derive the density of states $\rho(E) = -\text{Im}\, G(E)/\pi$ from the Green's function $G(E) = (E - H + i\epsilon)^{-1}$ using the residue theorem.

  3. Solution (Problem 4a):

z = sp.Symbol('z')
# โˆซโ‚€ยฒฯ€ dฮธ/(5+4cosฮธ) โ†’ โˆฎ 1/(i(2zยฒ+5z+2)) dz
integrand = 1 / (sp.I * (2*z**2 + 5*z + 2))
poles = sp.solve(2*z**2 + 5*z + 2, z)
print(f"๊ทน์ : {poles}")  # z=-1/2 (๋‚ด๋ถ€), z=-2 (์™ธ๋ถ€)
res = sp.residue(integrand, z, sp.Rational(-1, 2))
print(f"์ ๋ถ„๊ฐ’: {sp.simplify(2*sp.pi*sp.I*res)}")  # 2ฯ€/3

References (์ฐธ๊ณ  ์ž๋ฃŒ)

Textbooks

  • Boas, M. L. Mathematical Methods in the Physical Sciences, 3rd ed., Ch. 14
  • Arfken, Weber Mathematical Methods for Physicists, Ch. 6-7
  • Churchill, Brown Complex Variables and Applications

Supplementary Materials

  • Needham, T. Visual Complex Analysis - Geometric intuition
  • Ablowitz, Fokas Complex Variables: Introduction and Applications - Physics applications

Summary of Key Formulas

Formula Condition
Cauchy-Riemann: $u_x = v_y$, $u_y = -v_x$ Differentiable
Cauchy's theorem: $\oint_C f\, dz = 0$ Analytic in simply connected region
Cauchy's formula: $f(z_0) = \frac{1}{2\pi i}\oint \frac{f}{z-z_0} dz$ $f$ analytic, $z_0$ interior
Residue theorem: $\oint f\, dz = 2\pi i \sum \text{Res}$ Finite singularities

Next Lesson

In 15. Laplace Transform (๋ผํ”Œ๋ผ์Šค ๋ณ€ํ™˜), we will cover the definition and properties of the Laplace transform, inverse transforms, and applications to differential equations.

to navigate between lessons