1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Contour integration

  1. May 21, 2009 #1
    1. The problem statement, all variables and given/known data

    [tex] \int^{\infty}_{0} \frac {\sqrt{x}}{1+x^{2}} dx [/tex]

    2. Relevant equations

    3. The attempt at a solution

    [tex] f(z) = \frac {\sqrt{z}}{1+z^{2}} = \frac {\sqrt{z}}{(z-i)(z+i)} [/tex]

    [tex] Res[f,i] = \lim_{z \to i} \frac {\sqrt {z}}{z+i}} = \frac {\sqrt {i}}{2i} = \frac {1}{2i} (\frac {\sqrt {2}}{2}} + i \frac {\sqrt {2}}{2}}) = \frac {\sqrt {2}}{4} - i \frac {\sqrt {2}}{4} [/tex]

    [tex] Res[f,-i] = \lim_{z \to -i} \frac {\sqrt {z}}{z-i}} = \frac {\sqrt {-i}}{-2i} = \frac {1}{-2i} (\frac {\sqrt {2}}{2}} - i \frac {\sqrt {2}}{2}}) = \frac {\sqrt {2}}{4} + i \frac {\sqrt {2}}{4} [/tex]

    [tex] \int^{\infty}_{0} \frac {\sqrt{x}}{1+x^{2}} dx = \frac {2 \pi i}{1-e^{i \pi}} [ \frac {\sqrt {2}}{4} - i \frac {\sqrt {2}}{4} + \frac {\sqrt {2}}{4} + i \frac {\sqrt {2}}{4}] = \frac {2 \pi i}{2}( \frac {\sqrt {2}}{2}) = i \frac {\sqrt {2}}{2} \pi [/tex]

    I've done this problem over and over again and I can't figure out where I made a mistake. The answer obviously can't be imaginary.
  2. jcsd
  3. May 21, 2009 #2
    What contour have you used?
    Could it have something to with the choice of brance of the square root function?
  4. May 21, 2009 #3


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    What contour are you using, and how does it relate to the interval for your desired integral (positive real axis)?
  5. May 21, 2009 #4
    Be careful when you apply square roots to complex numbers. There is always some ambiguity present. In this case you have:

    [tex]\sqrt{i} = \pm \frac{2}{\sqrt{2}}\left(1+i\right)[/tex]
    [tex]\sqrt{-i} = \pm \frac{2}{\sqrt{2}}\left(1-i\right)[/tex]

    A different sign choice leads to the correct answer. My guess is that if you carefully define the square root as the exponential of a logarithm, with a proper condition on the branch cut of the logarithm, you can avoid this ambiguity. But I haven't checked this.

    Yes, you first use:
    [tex]\sqrt{i} = \frac{2}{\sqrt{2}}\left(1+i\right)[/tex]
    With this choice you have implicitly defined your choice for the square root function. For the second square root you must apply [tex]\sqrt{-1} = i[/tex] or else you run in to inconsistencies (as you noticed). So:
    [tex]\sqrt{-i} = \sqrt{-1}\sqrt{i} = i \sqrt{i} = -\frac{2}{\sqrt{2}}\left(1-i\right)[/tex]

    In that case you get the correct answer.
    Last edited: May 21, 2009
  6. May 21, 2009 #5
    keyhole contour

    http://upload.wikimedia.org/wikipedia/commons/thumb/8/8d/Keyhole_contour.svg/180px-Keyhole_contour.svg.png" [Broken]
    Last edited by a moderator: May 4, 2017
  7. May 21, 2009 #6


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Check out Example IV - Branch Cuts on this page:


    in particular the non-standard branch cut they choose so that the square root is continuous on and inside the keyhole contour.
    Last edited by a moderator: May 4, 2017
  8. May 21, 2009 #7
    Because the imaginary unit [itex]i[/itex] is familiar number we can easily make mistakes with the branch cuts. Try to compute the more general integral using the same contour:

    [tex]\int_{0}^{\infty}\frac{x^{-p}}{1+x}dx=\frac{\pi}{\sin(\pi p)}[/tex]

    Your integral can transformed into this one by substituting x = sqrt(y).

    You can also substitute x = y^2 and then consider the contour from y= 0 to R, a quarter circle to i R and then from i R back to zero.
  9. May 21, 2009 #8
    Does it matter which root you pick for [tex] \sqrt {i} [/tex]? And could you pick the root for [tex] \sqrt {-i} [/tex] first?
  10. May 21, 2009 #9
    If you write a complex number z in the form r exp(i theta), then you define sqrt(z) as sqrt(r) exp(i theta/2). So, the only thing there is to choose is what interval for the angle theta to use. You can choose the interval from zero to 2 pi or minus pi to plus pi. But it must be the case that any complex number has a unique value for the polar angle theta for the square root to be defined.

    Then, for this contour integration, there is another thing to consider. The square root function must be continuous along the contour. So, you are then forced to choose theta between zero and 2 pi and let the so-called branch cut be along the positive x-axis.
  11. May 21, 2009 #10
    You're calculating the residue at -i incorrectly for the branch you're using. Your branch is defined as:

    [tex]\sqrt{z}=r^{1/2}e^{i/2(\arg(z))},\quad 0\leq arg(z)<2\pi[/tex]

    then the argument of -i is what?
  12. May 21, 2009 #11
    [tex] \frac {3}{2} \pi [/tex]
  13. May 21, 2009 #12
    Ok then:

    [tex]\mathop\text{Res}_{z=-i} \frac{\sqrt{z}}{(z+i)(z-i)}=\frac{\sqrt{-i}}{-2i}[/tex]

    and then calculate [tex]\sqrt{-i}[/tex] using that argument.
  14. May 21, 2009 #13
    Or, if you are lazy, change the contour into a half circle.
  15. May 21, 2009 #14
    [tex] Res[f,-i] = \lim_{z \to -i} \frac {\sqrt {z}}{z-i}} = \frac {\sqrt {-i}}{-2i} = \frac {1}{-2i}(cos (\frac {3 \pi}{4}) + i sin (\frac {3 \pi}{4}) ) = \frac {1}{-2i} ( \frac {-\sqrt {2}}{2}} + i \frac {\sqrt {2}}{2}}) = \frac {-\sqrt {2}}{4} - i \frac {\sqrt {2}}{4} [/tex]

    then [tex] \int^{\infty}_{0} \frac {\sqrt{x}}{1+x^{2}} dx = \frac {2 \pi i}{1-e^{i \pi}} [ \frac {\sqrt {2}}{4} - i \frac {\sqrt {2}}{4} - \frac {\sqrt {2}}{4} - i \frac {\sqrt {2}}{4}] = \frac {2 \pi i}{2}( -i \frac {\sqrt {2}}{2}) = \frac {\sqrt {2}}{2} \pi [/tex]

    Thanks. I was using [tex] -\frac {\pi}{2} [/tex] for the argument.
  16. May 21, 2009 #15
    What branch would be used for [tex] \sqrt {z} [/tex] ?
  17. May 21, 2009 #16
    Take the contour from z = epsilon to R, then a half circle in the upper half plane to minus R, then to minus epsilon, and then half a circle in the upper half plane to plus epsilon.
    You can then put the branch cut anywhere in the lower half of the complex plane. If I is the integral from epsilon to R, then the integral from minus R to minus epsilon is i I. The Contour integral in the limit epsilon to zero and R to infinite becomes:

    (1+i) I

    Residue theorem gives the contour integral as

    2 pi i *exp(pi i/4)/(2i) = pi/sqrt(2) (1+i)

    So, it follows that I = pi/sqrt(2).

    This is then easier as there is only one pole in the contour. Also, the choice of te branch cut is less critical. The integral from minus R to minus epsilon is i I, essentially because -1 = exp(pi i) and not e.g. exp(- pi i), but in this case it is hard to get this wrong.
  18. May 22, 2009 #17
    One more thing Random: If you really want to get good at these, learn to draw them. It then becomes crystal clear what's going on with the branches and also, it's quite a programming challenge to draw the complicated ones.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook