{
"cells": [
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
"using Plots, ComplexPhasePortrait, ApproxFun\n",
"gr();"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# M3M6: Methods of Mathematical Physics\n",
"\n",
"Dr. Sheehan Olver\n",
"
\n",
"s.olver@imperial.ac.uk\n",
"\n",
"\n",
"\n",
"# Lecture 5: Residue Theorem\n",
"\n",
"\n",
"This lecture we cover\n",
"\n",
"1. Contour integrals and Laurent coefficients\n",
"2. Isolated singularities\n",
" - Residue at a point\n",
"2. Contour integrals in domains with multiple holes\n",
" - The residue theorem\n",
"3. Calculated integrals\n",
" - Application: Trigonometric integrals with rational functions"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Contour integrals and Laurent coefficients\n",
"\n",
"In this course, we will _always_ think of Laurent series living on a circle $ \\gamma_r(z_0) = \\{z : |z-z_0| = r \\}$. That is,\n",
"$$\n",
" f(z) \\approx \\sum_{k=-\\infty}^\\infty f_k (z-z_0)^k\n",
"$$\n",
"\n",
"for $z \\in \\gamma_r(z_0)$. \n",
"\n",
"**Proposition (Residue on a circle)** \n",
"Suppose the Laurent series is absolutely summable on $\\gamma_r$. Then \n",
"$$\n",
"\\oint_{\\gamma_r} f(z) dz = 2 \\pi i f_{-1}\n",
"$$\n",
"We refer to $f_{-1}$ as the _residue over $\\gamma_r$_.\n",
"\n",
"*Example* For all $0 < r < \\infty$, \n",
"\n",
"$$\n",
"\\oint_{\\gamma_r} {1 \\over z} dz = 2 \\pi i\n",
"$$"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"phaseplot(-2..2, -2..2, z-> 1/z)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.0 + 6.283185307179586im"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"γ = Circle(0.0, 1.0)\n",
"z = Fun(γ)\n",
"sum(1/z)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"_Example_ This works for functions not analytic:\n",
"$$\n",
" \\oint_{\\gamma_1} (\\sqrt{z-1}\\sqrt{z+1})^3 dz \n",
" $$"
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 42,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"f = z -> (sqrt(z-1)*sqrt(z+1))^3\n",
"\n",
"phaseplot(-2..2, -2..2, f)\n",
"plot!(Circle(1.1); color=:black, label=\"contour\", linewidth=1.5, arrow=true)"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"sum(Fun(f, Laurent(Circle(1.1)))) = -1.2751605303035503e-16 + 2.3561944901923444im\n",
"(2π) * im * f₋₁ = -1.1592368457305e-16 + 2.141994991083949im\n"
]
}
],
"source": [
"@show sum(Fun(f, Laurent(Circle(1.1)))) # integral over circle\n",
"f₋₁ = Fun(f, Laurent(Circle(1.1))).coefficients[2] # numerical Laurent coefficient\n",
"@show 2π*im*f₋₁;"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"When $f$ is holomorphic in a neighbourhood of the circle, we can extend it to an annulus (like Taylor series and disks):\n",
"\n",
"**Proposition (Laurent series in an annulus)**\n",
"Suppose $f$ is holomorphic in an open annulus $A_{\\rho R}(z_0) = \\{z : \\rho < | z - z_0| < R\\}$. Then the Laurent series converges uniformly in any closed annulus inside $A_{\\rho R}$\n",
"\n",
"**Proof** _Exercise_. Hint: use the decay in the Laurent coefficients $f_k$ from last lecture.\n",
"\n",
"\n",
"_Proposition (Residue on a circle)_ holds true regardless of the radius.\n",
"\n",
"## Isolated singularities\n",
"\n",
"**Definition (isolated singularity)** $f$ has an _isolated singularity at_ $z_0$ if it is holomorphic in an open annulus with inner radius 0: \n",
"$$\n",
"A_{0R}(z_0) = \\{z : 0 < |z - z_0| < R \\}.\n",
"$$\n",
"\n",
"\n",
"**Definition (Removable singularity)** $f$ has a _removable singularity at_ $z_0$ if it has an isolated singularity at $z_0$ and all negative terms in the Laurent series in $A_{0R}(z_0)$ are zero:\n",
"$$\n",
"f(z) = f_0 + f_1 (z-z_0) + f_2 (z-z_0)^2 + \\cdots\n",
"$$"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"NaN"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"f = z -> (exp(z)-1)/z\n",
"f(0.0) "
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"phaseplot(-1..1, -1..1, f) # no singularity appears because"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Proposition (Removing a removable singularity)** If $f$ has a removable singularity at $z_0$, then\n",
"$$\n",
"\\tilde f(z) = \\begin{cases} f_0 & z = z_0 \\\\\n",
" f(z) & 0 < |z-z_0| < R\n",
" \\end{cases}\n",
"$$\n",
"is analytic in the disk $B_R(z_0) = \\{ z : |z-z_0| < R \\}$, with a convergent Taylor series. Hence the name."
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"f̃ = z -> z ≈ 0 ? 1 : f(z)\n",
"phaseplot(-1..1, -1..1, f̃)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Definition (simple pole)** $f$ has a _simple pole at_ $z_0$ if it is holomorphic in \n",
"$$\n",
" A_{0R}(z_0) = \\{z : 0 < |z - z_0| < R \\}\n",
"$$ \n",
"with only one negative term in the Laurent series in $A_{0R}(z_0)$:\n",
"$$\n",
" f(z) = {f_{-1} \\over z - z_0} + f_0 + f_1 (z - z_0) + \\cdots\n",
"$$\n",
"where $f_{-1} \\neq 0$."
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"phaseplot(-1..1, -1..1, z -> exp(z)/z)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Definition (higher order pole)** $f$ has a _pole of order $N$ at_ ${z_0}$ if it is holomorphic in \n",
"$$\n",
" A_{0R}(z_0) = \\{z : 0 < |z - z_0| < R \\}\n",
" $$\n",
"with only $N$ negative coefficients in the Laurent series:\n",
"$$\n",
" f(z) = {f_{-N} \\over (z - z_0)^N} + {f_{1-N} \\over (z - z_0)^{N-1}} + \\cdots + {f_{-1} \\over z-z_0} + f_0 + f_1 (z-z_0) + \\cdots\n",
"$$\n",
"where $f_{-N} \\neq 0$."
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"phaseplot(-1..1, -1..1, z -> exp(z)/z^3)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"**Definition (essential singularity)** $f$ has an _essential singularity at_ $z_0$ if it is holomorphic in $A_{0R}(z_0)$ and has an infinite number of negative Laurent coefficients."
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 36,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"phaseplot(-1..1, -1..1, z -> exp(1/z))"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(-8.078182973046723e-16 + 6.283185307179586im, -8.078182973046723e-16 + 6.283185307179586im)"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sum(Fun(z -> exp(1/z), Circle())), \n",
"2π*im*Fun(z -> exp(1/z), Laurent(Circle())).coefficients[2]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Residue at a point\n",
"\n",
"**Definition (Residue at a point)** Suppose $f$ has an isolated singularity at $z_0$, and is analytic in the annulus $A_{0R}(z_0)$ for some $R > 0$. Then we define the _residue at_ $z_0$ as\n",
"$$\n",
"{\\underset{z = z_0}{\\rm Res}}\\, f(z) = f_{-1}\n",
"$$\n",
"where $f_{-1}$ is the first negative coefficent of the Laurent series in $A_{0R}(z_0)$. \n",
"\n",
"**Proposition (Residue of ratio of analytic functions with simple pole)** Suppose\n",
"$$\n",
"f(z) = {A(z) \\over B(z)}\n",
"$$\n",
"and $A$, $B$ are analytic/holomorphic in a disk of radius $R$ around $z_0$ and that $B$ has only a single zero at $z_0$:\n",
"\\begin{align*}\n",
"A(z) = A_0 + A_1(z-z_0) + \\cdots \\cr\n",
"B(z) = B_1(z-z_0) + \\cdots\n",
"\\end{align*}\n",
"Then ${\\underset{z = z_0}{\\rm Res}}\\, f(z) = {A_0 \\over B_1}$\n",
"\n",
"**Exercise (Residue of ratio of analytic functions with higher order poles)** What is the residue at $z_0$ if $B$ has a higher order zero: $B(z) = B_N (z-z_0)^N + \\cdots$?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Contour integrals on domains with multiple holes\n",
"\n",
"\n",
"Consider the following example:\n",
"\n",
"$$ \n",
" {\\sqrt{z-1}\\sqrt{z+1} \\over z^2 + 4}$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We still have the contour integral over a circle, and so _Proposition (Residue on a circle)_ still holds true for $r > 2$. But we can also deform the contour into three contours:"
]
},