• Support PF! Buy your school textbooks, materials and every day products Here!

Contour integration

  • #1

Homework Statement



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

Homework Equations





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.
 

Answers and Replies

  • #2
64
0
What contour have you used?
Could it have something to with the choice of brance of the square root function?
 
  • #3
jbunniii
Science Advisor
Homework Helper
Insights Author
Gold Member
3,394
179
What contour are you using, and how does it relate to the interval for your desired integral (positive real axis)?
 
  • #4
525
6
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.

EDIT:
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:
  • #5
What contour have you used?
Could it have something to with the choice of brance of the square root function?
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:
  • #6
jbunniii
Science Advisor
Homework Helper
Insights Author
Gold Member
3,394
179
Last edited by a moderator:
  • #7
1,838
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.
 
  • #8
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.

EDIT:
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.
Does it matter which root you pick for [tex] \sqrt {i} [/tex]? And could you pick the root for [tex] \sqrt {-i} [/tex] first?
 
  • #9
1,838
7
Does it matter which root you pick for [tex] \sqrt {i} [/tex]? And could you pick the root for [tex] \sqrt {-i} [/tex] first?
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.
 
  • #10
54
0

Homework Statement



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

Homework Equations





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.
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?
 
  • #11
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?
[tex] \frac {3}{2} \pi [/tex]
 
  • #12
54
0
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.
 
  • #13
1,838
7
Or, if you are lazy, change the contour into a half circle.
 
  • #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.
 
  • #15
Or, if you are lazy, change the contour into a half circle.
What branch would be used for [tex] \sqrt {z} [/tex] ?
 
  • #16
1,838
7
What branch would be used for [tex] \sqrt {z} [/tex] ?
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.
 
  • #17
54
0
[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.
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.
 

Related Threads for: Contour integration

  • Last Post
Replies
4
Views
938
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
4
Views
1K
  • Last Post
Replies
7
Views
3K
  • Last Post
Replies
4
Views
1K
  • Last Post
Replies
1
Views
850
  • Last Post
Replies
8
Views
1K
  • Last Post
Replies
1
Views
876
Top