In complex analysis, '''contour integration''' is a method of evaluating certain [[integral]]s along paths in the complex plane.<ref name=Stalker>{{cite book |title=Complex Analysis: Fundamentals of the Classical Theory of Functions |author=John Stalker |page=p. 77 |url=http://books.google.com/books?id=yl3GIXd3dFIC&pg=PP12&dq=%22calculus+of+residues%22&lr=&as_brr=0&sig=hSJuv7-V2Ls0G85ZdaayND5jBrs#PPA77,M1
|isbn=081764038X |publisher=Springer |year=1998}}</ref><ref name=Bak>{{cite book |title=Complex Analysis |author=Joseph Bak & Donald J. Newman |page=Chapters 11 & 12, pp. 130-156 |url=http://books.google.com/books?id=JX2YSgfZwbYC&pg=PA130&dq=%22contour+integral%22&lr=&as_brr=0&sig=kXalt5look0vfwvfQ39fvMGHHAY#PPA130,M1
|isbn=0387947566 |year=1997 |publisher=Springer}}</ref><ref name=Krantz>{{cite book |title=Handbook of Complex Variables |author=Steven George Krantz |page= Chapter 2 |url=http://books.google.com/books?id=aYU2AdF_0dIC&pg=PT13&dq=Calculus++Residues+inauthor:krantz&lr=&as_brr=0&sig=7snNQHhgXsSP4wsu4mRT2jc7cVY#PPT47,M1
|isbn=0817640118 |year=1999 |publisher=Springer }}</ref>
Contour integration is closely related to the [[Residue theorem|calculus of residues]],<ref name=Mitrinovic1>{{cite book |title=The Cauchy Method of Residues: Theory and Applications |url=http://books.google.com/books?id=-suKhxfPH5AC&printsec=frontcover&dq=%22calculus+of+residues%22&lr=&as_brr=0#PPA5,M1
|author=Dragoslav S. Mitrinovic & Jovan D. Keckic |isbn=9027716234 |year=1984 |publisher=Springer |page=Chapter 2 }}</ref> a methodology of [[complex analysis]].
One use for contour integrals is the evaluation of integrals along the real line that are not readily found by using only real variable methods.<ref name=Mitrinovic2>{{cite book |title=Chapter 5 |url=http://books.google.com/books?id=-suKhxfPH5AC&printsec=frontcover&dq=%22calculus+of+residues%22&lr=&as_brr=0#PPA108,M1
|author=Dragoslav S. Mitrinovic & Jovan D. Keckic|year=1984 |isbn=9027716234 }}</ref>
Contour integration methods include
* direct integration of a [[complex number|complex]]-valued function along a curve in the complex plane (a ''contour'')
* application of the [[Cauchy integral formula]]
* application of the [[residue theorem]]
One method can be used, or a combination of these methods, or various limiting processes, for the purpose of finding these integrals or sums.
== Direct methods ==
Direct methods involve the calculation of the integral by means of methods similar to those in calculating line integrals in several-variable calculus. This means that we use the following method:
* parametrizing the contour
: The contour is parametrized by a differentiable complex-valued function of real variables, or the contour is broken up into pieces and parametrized separately
* substitution of the parametrization into the integrand
: Substituting the parametrization into the integrand transforms the integral into an integral of one real variable.
* direct evaluation
: The integral is evaluated in a method akin to a real-variable integral.
=== Example ===
A fundamental result in complex analysis is that the integral around the contour ''C'' which is the unit circle (or any [[Jordan curve]] about 0) of ''z''<sup>−1</sup> is 2πi. Let us evaluate the integral
:<math>\oint_C {1 \over z}\,dz.</math>
In evaluating this integral, we use the unit circle |''z''| = 1 as our contour, which we can parametrize by γ(''t'') = ''e''<sup>i''t''</sup>, with ''t'' ∈ [0, 2π]. Observe that γ'(''t'') = i''e''<sup>i''t''</sup>. Now, substituting γ(''t'') for ''z'', we have
:<math>
\begin{align}
\oint_C {1 \over z}\,dz & {} = \int_0^{2\pi} {1 \over e^{it}} ie^{it}\,dt = i\int_0^{2\pi} e^{-it}e^{it}\,dt = i\int_0^{2\pi} 1 \,dt \\
& {} = \Big[t\Big]_0^{2\pi} i=(2\pi-0)i = 2\pi i
\end{align}
</math>
which is the value of the integral.
== Applications of integral theorems ==
Applications of integral theorems are also often used to evaluate the contour integral along a contour, which means that the real-valued integral is calculated simultaneously along with calculating the contour integral.
Integral theorems such as the [[Cauchy integral formula]] or [[residue theorem]] are generally used in the following method:
* a specific contour is chosen:
: The contour is chosen so that the contour follows the part of the complex plane that describes the real-valued integral, and also encloses singularities of the integrand so application of the [[Cauchy integral formula]] or [[residue theorem]] is possible
* application of the [[Cauchy-Goursat theorem]]
: The integral is reduced to only an integration around a small circle about each pole.
* application of the [[Cauchy integral formula]] or [[residue theorem]]
: Application of these integral formula gives us a value for the integral around the whole of the contour.
* division of the contour into a contour along the real part and imaginary part
: The whole of the contour can be divided into the contour that follows the part of the complex plane that describes the real-valued integral as chosen before (call it ''R''), and the integral that crosses the complex plane (call it ''I''). The integral over the whole of the contour is the sum of the integral over each of these contours.
* demonstration that the integral that crosses the complex plane plays no part in the sum
: If the integral ''I'' can be shown to be zero, or if the real-valued integral that is sought is improper, then if we demonstrate that the integral ''I'' as described above tends to 0, the integral along ''R'' will tend to the integral around the contour ''R''+''I''.
* conclusion
: If we can show the above step, then we can directly calculate ''R'', the real-valued integral.
=== Example (I)===
Consider
: <math>\int_{-\infty}^{\infty} {1 \over (x^2+1)^2}\,dx</math>
[[Image:ContourDiagram.png|left|200px|the contour]]
To evaluate this integral, we look at the complex-valued function
: <math>f(z)={1 \over (z^2+1)^2}</math>
which has singularities at ''i'' and −''i''. However, we will want to choose a contour that will enclose the real-valued integral, so we choose a semicircle like the one shown on the left, which we will let expand as to contain the whole real axis (''a'' will tend to infinity). Call this contour ''C''.
Now, there are two ways of proceeding, using the [[Cauchy integral formula]] or by the method of residues.
==== Using the Cauchy integral formula ====
Note that:
<math>\oint_C f(z)\,dz = \int_{-\infty}^\infty f(z)\,dz + \int_{Arc} f(z)\,dz </math>
thus
<math>\int_{-\infty}^\infty f(z)\,dz = \oint_C f(z)\,dz - \int_{Arc} f(z)\,dz </math>
Furthermore observe that
: <math>f(z)={1 \over (z^2+1)^2}={1 \over (z+i)^2(z-i)^2}.</math>
Since the only singularity in the contour is the one at ''i'', then we can write
: <math>f(z)={{1 \over (z+i)^2} \over (z-i)^2},</math>
which puts the function in the form for direct application of the formula.
Then, by Cauchy's integral formula,
: <math>\oint_C f(z)\,dz = \oint_C {1 \over (z^2+1)^2}\,dz = \oint_C {{1 \over (z+i)^2} \over (z-i)^2}\,dz = 2\pi i \frac{d}{dz} \left(\left.{1 \over (z+i)^2}\right)\right|_{z=i}</math>
: <math>=2 \pi i \left.\left({-2 \over (z+i)^3}\right)\right|_{z = i} =2 \pi i (-i/4)={\pi\over 2}</math>
(We take the first derivative, in the above steps, because the pole is a second-order pole. That is, (''z'' − ''i'') is taken to the second power, so we employ the first derivative of ƒ(''z''). If it were (''z'' − ''i'') taken to the third power, we would use the second derivative, etc. The case of (''z'' − ''i'') to the first power corresponds to a zero order derivative—just ƒ(''x'') itself.)
If we call the arc of the semicircle ''Arc'', we need to show that the integral over ''Arc'' tends to zero as ''a'' tends to infinity — using the [[estimation lemma]]
: <math>\left|\int_{Arc} f(z)\,dz\right| \le ML</math>
where ''M'' is an upper bound on |''f''(''z'')| and ''L'' the length of ''A''. Now,
: <math>\int_{Arc} f(z)\,dz \le {a\pi \over (a^2+1)^2} \rightarrow 0\ \mathrm{as}\ a \rightarrow \infty</math>
So
:<math>\int_{-\infty}^\infty f(z)\,dz = {\pi\over 2}.\quad\square</math>
==== Using the method of residues ====
Consider the [[Laurent series]] of ''f''(''z'') about ''i'', the only singularity we need to consider. We then have
: <math>f(z) = {-1 \over 4(z-i)^2} + {-i \over 4(z-i)} + {3 \over 16} + {i \over 8}(z-i) + {-5 \over 64}(z-i)^2 + \cdots</math>
(See Sample Laurent Calculation from [[Laurent series]] for the derivation of this series.)
It is clear by inspection that the residue is −''i''/4 (to see this, imagine that the above equation were multiplied by ''z'' − ''i'', then both sides integrated via the Cauchy integral formula—only the second term would integrate to a non-zero quantity), so, by the [[residue theorem]], we have
: <math> \oint_C f(z)\,dz = \oint_C {1 \over (z^2+1)^2}\,dz = 2 \pi i \,\mathrm{Res}_{z=i} f = 2 \pi i (-i/4)={\pi\over 2}\quad\square</math>
If we call the arc of the semicircle ''A'', we need to show that the integral over ''A'' tends to zero as ''a'' tends to infinity — using the [[estimation lemma]]
: <math>\left |\oint_A f(z)\,dz\right | \le ML</math>
where ''M'' is an upper bound on |''f''(''z'')| and ''L'' the length of ''A''. Now,
: <math>\oint_A f(z)\,dz \le {a\pi \over (a^2+1)^2} \rightarrow 0 \quad \mathrm{as}\ a \rightarrow \infty.</math>
So
:<math>\int_{-\infty}^{\infty} f(x)\,dx = {\pi\over 2}.\quad\square</math>
Thus we get the same result as before.
==== Contour note ====
As an aside, a question can arise whether we do not take the semicircle to include the ''other'' singularity, enclosing −i. To have the integral along the real axis moving in the correct direction, the contour must travel clockwise, ie., in a negative direction, reversing the sign of the integral overall.
This does not affect the use of the method of residues by series.
===Example (II) – Cauchy distribution ===
The integral
:<math>\int_{-\infty}^\infty {e^{itx} \over x^2+1}\,dx</math>
[[Image:contourDiagram.png|right|250px|the contour]]
(which arises in [[probability theory]] as (a scalar multiple
of) the [[characteristic function (probability theory)|characteristic function]] of the [[Cauchy distribution]])
resists the techniques of elementary [[calculus]]. We will
evaluate it by expressing it as a limit of contour integrals
along the contour ''C'' that goes along the [[real number|real]]
line from −''a'' to ''a'' and then counterclockwise along
a semicircle centered at 0 from ''a'' to −''a''. Take
''a'' to be greater than 1, so that the [[imaginary number|imaginary]]
unit ''i'' is enclosed within the curve. The contour integral is
:<math>\int_C {e^{itz} \over z^2+1}\,dz.</math>
Since ''e''<sup>''itz''</sup> is an [[entire function]]
(having no [[mathematical singularity|singularities]]
at any point in the complex plane), this function has
singularities only where the denominator
''z''<sup>2</sup> + 1 is zero. Since
''z''<sup>2</sup> + 1 = (''z'' + ''i'')(''z'' − ''i''),
that happens only where ''z'' = ''i'' or ''z'' = −''i''.
Only one of those points is in the region bounded by this
contour. The [[residue (complex analysis)|residue]] of
''f''(''z'') at ''z'' = ''i'' is
:<math>\lim_{z\to i}(z-i)f(z)=\lim_{z\to i}(z-i){e^{itz} \over z^2+1}=\lim_{z\to i}(z-i){e^{itz} \over (z-i)(z+i)}</math>
:<math>=\lim_{z\to i}{e^{itz} \over z+i}={e^{iti} \over i+i}={e^{-t}\over 2i}.</math>
According to the [[residue theorem]], then, we have
:<math>\int_C f(z)\,dz=2\pi i\cdot\operatorname{Res}_{z=i}f(z)=2\pi i{e^{-t} \over 2i}=\pi e^{-t}.</math>
The contour ''C'' may be split into a "straight"
part and a curved arc, so that
:<math>\int_{\mbox{straight}}+\int_{\mbox{arc}}=\pi e^{-t},</math>
and thus
:<math>\int_{-a}^a =\pi e^{-t}-\int_{\mbox{arc}}.</math>
It can be shown that '''if ''t'' > 0 then'''
:<math>\int_{\mbox{arc}}{e^{itz} \over z^2+1}\,dz
\rightarrow 0\ \mbox{as}\ a\rightarrow\infty.</math>
Therefore '''if ''t'' > 0 then'''
:<math>\int_{-\infty}^\infty{e^{itz} \over z^2+1}\,dz=\pi e^{-t}.</math>
A similar argument with an arc that winds around −''i''
rather than ''i'' shows that '''if ''t'' < 0 then'''
:<math>\int_{-\infty}^\infty{e^{itz} \over z^2+1}\,dz=\pi e^t,</math>
and finally we have this:
:<math>\int_{-\infty}^\infty{e^{itz} \over z^2+1}\,dz=\pi e^{-\left|t\right|}.\quad\square</math>
(If ''t'' = 0 then the integral yields immediately to real-valued calculus methods and its value is π.)
===Example (III) – trigonometric integrals ===
Certain substitutions can be made to integrals involving [[trigonometric functions]], so the integral is transformed into a rational function of a complex variable and then the above methods can be used in order to evaluate the integral.
As an example, consider
: <math> \int_{-\pi}^{\pi} {1 \over 1 + 3 (\cos{t})^2} \,dt. </math>
We seek to make a substitution of ''z'' = ''e''<sup>i''t''</sup>.
Now, recall
: <math> \cos{t} = {1 \over 2} \left(e^{it}+e^{-it}\right) = {1 \over 2} \left(z+{1 \over z}\right)</math>
and
: <math> {dz \over dt} = iz,\ dt = {dz \over iz}. </math>
Taking ''C'' to be the unit circle, we substitute to get:
: <math> \oint_C {1 \over 1 + 3 ({1 \over 2} (z+{1 \over z}))^2} \,{dz\over iz}</math>
: <math> = \oint_C {1 \over 1 + {3 \over 4} (z+{1 \over z})^2}{1 \over iz} \,dz
= \oint_C {-i \over z+{3\over 4}z(z+{1\over z})^2}\,dz = -i \oint_C { 1 \over z+{3\over 4}z(z^2+2+{1\over z^2})} \,dz</math>
: <math> = -i \oint_C {1\over z+{3\over 4}(z^3+2z+{1 \over z})} \,dz = -i \oint_C {1 \over {3\over 4 }z^3+{5 \over 2}z+{3 \over 4z}} \,dz</math>
: <math> = -i \oint_C {4 \over 3z^3+10z+{3\over z}}\,dz = -4i \oint_C {1 \over 3z^3+10z+{3\over z}}\,dz </math>
: <math> = -4i \oint_C { z \over 3z^4+10z^2+3 } \,dz. </math>
We use the Cauchy integral formula. Factorize the denominator:
: <math> = -4i \oint_C { z \over 3z^4+10z^2+3 } \,dz = -4i \oint_C {z \over 3(z^2+3)(z^2+1/3)}\,dz </math>
: <math> = -4i \oint_C {z \over 3(z+\sqrt{3}i)\left(z-\sqrt{3}i\right)\left(z+\sqrt{1\over 3}i\right)\left(z-\sqrt{1\over 3}i\right)}\,dz </math>
: <math> = -{4\over 3}i \oint_C {z \over (z+\sqrt{3}i)(z-\sqrt{3}i)\left(z+\sqrt{1\over 3}i\right)\left(z-\sqrt{1\over 3}i\right)}\,dz. </math>
The singularities then to be considered are at 3<sup>−1/2</sup>i, −3<sup>−1/2</sup>i. We can now reduce the integral:
: <math> = -{4\over 3}i \oint_{C_1} {\,{z \over (z+\sqrt{3}i)(z-\sqrt{3}i)\left(z+\sqrt{1\over 3}i\right)}\, \over \left(z-\sqrt{1\over 3}i\right)}\,dz +
-{4\over 3}i \oint_{C_2} {\,{z \over (z+\sqrt{3}i)(z-\sqrt{3}i)\left(z-\sqrt{1\over 3}i\right)}\, \over \left(z+\sqrt{1\over 3}i\right)} </math>
where ''C''<sub>1</sub> is a small circle about 3<sup>−1/2</sup>i, and ''C''<sub>2</sub> is a small circle about −3<sup>−1/2</sup>''i''. We can now apply the formula:
: <math> = -{4\over 3}i \left(
2\pi i \left.\left({z \over (z+\sqrt{3}i)(z-\sqrt{3}i)(z+\sqrt{1\over 3}i)}\right)\right|_{z=\sqrt{1 \over 3}i} \right.</math>
::<math>
\left. + 2\pi i \left.\left({z \over (z+\sqrt{3}i)(z-\sqrt{3}i)(z-\sqrt{1\over 3}i)}\right)\right|_{z=-\sqrt{1 \over 3}i}
\right)</math>
: <math> = -{4\over 3}i \left( 2\pi i \left( { \sqrt{1\over 3}i \over (\sqrt{1\over 3}i+\sqrt{3}i)(\sqrt{1\over 3}i-\sqrt{3}i)(\sqrt{1\over 3}i+\sqrt{1\over 3}i)} \right) \right.</math>
:: <math>\left. +2\pi i \left( { -\sqrt{1\over 3}i \over (-\sqrt{1\over 3}i+\sqrt{3}i)(-\sqrt{1\over 3}i-\sqrt{3}i)(-\sqrt{1\over 3}i-\sqrt{1\over 3}i } \right)\right)</math>
: <math> = -{4\over 3}i \left( 2\pi i
\left( {\sqrt{1\over 3}i \over ({4 \over \sqrt{3}}i)(-{2 \over \sqrt{3}}i)({2 \over \sqrt{3}}i)} \right) +
2 \pi i \left( {-\sqrt{1\over 3}i \over ({2 \over \sqrt{3}}i)(-{4 \over \sqrt{3}}i)(-{2 \over \sqrt{3}}i)} \right) \right)</math>
: <math> = -{4\over 3}i \left(
2\pi i \left( {\sqrt{1\over 3}i \over i({4 \over \sqrt{3}})({2 \over \sqrt{3}})({2 \over \sqrt{3}})} \right) +
2\pi i \left( {-\sqrt{1\over 3}i \over -i({2 \over \sqrt{3}})({4 \over \sqrt{3}})({2 \over \sqrt{3}})} \right) \right) </math>
: <math> = -{4\over 3}i \left(
2\pi i \left( {\sqrt{1\over 3} \over ({4 \over \sqrt{3}})({2 \over \sqrt{3}})({2 \over \sqrt{3}})} \right) +
2\pi i \left( {\sqrt{1\over 3} \over ({2 \over \sqrt{3}})({4 \over \sqrt{3}})({2 \over \sqrt{3}})} \right) \right) </math>
: <math> = -{4\over 3}i \left(
2\pi i \left( { \,\sqrt{1\over 3} \,\over {16 \over 3\sqrt{3}} } \right) +
2\pi i \left( {\, \sqrt{1\over 3} \,\over {16 \over 3\sqrt{3}} } \right) \right) </math>
: <math> = -{4\over 3}i \left(2 \pi i \left({3\over 16}\right) + 2 \pi i \left({3\over 16}\right)\right) = -{4\over 3}i \left(\pi i \left({3 \over 8}+{3 \over 8}\right)\right) = {4\over 3}\left({3 \over 4}\right)\pi = \pi.\quad\square</math>
===Example (IIIa) trigonometric integrals, the general procedure===
The above method may be applied to all integrals of the type
:<math> \int_0^{2\pi} \frac{P(\sin(t),\sin(2t),\ldots,\cos(t),\cos(2t)\ldots)}
{Q(\sin(t),\sin(2t),\ldots,\cos(t),\cos(2t)\ldots)} dt</math>
where <math>P</math> and <math>Q</math> are polynomials, i.e. a rational function in trigonometric terms is being integrated.
The trick is to use the substitution <math>z = \exp(i t)</math> where <math>dz = i \exp(i t) dt</math> and hence
:<math> \frac{1}{iz} dz = dt.</math>
This substitution maps the interval <math>[0, 2\pi]</math> to the unit circle. Furthermore,
:<math> \sin(k t) = \frac{\exp(i k t) - \exp(- i k t)}{2 i}
= \frac{z^k - z^{-k}}{2i}</math>
and
:<math> \cos(k t) = \frac{\exp(i k t) + \exp(- i k t)}{2}
= \frac{z^k + z^{-k}}{2}</math>
so that a rational function <math>f(z)</math> in <math>z</math> results from the substitution, and the integral becomes
:<math> \oint_{|z|=1} f(z) \frac{1}{iz} dz </math>
which is in turn computed by summing the residues of <math> f(z) </math> inside the unit circle.
[[Image:TrigonometricToComplex.png|right]]
The image at right illustrates this for
:<math> I = \int_0^\frac{\pi}{2} \frac{1}{1 + \sin(t)^2} dt,</math>
which we now compute. The first step is to recognize that
:<math> I = \frac{1}{4} \int_0^{2\pi} \frac{1}{1 + \sin(t)^2} dt.</math>
The substitution yields
:<math> \frac{1}{4} \oint_{|z|=1} \frac{4 i z}{z^4 - 6z^2 + 1} dz =
\oint_{|z|=1} \frac{i z}{z^4 - 6z^2 + 1} dz
.</math>
The poles of this function are at <math> 1 \pm \sqrt{2} </math> and <math> -1 \pm \sqrt{2}.</math>
Of these, <math>1+\sqrt{2}</math> and <math>-1-\sqrt{2}</math> are outside the unit circle (shown in red, not to scale), whereas <math>1-\sqrt{2}</math> and <math>-1+\sqrt{2}</math> are inside the unit circle (shown in blue). The corresponding residues are both equal to <math>-\frac{\sqrt{2}}{16} i</math>, so that the value of the integral is
:<math> I = 2 \pi i \; 2
\left( - \frac{\sqrt{2}}{16} i \right) = \pi \frac{\sqrt{2}}{4}.</math>
=== Example (IV) – branch cuts ===
Consider
: <math>\int_0^\infty {\sqrt{x} \over x^2+6x+8}\,dx.</math>
We can begin by formulating the complex integral
: <math>\int_C {\sqrt{z} \over z^2+6z+8}\,dz=I.</math>
[[Image:Keyhole_contour.svg|right|180px]]
We can use the Cauchy integral formula or residue theorem again to obtain the relevant residues. However, the important thing to note is that ''z''<sup>1/2</sup>=''e''<sup>1/2.Log(''z'')</sup>, so ''z''<sup>1/2</sup> has a [[branch cut]]. This affects our choice of the contour ''C''. Normally the logarithm branch cut is defined as the negative real axis, however, this makes the calculation of the integral slightly more complex, so we define it to be the positive real axis.
Then, we use the so-called ''keyhole contour'', which consists of a small circle about the origin of radius ε say, extending to a line segment parallel and close to the positive real axis but not touching it, to an almost full circle, returning to a line segment parallel, close, and below the positive real axis in the negative sense, returning to the small circle in the middle.
Note that ''z'' = −2 and ''z'' = −4 are inside the big circle. These are the two remaining poles, derivable by factoring the denominator of the integrand. The pole at ''z'' = 0 was avoided by detouring around the origin.
<br clear=all>
Let γ be the small circle of radius ε, Γ the larger, with radius ''r'', then
: <math>
\begin{align}
\int_C {\sqrt{z} \over z^2+6z+8}\,dz & = & \int_\varepsilon^R {\sqrt{z} \over z^2+6z+8}\,dz \\ & + &
\int_\Gamma {\sqrt{z} \over z^2+6z+8}\,dz \\ & + &
\int_R^\varepsilon {\sqrt{z} \over z^2+6z+8}\,dz \\ & + &
\int_\gamma {\sqrt{z} \over z^2+6z+8}\,dz.
\end{align}</math>
Since ''z''<sup>1/2</sup> = ''e''<sup>1/2 Log(''z'')</sup>, on the contour outside the branch cut, we have gained 2π in argument along γ (by [[Euler's Identity]], <math>e^{i \pi} \,\!</math> represents the unit vector, which therefore has <math>{i \pi} \,\!</math> as its log. This <math>{ \pi} \,\!</math> is what is meant by the argument of ''z''. The coefficient of 1/2 forces us to use 2 times <math>{ \pi} \,\!</math>);, so
: <math>\int_R^\varepsilon {\sqrt{z} \over z^2+6z+8}\,dz=\int_R^\varepsilon {e^{{1\over 2} \mathrm{Log}(z)} \over z^2+6z+8}\,dz=\int_R^\varepsilon {e^{{1\over 2}(\log{|z|}+i \arg{z})} \over z^2+6z+8}\,dz</math>
:<math>=\int_R^\varepsilon { e^{{1\over 2}\log{|z|}}e^{1/2(2\pi i)} \over z^2+6z+8}\,dz=\int_R^\varepsilon { e^{{1\over 2}\log{|z|}}e^{\pi i} \over z^2+6z+8}\,dz</math>
: <math>=\int_R^\varepsilon {-\sqrt{x} \over x^2+6x+8}\,dx=-\int_\varepsilon^R {-\sqrt{x} \over x^2+6x+8}\,dx</math>
simplifying,
: <math>=\int_\varepsilon^R {\sqrt{x} \over x^2+6x+8}\,dx,</math>
and then
:<math>
\begin{align}
\int_C {\sqrt{z} \over z^2+6z+8}\,dz & = & \int_\varepsilon^R {\sqrt{z} \over z^2+6z+8}\,dz \\ & + &
\int_\Gamma {\sqrt{z} \over z^2+6z+8}\,dz \\ & + &
\int_\varepsilon^R {\sqrt{z} \over z^2+6z+8}\,dz \\ & + &
\int_\gamma {\sqrt{z} \over z^2+6z+8}\,dz.
\end{align}</math>
It can be shown that the integrals over Γ and γ both tend to zero as ε tends to zero and ''R'' tends to infinity, by an estimation argument above. Thus, then,
:<math>\int_C {\sqrt{z} \over z^2+6z+8}\,dz=2\int_0^\infty {\sqrt{x} \over x^2+6x+8}\,dx.</math>
By using the residue theorem or the Cauchy integral formula (first employing the partial fractions method to derive a sum of two simple contour integrals) one obtains
: <math>\pi i \left({i\over \sqrt{2}}-i\right)=\int_0^\infty {\sqrt{x} \over x^2+6x+8}\,dx = \pi\left(1-{1\over\sqrt{2}}\right).\quad\square</math>
=== Example (V) – logarithms and the residue at infinity ===
[[Image:ContourLogs.png|right]]
We seek to evaluate
:<math>I = \int_0^3 {\left(x^3 (3-x)\right)^{1/4} \over 5-x}\,dx.</math>
This requires a close study of
:<math>f(z) = \left(z^3 (3-z)\right)^{1/4}.</math>
We will construct <math>f(z)</math> so that it has a branch cut on <math>[0, 3]</math>,
shown in red in the diagram. To do this, we choose two branches of the logarithm, setting
:<math> (z^3)^{1/4} = z^{3/4} = \exp(3/4 \log(z))
\quad \mbox{where} \quad
-\pi \le \arg(\log(z)) < \pi </math>
and
:<math> (3-z)^{1/4} = \exp(1/4 \log(3-z))
\quad \mbox{where} \quad
0 \le \arg(\log(z)) < 2\pi. </math>
The cut of <math>z^{3/4}</math> is therefore <math>(-\infty, 0]</math> and the cut of
<math>(3-z)^{1/4}</math> is <math>(-\infty, 3]</math>.
It is easy to see that the cut of the product of the two, i.e. <math>f(z)</math>, is
<math>[0, 3]</math>, because <math>f(z)</math> is actually continuous across
<math>(-\infty, 0).</math> This is because when <math>z = -r < 0</math> and we approach
the cut from above, <math>f(z)</math> has the value
:<math>
r^{3/4} \exp(3/4 \pi i) (3+r)^{1/4} \exp(2/4 \pi i) =
r^{3/4} (3+r)^{1/4} \exp(5/4 \pi i).\,</math>
When we approach from below, <math>f(z)</math> has the value
:<math>
r^{3/4} \exp(-3/4 \pi i) (3+r)^{1/4} \exp(0/4 \pi i) =
r^{3/4} (3+r)^{1/4} \exp(-3/4 \pi i).\,</math>
But <math>\exp(-3/4 \pi i) = \exp(5/4 \pi i),</math> so that we have continuity across the cut.
This is illustrated in the diagram, where the two black oriented circles are labelled
with the corresponding value of the argument of the logarithm used in <math>z^{3/4}</math> and
<math>(3-z)^{1/4}.</math>
We will use the contour shown in green in the diagram.
To do this we must compute the value of <math>f(z)</math> along the line segments just above and just below the cut.
Let <math>z = r</math> (in the limit, i.e. as the two green circles shrink to radius zero),
where <math>0 \le r \le 3.</math>
Along the upper segment, we find that <math>f(z)</math> has the value
:<math>
r^{3/4} \exp(3/4 \, 0 \, \pi i) (3-r)^{1/4} \exp(2/4 \pi i) =
i \, r^{3/4} (3-r)^{1/4}\,</math>
and along the lower segment,
:<math>
r^{3/4} \exp(3/4 \, 0 \, \pi i) (3-r)^{1/4} \exp(0/4 \pi i) =
r^{3/4} (3-r)^{1/4}\,</math>
It follows that the integral of <math>f(z)/(5-z)\,</math>
along the upper segment is <math>-i \, I</math> in the limit, and
along the lower segment, <math>I.\,</math>
If we can show that the integrals along the two green circles vanish in the limit,
then we also have the value of <math>I\,</math>, by the [[Cauchy residue theorem]].
Let the radius of the green circles be <math>\rho</math>, where <math>\rho < 1/1000</math>
and <math>\rho \rightarrow 0,</math> and apply the ML-inequality.
For the circle <math>C_L</math> on the left, we find
:<math> \left| \int_{C_L} \frac{f(z)}{5-z} dz \right| \le
2 \pi \rho \frac{\rho^{3/4} (3+1/1000)^{1/4}}{5-1/1000}
\in \mathcal{O} \left( \rho^{7/4} \right) \rightarrow 0.</math>
Similarly, for the circle <math>C_R</math> on the right, we have
:<math> \left| \int_{C_R} \frac{f(z)}{5-z} dz \right| \le
2 \pi \rho \frac{(3+1/1000)^{3/4} \rho^{1/4}}{2-1/1000}
\in \mathcal{O} \left( \rho^{5/4} \right) \rightarrow 0.</math>
Now using the [[Cauchy residue theorem]], we have
:<math> (1-i) I =
- 2\pi i \left(
\mathrm{Res}_{z=5} \frac{f(z)}{5-z} +
\mathrm{Res}_{z=\infty} \frac{f(z)}{5-z}
\right).</math>
Using the branch of the logarithm from before, clearly
:<math>
\mathrm{Res}_{z=5} \frac{f(z)}{5-z} =
- 5^{3/4} \exp(1/4 \log(-2)).</math>
The pole is shown in blue in the diagram. The value simplifies to
:<math>
- 5^{3/4} \exp(1/4 (\log(2) + \pi i) ) =
- \exp(1/4 \pi i) 5^{3/4} 2^{1/4}.\,</math>
We use the following formula for the residue at infinity:
:<math>\mathrm{Res}_{z=\infty} h(z) =
\mathrm{Res}_{z=0} - \frac{1}{z^2} h\left(\frac{1}{z}\right).</math>
Substituting, we find
:<math>1/(5-1/z) =
-z \left(1 + 5z + 5^2 z^2 + 5^3 z^3 + \cdots\right)</math>
and
:<math>\left(1/z^3 (3-1/z)\right)^{1/4} =
1/z \, (3z-1)^{1/4} = 1/z \exp(1/4 \pi i) (1-3z)^{1/4},
</math>
where we have used the fact that <math>-1 = \exp(\pi i)</math>
for the second branch of the logarithm.
Next we apply the binomial expansion, obtaining
:<math>1/z \exp(1/4 \pi i)
\left( 1 - {1/4 \choose 1} 3z + {1/4 \choose 2} 3^2 z^2 - {1/4 \choose 3} 3^3 z^3 + \cdots \right).
</math>
The conclusion is that
:<math>
\mathrm{Res}_{z=\infty} \frac{f(z)}{5-z} =
\exp(1/4 \pi i) (5 - 3/4) = \exp(1/4 \pi i) 17/4.</math>
Finally, it follows that the value of <math>I\,</math> is
:<math> I = - 2 \pi i \, \frac{\exp(1/4 \pi i)}{1-i}
\left( 17/4 - 5^{3/4} 2^{1/4} \right) =
- 2 \pi i \, 2^{-1/2} i \left( 17/4 - 5^{3/4} 2^{1/4} \right)</math>
which yields
:<math>I = \frac{\pi}{2\sqrt{2}} \left(17 - 5^{3/4} 2^{9/4} \right) =
\frac{\pi}{2\sqrt{2}} \left(17 - 40^{3/4} \right).</math>
==See also==
* [[Cauchy integral formula]] for an example of the application of this integral theorem
* [[Residue (complex analysis)]]
* [[Cauchy principal value]]
* [[Poisson integral]]
==References and notes==
<references/>
==External links==
* [http://www.exampleproblems.com/wiki/index.php/Complex_Variables#Complex_Integrals A collection of examples]
* [http://math.fullerton.edu/mathews/c2003/ResidueCalcMod.html Residue Calculus Module by John H. Mathews]
==Further reading==
* ''Les-Mathematiques.net'', Jean Jacquelin, Marko Riedel, ''[http://les-mathematiques.u-strasbg.fr/phorum/read.php?f=2&i=333327&t=333327 Branche univalente], Les-Mathematiques.net'', in French.
* Various authors, ''[http://groups.google.com/group/es.ciencia.matematicas/browse_thread/thread/036a688c9b6bbad3#2019491b71b209bd sin lĂmites ni cotas], es.ciencia.matematicas'', in Spanish.
</br>
{{Mathanalysis-stub}}
{{DSP}}
[[Category:Complex analysis]]