Results 1 to 11 of 11

Math Help - How to integrate cos(x)e-x^2 ?

  1. #1
    Newbie
    Joined
    Dec 2009
    Posts
    13

    How to integrate cos(x)e-x^2 ?

    I'd love to know how to integrate

     <br />
 \int cos(x)e^{-x^2} \,dx<br />

    and evaluate

    <br />
 \int_{-\infty}^{+\infty}cos(x)e^{-x^2} \,dx<br />
.

    I hope the latex comes out OK.

    Thanks for any ideas. I tried attacking the integral by doing it by parts, hoping for a bit of algebra in the style of sinx.e^x, but after two by parts, we end up with F = F if you know what I mean.

    iota
    Last edited by Jester; January 30th 2010 at 07:49 AM. Reason: fixed latex
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Nov 2008
    From
    France
    Posts
    1,458
    Quote Originally Posted by iota View Post
    I'd love to know how to integrate

     <br />
\int \cos(x)e^{-x^2} \,dx<br />

    and evaluate

    <br />
\int_{-\infty}^{+\infty} \cos(x)e^{-x^2} \,dx<br />
.

    I hope the latex comes out OK.

    Thanks for any ideas. I tried attacking the integral by doing it by parts, hoping for a bit of algebra in the style of sinx.e^x, but after two by parts, we end up with F = F if you know what I mean.

    iota
    With correct LATEX formula

    Here is what Wolfram thinks about this antiderivative
    Wolfram Mathematica Online Integrator
    Last edited by running-gag; January 30th 2010 at 06:03 AM. Reason: Complement added
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Dec 2009
    Posts
    13
    Thanks very much for correcting the latex!

    I would like to know how to go about solving this integral, not just the 'final' answer.

    So if anyone could point me to a different technique than by parts that would be great. I tried u = x^2 substitution but made things worse!!

    Regards,

    iota.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Senior Member
    Joined
    Jan 2009
    Posts
    296
    As the Wolfram answer showed, it involves the error function, and so it can not be expressed in terms of elementary functions. You can approximate it using one of the various rules like Midpoint Rule or Simpson's Rule though...
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Dec 2009
    Posts
    13
    Can we get anywhere with the definite integral between -inf and inf?

    I'd settle for that! :-)

    Is there some substitution involving imaginary numbers that would help?
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Super Member General's Avatar
    Joined
    Jan 2010
    From
    Kuwait
    Posts
    562
    Quote Originally Posted by iota View Post
    Can we get anywhere with the definite integral between -inf and inf?

    I'd settle for that! :-)

    Is there some substitution involving imaginary numbers that would help?
    You should write the whole question.
    The problem asked you to evaluate the value of the improper integral or just determine its convergence/divergence?
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Newbie
    Joined
    Dec 2009
    Posts
    13
    The questions are the two integrals (corrected for me) above.

    So far we know that the indefinite integral is restated as another integal via the error function.

    What about the definite integral?

    As we know the integral of e^-x^2 from -inf to inf, I'm hoping to transform my question into something similar via a substitution. It's going to be a complex substitution.

    But I'm not good enough to get further ...

    Any ideas for a substitution?

    PS The actual thing I'm trying to solve is another integral, but this will do for starters as it's more simple, but probably involves same technique.
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Super Member
    Joined
    Aug 2008
    Posts
    903
    Quote Originally Posted by iota View Post

    What about the definite integral?
    \int_{-\infty}^{\infty}\cos(x)e^{-x^2}dx=\text{Re}\,\int_{-\infty}^{\infty}e^{iz}e^{-z^2}dz

    =\text{Re}\,\int_{-\infty}^{\infty}e^{-[(z-i/2)^2+1/4]}dz=e^{-1/4}\sqrt{\pi}
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Newbie
    Joined
    Dec 2009
    Posts
    13
    Quote Originally Posted by shawsend View Post
    \int_{-\infty}^{\infty}\cos(x)e^{-x^2}dx=\text{Re}\,\int_{-\infty}^{\infty}e^{iz}e^{-z^2}dz

    =\text{Re}\,\int_{-\infty}^{\infty}e^{-[(z-i/2)^2+1/4]}dz=e^{-1/4}\sqrt{\pi}
    Thanks shawsend, that's excellent.

    e^-x^2 integrated is sqrt(pi). But how are you able to go from e^{-[(z-i/2)^2]} to that value in one step above? I thought it might be something like e^-(x-a)^2 is just e^-x^2 shifted to the right so has same integral with these limits. But there's an i in there which I'm sort of worrying about because I don't know anything about complex analysis.

    If you could just help fill in this last query, that would make my weekend!

    Cheers,

    iota
    Follow Math Help Forum on Facebook and Google+

  10. #10
    Super Member
    Joined
    Aug 2008
    Posts
    903
    Well if it was just real numbers that would make sense right like:

    \int_{-\infty}^{\infty} e^{-(x+1000)^2}dx and I just let u=x+1000 then the limits are still at \pm \infty so I get the same answer. Probably could use that same argument for any constant x+k even if k is complex but also if it's complex like:

    \int_{-\infty}^{\infty} e^{-(z+ai)^2}dz

    then I can consider a "contour integral" over a square contour which goes along the real axis, up ai across then down ai and the integral over the horizontal legs are zero so the integral over z+ai is the same as the integral over z by the Residue Theorem.
    Last edited by shawsend; January 30th 2010 at 03:45 PM.
    Follow Math Help Forum on Facebook and Google+

  11. #11
    Newbie
    Joined
    Dec 2009
    Posts
    13
    Quote Originally Posted by shawsend View Post
    Well if it was just real numbers that would make sense right like:

    \int_{-\infty}^{\infty} e^{-(x+1000)^2}dx and I just let u=x+1000 then the limits are still at \pm \infty so I get the same answer. Probably could use that same argument for any constant x+k even if k is complex but also if it's complex like:

    \int_{-\infty}^{\infty} e^{-(z+ai)^2}dz

    then I can consider a "contour integral" over a square contour which goes along the real axis, up ai across then down ai and the integral over the horizontal legs are zero so the integral over z+ai is the same as the integral over z by the Residue Theorem.
    Hi

    Sorry for delay in reply. Had to sleep :-) I have had a brief look at the contour integration and the residue theorem. Thanks very much for the introduction! And I do understand your explanation. I will come back to this to fill in my knowledge for sure.

    Now I've got the true problem to do which is the integral of cos(2x)*normal density from -inf to inf. Should fall out in a similar way hopefully. The whole point of this is I want to verify a Monte Carlo approximation and have had a nice excursion along the way.

    Cheers!

    iota
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Integrate 3 e^x
    Posted in the Calculus Forum
    Replies: 4
    Last Post: June 9th 2010, 02:16 PM
  2. how to integrate this ??
    Posted in the Calculus Forum
    Replies: 8
    Last Post: August 9th 2009, 09:14 PM
  3. Integrate
    Posted in the Calculus Forum
    Replies: 7
    Last Post: April 28th 2009, 08:54 PM
  4. How to integrate x^x?
    Posted in the Calculus Forum
    Replies: 5
    Last Post: April 25th 2009, 08:51 PM
  5. Integrate
    Posted in the Calculus Forum
    Replies: 8
    Last Post: April 15th 2009, 04:50 PM

Search Tags


/mathhelpforum @mathhelpforum