Help with integral of a gaussian function

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 5K views
maxtor101
Messages
22
Reaction score
0
Hi all!

I'm curious as to how one would go about actually computing this integral

[tex]\int_0^\pi \exp(\frac{-x^2}{2c^2})\sin(\frac{m\pi x}{2}) dx[/tex]

I start off by using integration by parts but I am unsure how to solve this integral

[tex]v = \int_0^\pi \exp(\frac{-x^2}{2c^2}) dx[/tex]

Any help would be greatly appreciated
Max
 
Physics news on Phys.org
Note that [itex]\int[/itex]exp(-ax[itex]^{2}[/itex])dx x [itex]\int[/itex]exp(-ay[itex]^{2}[/itex])dy = [itex]\int[/itex][itex]\int[/itex]exp{-a[x[itex]^{2}[/itex]+y[itex]^{2}[/itex]]}dxdy.

Then change to polar coordinates.
 
Note that a lot of integrals of that form (including the normal probability density function) don't have solutions in closed form.
 
grzz said:
Note that [itex]\int[/itex]exp(-ax[itex]^{2}[/itex])dx x [itex]\int[/itex]exp(-ay[itex]^{2}[/itex])dy = [itex]\int[/itex][itex]\int[/itex]exp{-a[x[itex]^{2}[/itex]+y[itex]^{2}[/itex]]}dxdy.

Then change to polar coordinates.

I don't think the OP is doing the integral you think he's doing.

maxtor101 said:
Hi all!

I'm curious as to how one would go about actually computing this integral

[tex]\int_0^\pi \exp(\frac{-x^2}{2c^2})\sin(\frac{m\pi x}{2}) dx[/tex]

I start off by using integration by parts but I am unsure how to solve this integral

[tex]v = \int_0^\pi \exp(\frac{-x^2}{2c^2}) dx[/tex]

Any help would be greatly appreciated
Max

You're not really going to have much luck with that integral. Without the sine, the integral can only be expressed in terms of the error function, but the error function is defined by

[tex]\mbox{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^x dt~e^{-t^2},[/tex]

so you haven't gained much except that you know you can express it as the error function, which mathematica, matlab, etc., have code to compute.

If you through the sine back in there, that just makes it worse. wolframalpha calculates the integral in terms of functions related to the error function. I imagine the way it does this is to use Euler's identity and write

[tex]\sin x = \frac{e^{ix}-e^{-ix}}{2i},[/tex]

and then complete the square in the exponential, but there's some trickiness associated with that because you'll be introducing imaginary numbers into the limits of the integral. That's not really a problem if you know contour integrals and complex analysis, but if you don't writing the integral that way isn't really going to help you much.