Comment #1 on issue 3037 by [email protected]: integrate(exp(I*k*x)/(k**2 -
2*lamda + 1), (k, -oo, oo)) should be expressible in closed form
http://code.google.com/p/sympy/issues/detail?id=3037
This quite nicely illustrates a couple of problems with the code. First of
all, let us consider `integrate(exp(I*k*x)/(k**2 + lamda**2)` -- purely to
reduce clutter. Now, also assume that `x` and `lamda` are positive. Then
the integral is evaluated as follows:
In [11]: integrate(exp(I*k*x)/(k**2+l**2), (k, -oo, oo), meijerg=True)
Out[11]:
⎛ │ 2 2 -ⅈ⋅π⎞ ⎛ │ 2 2
ⅈ⋅π⎞
╭─╮3, 1 ⎜ 1/2 │ λ ⋅x ⋅ℯ ⎟ ╭─╮3, 1 ⎜ 1/2 │ λ ⋅x
⋅ℯ ⎟
│╶┐ ⎜ │ ───────────⎟ │╶┐ ⎜ │
──────────⎟
╰─╯1, 3 ⎝1/2, 0, 1/2 │ 4 ⎠ ╰─╯1, 3 ⎝1/2, 0, 1/2 │
4 ⎠
────────────────────────────────────── +
─────────────────────────────────────
___ ___
2⋅╲╱ π ⋅λ 2⋅╲╱ π ⋅λ
This is the baseline for discussion.
1) This combination of g-functions can be evaluated. However, that is
fairly tricky, and essentially boils down to the fact that `1/(k**2 +
lamda**2)` can be expanded using partial fractions. It seems fairly
difficult to recognise this in hyperexpand.
Which brings us to 2). The "good" way to do this integral is using partial
fractions (in our framework). However, `apart` is not strong enough. There
is a bug report, but I'm not aware of its status.
3) "cosmetic" problems.
Suppose that we had partial fractions code to evaluate the integral by
considering 1/(k+I*lamda) and 1/(k-I*lamda) separately. What else would we
need to get a good answer?
First of all, with assumptions as above, if you do the partial fractions
expansion by hand, then you get the correct result (there is no abs in the
exponential since x was assumed positive). If you remove the assumption on
x, then the code will return 'x>0' as a requirement. That is somewhat
unfortunate, since you can declare x negative and it will also compute the
right answer. (This incidentially does not work without doing partial
fractions. What conditions work and what not can be misterious.)
So ideally the code should recognise such a situation and return a complete
answer.
Moreover, if you remove the assumptions on lambda, we get messy conditions.
These should be simplified.
Finally, doing the complicated denominator has basically the same
discussion, except that condition simplification fails even more horribly.
--
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.