My favorites | Sign in
Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 841: integrate(exp(-x**2)*exp(I*k*x), (x, -oo, oo)) doesn't calculate the integral
5 people starred this issue and may be notified of changes. Back to list
Status:  Started
Owner:  ----
Type-Defect
Priority-Medium
EasyToFix
Milestone-Release0.6.6
NeedsBetterPatch


Sign in to add a comment
 
Reported by joaolsi...@yahoo.com, May 06, 2008

The Fourier transform of a Gaussian:

integrate(exp(-x**2)*exp(I*k*x), (x, -oo, oo))

is sqrt(pi)*exp(k**2/4), but sympy can't calculate it yet. Of course, it
should implement the most general case:

integrate(c*exp(-x**2/a)*exp(I*k*x), (x, -oo, oo)) with a>0

I don't mind implementing it myself, but as I'm new to sympy I'm still
looking for the right place to add the code. Either a patch, or hints to
where the integration rules are stored would be welcome.
Comment 1 by joaolsi...@yahoo.com, May 06, 2008
This should be useful:

http://www.ph.tn.tudelft.nl/~lucas/education/tn254/2002/Fourier%20transform%20of%20a%20Gaussian.pdf

I've found the place where the substitution is made for the integral of exp(-a*x**2)
in risch.py. I suppose that is the right place to implement this integral. 

Should Fourier transforms have their own function (as in Maple), or should the normal
integrating routine be able to calculate them? I think the former would be better,
and even better if Dirac deltas were supported without further imports.
Comment 2 by ondrej.certik, May 07, 2008
> I don't mind implementing it myself, but as I'm new to sympy I'm still
> looking for the right place to add the code. Either a patch, or hints to
> where the integration rules are stored would be welcome.

I attached a patch solves your integral:

In [1]: integrate(exp(-x**2)*exp(I*k*x), (x, -oo, oo))
Out[1]: 
        2
       k 
       ──
  ⎽⎽⎽  4 
╲╱ π *ℯ  


That's how I'd implement it, Mateusz, do you have any comments to it? 

João, feel free to take the patch, add more integrals, tests, docstrings.

> Should Fourier transforms have their own function (as in Maple), or should the normal
> integrating routine be able to calculate them? I think the former would be better,
> and even better if Dirac deltas were supported without further imports.

I think we can have a function for it to have something now. However, the integration
code should be able to handle them as well in the long term.
definite_integrals.patch
1.4 KB   Download
Status: Started
Labels: NeedsReview
Comment 3 by mattpap, May 07, 2008
> That's how I'd implement it, Mateusz, do you have any comments to it? 

For now it's OK, in longer term I will handle integrals of this kind via Meijer
G-functions (this will also provide (quite) general interface for all sorts of
transforms like Laplace etc.).
Comment 4 by ondrej.certik, May 20, 2008
joaolsi, do you need anything else to get you going? What remains to be done is to
write a test, then it can go in.
Labels: -NeedsReview easy-to-fix
Comment 5 by rwnobrega, May 21, 2008
(No comment was entered for this change.)
Labels: -easy-to-fix EasyToFix
Comment 6 by ondrej.certik, Sep 20, 2008
Let's get this in, it's almost ready.
Labels: Milestone-Release0.6.3
Comment 7 by ondrej.certik, Nov 13, 2008
(No comment was entered for this change.)
Labels: -Milestone-Release0.6.3 Milestone-Release0.6.4
Comment 8 by ondrej.certik, Feb 08, 2009
(No comment was entered for this change.)
Labels: -Milestone-Release0.6.4 Milestone-Release0.6.5
Comment 9 by ondrej.certik, Jul 13, 2009
(No comment was entered for this change.)
Labels: Milestone-Release0.6.6
Comment 10 by Vinzent.Steinberg, Dec 01, 2009
Who want's to work on this?
Comment 11 by Vinzent.Steinberg, Dec 01, 2009
(No comment was entered for this change.)
Labels: NeedsBetterPatch
Sign in to add a comment

Hosted by Google Code