
{
"cell_type": "code",
"execution_count": 43,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 43,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"f = z -> sqrt(z-1)sqrt(z+1)/(z^2+4)\n",
"\n",
"Γ = Circle(1.1) ∪ Circle(2.0im,0.1) ∪ Circle(-2.0im,0.1)\n",
"phaseplot(-2..2, -3..3, f)\n",
"plot!(Γ; color=:black, label=:contour, arrow=true, linewidth=1.5)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(4.782717259505325e-16 - 9.336183501133093e-16im, 2.555681169620637e-16 + 1.1200207106231122e-15im)"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sum(Fun(f, Circle(2.1))), sum(Fun(f, Γ))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Thus we can sum over three residues."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Residue theorem\n",
"\n",
"**Theorem (Cauchy's Residue Theorem)** Let $f$ be holomprohic inside and on a simple closed, positively oriented contour $\\gamma$ except at isolated points $z_1, \\ldots, z_r$ inside $\\gamma$. Then\n",
"\n",
"$$\\oint_\\gamma f(z) dz = 2 \\pi i \\sum_{j=1}^r {\\underset{z = z_j}{\\rm Res}}\\, f(z)$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Calculating integrals\n",
"\n",
"We can use the Residue theorem to calculate \"hard\" integrals.\n",
"\n",
"First, two trivial examples:"
]
},