Updates:
Labels: NeedsReview
Comment #14 on issue 841 by [email protected]:
integrate(exp(-x**2)*exp(I*k*x), (x, -oo, oo)) doesn't calculate the
integral
http://code.google.com/p/sympy/issues/detail?id=841
The definite integral works in gsoc-3
(https://github.com/sympy/sympy/pull/543):
In [6]: integrate(exp(-x**2)*exp(I*k*x), (x, -oo, oo))
Out[6]:
2 2
-k -k
─── ───
⎽⎽⎽ ⎛ ⎛ⅈ⋅k⎞ ⎞ 4 ⎽⎽⎽ ⎛ ⎛ⅈ⋅k⎞ ⎞ 4
╲╱ π ⋅⎜- erf⎜───⎟ + 1⎟⋅ℯ ╲╱ π ⋅⎜erf⎜───⎟ + 1⎟⋅ℯ
⎝ ⎝ 2 ⎠ ⎠ ⎝ ⎝ 2 ⎠ ⎠
─────────────────────────── + ─────────────────────────
2 2
In [7]: expand_mul(_)
Out[7]:
2
-k
───
⎽⎽⎽ 4
╲╱ π ⋅ℯ
We can also get an antederivative, but only by cheating:
In [10]: integrate(exp(-x**2)*exp(I*k*x), (x, -oo, y), meijerg=True)
Out[10]:
2
2 ⎛ⅈ⋅k ⎞
y ⋅⎜─── - 2⎟
⎛ ⎛ ⎛ⅈ⋅k ⎞⎞ ⎞ ⎝ y ⎠
⎜ ⎜y⋅⎜─── - 2⎟⎟ ⎟ 2 ─────────────
⎽⎽⎽ ⎜ ⎜ ⎝ y ⎠⎟ ⎟ -y 4 ⅈ⋅k⋅y
╲╱ π ⋅⎜- erf⎜───────────⎟ + 1⎟⋅ℯ ⋅ℯ ⋅ℯ
⎝ ⎝ 2 ⎠ ⎠
─────────────────────────────────────────────────────────
2
In [11]: _.diff(y)
Out[11]:
2
2 ⎛ⅈ⋅k ⎞
y ⋅⎜─── -
2⎟
2 ⎛
⎛ ⎛ ⎛ⅈ⋅k ⎞⎞ ⎞ ⎝ y
⎠ 2 ⎛ⅈ⋅k
⎞ ⎜
⎜ ⎜y⋅⎜─── - 2⎟⎟ ⎟ 2
───────────── y ⋅⎜─── -
2⎟ ⎜ ⅈ
⎽⎽⎽ ⎜ ⎜ ⎝ y ⎠⎟ ⎟ -y 4 ⅈ⋅k⋅y
⎛ ⎛ ⎛ⅈ⋅k ⎞⎞ ⎞ ⎝ y ⎠ ⎽⎽⎽ ⎜
ⅈ⋅╲╱ π ⋅k⋅⎜- erf⎜───────────⎟ + 1⎟⋅ℯ ⋅ℯ ⋅ℯ
⎜ ⎜y⋅⎜─── - 2⎟⎟ ⎟ 2 ───────────── ╲╱ π ⋅⎜- ─
⎝ ⎝ 2 ⎠ ⎠ ⎽⎽⎽
⎜ ⎜ ⎝ y ⎠⎟ ⎟ -y 4 ⅈ⋅k⋅y ⎝
───────────────────────────────────────────────────────────── - ╲╱ π ⋅y⋅⎜-
erf⎜───────────⎟ + 1⎟⋅ℯ ⋅ℯ ⋅ℯ + ──────────
2
⎝ ⎝ 2 ⎠ ⎠
2
2 ⎛ⅈ⋅k ⎞
2⎞ y ⋅⎜─── - 2⎟
⎛ⅈ⋅k ⎞ ⎛ⅈ⋅k ⎞ ⎟ ⎛ ⎛ ⎛ⅈ⋅k ⎞⎞ ⎞ ⎝ y ⎠
⋅k⋅⎜─── - 2⎟ y⋅⎜─── - 2⎟ ⎟ ⎜ ⎜y⋅⎜─── - 2⎟⎟ ⎟ 2 ─────────────
⎝ y ⎠ ⎝ y ⎠ ⎟ ⎜ ⎜ ⎝ y ⎠⎟ ⎟ -y 4
ⅈ⋅k⋅y
──────────── + ────────────⎟⋅⎜- erf⎜───────────⎟ + 1⎟⋅ℯ ⋅ℯ
⋅ℯ 2
2 2 ⎠ ⎝ ⎝ 2 ⎠
⎠ -y ⅈ⋅k⋅y
────────────────────────────────────────────────────────────────────────────────
+
ℯ ⋅ℯ
2
In [12]: expand(_)
Out[12]:
2
-y ⅈ⋅k⋅y
ℯ ⋅ℯ
I don't think there are enough examples to warrant implementing this trick,
in particular since it should work more nicely with risch.
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.