1. Not finding help here? Sign up for a free 30min 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!

Contour Integration with Trig Functions

  1. Oct 18, 2009 #1
    1. The problem statement, all variables and given/known data

    My question has two parts.

    The first part is the solution of the following integral:


    They give the answer as being [tex]\frac{\pi}{e}[/tex]

    This is actually an example problem in the book, but I don't understand how they reached the answer. I understand how to use Cauchy's Residue Theorem and how it is used here, but there is a step in the book where they go

    "Let [tex]cos\:x=e^{ix}[/tex] and then take only the real part of the solution"

    that I do not understand. They don't explain why I'm allowed to do this, and so I don't really know how I'm allowed to generalize this result. I don't think I would know what I would be allowed to do if the problem was [tex]\int^{\infty}_{-\infty}\frac{sin\:x\:dx}{1+x^{2}}[/tex] My best guess would be that I could let [tex]sin\:x=e^{ix}[/tex] and only take the imaginary part of the answer, but I'm not sure.

    Here's the second part of my question:
    I also have little idea of what to do when I come across more involved integrals like


    I have tried to change that Integral to


    and drawing my infinite arc of the closed curve in the top half of the complex plane where it encloses the singularity [tex]z=i[/tex], but I get the answer

    [tex]=(2\pi i)\frac{(e^{-1})(1+i)}{2i}=\frac{\pi}{2}(e^{-1})(1+i)[/tex]

    Which I know is not the right answer. After looking at it for a while, I realized I am not allowed to to double the limits of integration like that because the function is not even. Then I became lost on how I could draw my contour so as to enclose a singularity.

    If I could have help on why I am allowed to use the identity they used in the book, and how I could possibly draw my contour for the second integral, that would be appreciated.

    Thank You
  2. jcsd
  3. Oct 18, 2009 #2


    User Avatar
    Science Advisor
    Homework Helper

    For the first one, let's call the integrand f(x) = cos(x) / (1 + x2). So what you want to calculate is
    [tex]\int_{-\infty}^\infty f(x) dx[/tex].
    Now suppose that we replace the function f(x) by a complex function h(x) = f(x) + i g(x) [where g(x) is some arbitrary real function]. Then, by basic properties of integration and complex numbers,
    [tex]\int h(x) dx = \int (f(x) + i g(x)) dx = \int f(x) dx + i \int g(x) dx[/tex]
    (I'm leaving out the integration boundaries here, because it saves me typing).
    So in particular (since the integral of a real function is real),
    [tex]\int f(x) dx = \operatorname{Re}\left( \int h(x) dx \right)[/tex]

    Now the trick is of course to choose g(x) in such a way that h(x) is a convenient function to integrate. For example, if f(x) = cos(x), then setting g(x) = sin(x) will give you h(x) = cos(x) + i sin(x) = exp(ix) which is easy to do.

    Also, I don't see why you expected
    \int^{\infty}_{0}\frac{cos\:x+x\:sin\:x\:dx}{1+x^{ 2}}
    to be equal to
    [tex]e^{ix}(1 + x) = (cos x + i sin(x))(1 + x) = cos(x) + x cos(x) + i sin(x) + i x sin(x)[/tex]
    is something different from
    [tex]cos(x) + x sin(x) + i \cdot \text{something}[/tex]
  4. Oct 18, 2009 #3
    Alright, I think I get it now. Cos (x) was merely the real part of a larger complex function. And so the integral of


    would just be zero, Since the answer to the larger complex function only has a real part to it, and sin(x) is completely in the imaginary part.


    \int^{\infty}_{0}\frac{cos\:x+x\:sin\:x\:dx}{1+x^{ 2}}

    is just the real part of a larger complex function. I can say that the h(x) of this second function is

    \int h(x) dx =\int^{\infty}_{0}\frac{(cos\:x-ix)(i\:sin\:x+1)\:dx}{1+x^{2}}

    Now that I have my complex function, I can change the notation a bit, and now I just have to draw an appropriate closed curve around a singularity and use Cauchy's Residue Theorem. My curve should be a semicircle that has its arc in either the top or bottom half of the complex plane, and the integral along the path of the arc that I draw should go to zero as its radius extends to infinity. Only the integral along the real axis should contribute to the answer. The function is even for the real part at least, so I can also rewrite my integral a little and make the limits of integration extend over the entire real axis.

    So my closed curve becomes
    \oint h(z) dz=\int^{\infty}_{-\infty}\frac{1}{2}\frac{(cos\:z-iz)(i\:sin\:z+1)\:dz}{1+z^{2}}+\int_{Arc}\frac{(cos\:z-iz)(i\:sin\:z+1)\:dz}{1+z^{2}}

    I'm having trouble seeing how the arc goes to zero though. Transforming all the z into Re^it and dz into iRe^it dt and then taking the limit as R goes to infinity does not go to zero. All the R's in the sins and consines are bounded, but the values not in them, when multiplied by iRe^it given by dz = iRe^it dt match the order of (1+ Re^it)^2 in the denominator and don't let the limit go to zero.
    Last edited: Oct 18, 2009
  5. Oct 19, 2009 #4


    User Avatar
    Science Advisor
    Homework Helper

    No, I think you missed the point. Similarly, you can view sin(x) as the imaginary part of a larger complex function, so the integral you wrote is the imaginary part of the integral of this function. You can try to "prove" it in the same way as I did in my post (only this time multiply f(x) by i and add an appropriate real function to get a conveniently integrable function h(x)).

    For the second integration, it may be more convenient to split it up in cos(x) / (1 + x^2) and x sin(x) / (1 + x^2), as you have already done the first part by then.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Contour Integration with Trig Functions
  1. Trig contour integral (Replies: 17)