{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "using Plots, ComplexPhasePortrait, ApproxFun\n", "gr();" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# M3M6: Methods of Mathematical Physics\n", "\n", "$$\n", "\\def\\dashint{{\\int\\!\\!\\!\\!\\!\\!-\\,}}\n", "\\def\\infdashint{\\dashint_{\\!\\!\\!-\\infty}^{\\,\\infty}}\n", "\\def\\D{\\,{\\rm d}}\n", "\\def\\dx{\\D x}\n", "$$\n", "\n", "Dr. Sheehan Olver\n", "
\n", "s.olver@imperial.ac.uk\n", "\n", "\n", "
\n", "Website: https://github.com/dlfivefifty/M3M6LectureNotes\n", "\n", "\n", "\n", "# Lecture 7: Integrals over the real line\n", "\n", "\n", "This lecture we cover\n", "\n", "1. Integrals over real lines\n", " - Principal value integral\n", " - Cauchy's integral formula and Residue theorem on the real line\n", " - Jordan's lemma\n", " - Application: Calculating Fourier tranforms of weakly decaying functions\n", "2. Functions with branch cuts\n", " - Logarithmic function" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "## Integrals over the real line\n", "\n", "Integrals on the real line are always to viewed as improper integrals:\n", "\n", "$$ \\int_{-\\infty}^\\infty f(x) \\dx = \\int_0^\\infty f(x) \\dx +\\int_{-\\infty}^0 f(x)\\dx = \\lim_{b \\rightarrow \\infty} \\int_0^b f(x) \\dx + \\lim_{a \\rightarrow -\\infty} \\int_a^0 f(x) \\dx.$$\n", "\n", "**Definition (Principal value integral on the real line)** The _(Cauchy) principal value integral on the real line_ is defined as\n", "$$\n", "\\infdashint f(x) \\dx := \\lim_{M\\rightarrow \\infty} \\int_{-M}^M f(x) \\dx\n", "$$\n", "\n", "**Proposition (Integability $\\Rightarrow$ Prinipal value integrability)** If \n", "$ \\int_{-\\infty}^\\infty f(x) \\dx < \\infty$\n", "then \n", "$$ \\infdashint f(x) \\dx = \\int_{-\\infty}^\\infty f(x) \\dx.$$\n", "\n", "\n", "### Residue theorem on the real line\n", "\n", "The real line doesn't have an _inside_ and _outside_, rather an _above_ and _below_, or _left_ and _right_. Thus we get the following two versions of the Residue theorem:\n", "\n", "**Definition (Upper/lower half plane)** Denote the upper/lower half plane by\n", "$$\n", "{\\mathbb H}^+ = \\{z : \\Re z > 0 \\} \\\\\n", "{\\mathbb H}^- = \\{z : \\Re z < 0 \\} \n", "$$\n", "The closure is denoted\n", "$$\n", "\\bar{\\mathbb H}^+ = {\\mathbb H}^+ \\cup {\\mathbb R} \\cup \\{\\infty\\} \\\\\n", "\\bar{\\mathbb H}^- = {\\mathbb H}^- \\cup {\\mathbb R} \\cup \\{\\infty\\}\n", "$$\n", "\n", "**Theorem (Residue theorem on the real line)** Suppose $f : \\bar {\\mathbb H}^+ \\backslash \\{z_1,\\ldots,z_r \\} \\rightarrow {\\mathbb C}$ is holomorphic in ${\\mathbb H}^+ \\backslash \\{z_1,\\ldots,z_r \\}$, where $\\Re z_k > 0$, and $\\lim_{\\epsilon \\rightarrow 0} f(x + i \\epsilon) = f(x)$ converges uniformly. If \n", "$$ \\lim_{z \\rightarrow \\infty} z f(z) = 0\n", "$$ uniformly for $z \\in \\bar {\\mathbb H}^+$, then\n", "$$\n", "\\infdashint f(x) \\dx = 2 \\pi i \\sum_{k=1}^r {\\underset{z = z_k}{\\rm Res}} \\, f(z)\n", "$$\n", "Similarly, if the equivalent conditions hold in the lower half plane for $f : \\bar{\\mathbb H}^- \\backslash \\{z_1,\\ldots,z_r \\} \\rightarrow {\\mathbb C}$ then\n", "$$\n", "\\infdashint f(x) \\dx = -2 \\pi i \\sum_{k=1}^r {\\underset{z = z_k}{\\rm Res}} \\, f(z)\n", "$$\n", "\n", "\n", "Examples:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": false }, "outputs": [], "source": [ "f = x -> x^2/(x^4+1)\n", "phaseplot(-3..3, -2..2, f)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This function has poles in the upper plane, but has sufficient decay that we can apply Residue theorem:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(2.221441469079183 + 3.487868498008632e-16im, 2.221441469084968)" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "z₁,z₂,z₃,z₄ = exp(im*π/4), exp(3im*π/4), exp(5im*π/4), exp(7im*π/4)\n", "\n", "res₁ = z₁^2 / ((z₁ - z₂)*(z₁ - z₃)*(z₁ - z₄) )\n", "res₂ = z₂^2 / ((z₂ - z₁)*(z₂ - z₃)*(z₂ - z₄) )\n", "\n", "2π*im*(res₁ + res₂), sum(Fun(f, Line()))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can also apply Resiude theorem in the lower-half plane, and we get the same result:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(2.221441469079183 + 5.231802747012948e-16im, 2.221441469084968)" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res₃ = z₃^2 / ((z₃ - z₁)*(z₃ - z₂)*(z₃ - z₄) )\n", "res₄ = z₄^2 / ((z₄ - z₁)*(z₄ - z₃)*(z₄ - z₂) )\n", "\n", "-2π*im*(res₃ + res₄), sum(Fun(f, Line()))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Cauchy's integral formula on the real line\n", "\n", "An immediate consequence of the Residue theorem is Cauchy's integral formula on the real line:\n", "\n", "**Theorem (Cauchy's integral formula on the real line)** Suppose $f : \\bar {\\mathbb H}^+ \\rightarrow {\\mathbb C}$ is holomorphic in ${\\mathbb H}^+ $, and $\\lim_{\\epsilon \\rightarrow 0} f(x + i \\epsilon) = f(x)$ converges uniformly. If \n", "$$ \n", "\\lim_{z \\rightarrow \\infty} f(z) = 0\n", "$$ \n", "uniformly for $z \\in \\bar {\\mathbb H}^+$, then\n", "$$\n", "f(z) = {1 \\over 2 \\pi i} \\infdashint {f(x) \\over x - z} dx\n", "$$\n", "for all $z \\in {\\mathbb H}^+$.\n", "\n", "\n", "_Examples_ Here is a simple example of $f(x) = {x^2 \\over (x+ i)^3}$, which is analytic in the upper half plane:" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2.69638478211931e-13 - 3.032296636007459e-13im" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f = x -> x^2/(x+im)^3\n", "z = 2.0+2.0im\n", "sum(Fun(x-> f(x)/(x - z), Line()))/(2π*im) - f(z)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Evaluating in lower half plane doesn't work b ecause it has a pole there:" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(2.2331966377567175e-13 + 2.0218605967538834e-14im, 0.7040000000000001 - 0.128im)" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f = x -> x^2/(x+im)^3\n", "z = 2.0-2.0im\n", "sum(Fun(x-> f(x)/(x - z), Line()))/(2π*im) , f(z)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "But does for a function analytic in the lower half plane (with a minus sign):" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(0.03277196176631425 + 0.16750113791564233im, 0.03277196176604461 + 0.1675011379153391im)" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f = x -> x^2/(x-im)^3\n", "z = 2.0-2.0im\n", "-sum(Fun(x-> f(x)/(x - z), Line()))/(2π*im) , f(z)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It also works for functions with exponential decay in the upper-half plane:" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "4.501316791527543e-9 + 5.93330299732131e-7im" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f = x -> exp(im*x)/(x+im)\n", "z = 2 + 2im\n", "sum(Fun(x-> f(x)/(x - z), -500 .. 500))/(2π*im) - f(z)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This is difficult as a real integral as the integrand is very oscillatory:" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "-200\n", "\n", "\n", "-100\n", "\n", "\n", "0\n", "\n", "\n", "100\n", "\n", "\n", "200\n", "\n", "\n", "-0.6\n", "\n", "\n", "-0.3\n", "\n", "\n", "0.0\n", "\n", "\n", "0.3\n", "\n", "\n", "0.6\n", "\n", "\n", "\n", "\n", "\n", "\n", "y1\n", "\n", "\n" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "xx = -200:0.1:200\n", "plot(xx,real.(f.(xx)))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "An equivalent result holds in the negative real axis, but be careful:" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "-4.529525111429054e-9 + 5.865568293152012e-7im" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "z = -2-im\n", "f = x -> exp(im*x)/(x+im)\n", "sum(Fun(x-> f(x)/(x - z), -500 .. 500))/(2π*im)" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(0.09196985577264773 - 0.09196926921581833im, 0.9007327639404081 + 0.3351305720620013im)" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "z = -2-im\n", "f = x -> exp(im*x)/(x-im)\n", "sum(Fun(x-> f(x)/(x - z), -500 .. 500))/(2π*im), f(z)" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(-0.045354995402086956 - 0.1219015148055592im, -0.04535499089125899 - 0.12190092372837213im)" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "z = -2-im\n", "f = x -> exp(-im*x)/(x-im)\n", "-sum(Fun(x-> f(x)/(x - z), -500 .. 500))/(2π*im), f(z)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Jordan's lemma\n", "\n", "The case of calculating\n", "$$\n", " \\int_{-\\infty}^\\infty e^{i \\omega x} g(x) dx\n", "$$ \n", "is important because it is the Fourier transform of $g(x)$. Provided $g$ is defined in the upper half plane and $\\omega > 0$, $f(z) = e^{i \\omega z} g(z)$ has exponential decay." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can use this to get sharper results than ML inequality:\n", "\n", "**Lemma (Jordan)** Assume $\\omega > 0$. If $g(z)$ is continuous in on the half circle $C_R = \\{ R e^{i \\theta} : 0 \\leq \\theta \\leq \\pi \\}$ then\n", "$$\\left| \\int_{C_R} g(z) e^{i \\omega z} dz \\right| \\leq {\\pi \\over \\omega} M$$\n", "where $M = \\sup_{z \\in C_R} |g(z)|$. \n", "\n", "**Sketch of proof** We have\n", "$$\\left| \\int_{C_R} g(z) e^{i \\omega z} dz \\right| \\leq R \\int_0^\\pi \\left|g(R e^{i \\theta}) e^{i \\omega R e^{i \\theta}}e^{i \\theta}\\right| d\\theta \n", "\\leq MR \\int_0^\\pi e^{- \\omega R\\sin \\theta } d\\theta \n", "= 2MR \\int_0^{\\pi\\over 2} e^{- \\omega R\\sin \\theta } d\\theta \n", "$$\n", "But we have $\\sin \\theta \\geq {2 \\theta \\over \\pi}$:" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "0.0\n", "\n", "\n", "0.5\n", "\n", "\n", "1.0\n", "\n", "\n", "1.5\n", "\n", "\n", "0.00\n", "\n", "\n", "0.25\n", "\n", "\n", "0.50\n", "\n", "\n", "0.75\n", "\n", "\n", "1.00\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "sin t\n", "\n", "\n", "\n", "2t / pi\n", "\n", "\n" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "θ = range(0; stop=π/2, length=100)\n", "plot(θ, sin.(θ); label=\"sin t\")\n", "plot!(θ, 2θ/π; label = \"2t / pi\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Hence \n", "$$\\left| \\int_{C_R} g(z) e^{i \\omega z} dz \\right| \\leq 2MR \\int_0^{\\pi\\over 2} e^{- {2\\omega R\\theta \\over \\pi} } d\\theta = {\\pi \\over \\omega} (1 - e^{-\\omega R}) M \\leq {\\pi M \\over \\omega}.\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Application: Calculating Fourier integrals of weakly decaying functions\n", "\n", "Why is this useful? We can use it to apply Residue theorem to We already know $O(z^{-2})$ decay gives us the integral via Residue theorem. And if we only have $z^{-1}$ decay our integral does not converge absolutely:" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "7.600902584542065" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f = x -> exp(im*x)*x/(x^2+1)\n", "sum(abs.(Fun(f, 0 .. 2000)))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "However, it does converge conditionally: \n", "$$\n", "\\dashint_{\\infty}^\\infty f(x) \\dx := \\lim_{M\\rightarrow \\infty} \\int_{-M}^M f(x) \\dx\n", "$$\n", "converges:" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "-6.776263578034403e-21 + 1.1557671135433842im" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f = x -> exp(im*x)*x/(x^2+1)\n", "\n", "sum(Fun(f, -30000 .. 30000))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Thus we can construct a Residue theorem for calculating \n", "$$\n", "\\infdashint g(x) e^{i \\omega x} \\dx\n", "$$\n", "provided that $g(z) \\rightarrow 0$ and is analytic in the upper-half plane." ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.0 + 1.1557273497909217im" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "2π*im*exp(-1)*im/(im+im) # 2π*im* residue of g(z)exp(im*z) at z = im" ] } ], "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 }