
{
"cell_type": "code",
"execution_count": 44,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 44,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"f = z -> 1/(z*(z+2))\n",
"phaseplot(-3..3, -3..3, f)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"7.874234295592502e-19 - 9.742139082662117e-17im"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sum(Fun(f, Circle(3.0)))"
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 45,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"f = z -> exp(z)/(z*(z+2))\n",
"phaseplot(-3..3, -3..3, f)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-5.073166565789438e-16 + 2.716424322002157im"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sum(Fun(f, Circle(3.0)))"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.0 + 2.716424322002157im"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"2π*im*(1/2 - exp(-2)/2)"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-2.313334476762615e-16 + 1.7833804925887144im"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sum(Fun(z -> exp(z)/(z^2*(z+2)), Circle(3.0)))"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.0 + 1.783380492588715im"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"2*pi*im * (1/4 + exp(-2)/4)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Application: Integrals on the real line of rational functions\n",
"\n",
"We can calculate integrals of the form \n",
"$$\\int_0^{2 \\pi} R(\\cos \\theta, \\sin \\theta) d \\theta$$\n",
"where $R(x,y)$ is rational by doing the change of variables $z = e^{i \\theta}$ to reduce it to\n",
"$$\\oint_{\\gamma_1} R\\left({z + z^{-1} \\over 2}, {z - z^{-1} \\over 2 i} \\right) {d z \\over i z}$$\n",
"\n",
"\n",
"*Example* Consider\n",
"\n",
"$$\\int_0^{2\\pi} {d \\theta \\over 1 - 2\\rho \\cos \\theta + \\rho^2}$$\n",
"\n",
"for $0 < \\rho < 1$."
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ρ = 0.5\n",
"plot(Fun(θ -> 1/(1-2ρ*cos(θ) + ρ^2), 0 .. 2π))"
]
},
{
"cell_type": "code",
"execution_count": 46,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 46,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"phaseplot(-2..2, -2..2, z -> 1/(1-ρ*(z+(z^(-1))) + ρ^2) * 1/(im*z))"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(8.377580409572783, 8.377580409572781)"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sum(Fun(θ -> 1/(1-2ρ*cos(θ) + ρ^2), 0 .. 2π)), 2π /(1-ρ^2)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.0.1",
"language": "julia",
"name": "julia-1.0"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.0.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}