Status: Accepted
Owner: ----
Labels: Type-Defect Priority-Medium Simplify
New issue 3024 by [email protected]: simplify() doesn't work without extra
factor
http://code.google.com/p/sympy/issues/detail?id=3024
In [140]: a = integrate(exp(-I*(k*sqrt(t) + x/(2*sqrt(t)))**2), (k, -oo,
oo), conds='none')
In [141]: a
Out[141]:
⎛ 2 ⎛ -3⋅ⅈ⋅π⎞ ⎞
⎜ 3⋅ⅈ⋅π ⅈ⋅x ⎜ ──────⎟ ⎟
⎜ - ───── + ──── ⎜ 4 ⎟ 2⎟
⎜ 4 4⋅t ⎜x⋅ℯ ⎟ 3⋅ⅈ⋅π ⅈ⋅x ⎟
2 ⎛ ⎛ ⅈ⋅π⎞ ⎞
⎜ π⋅x⋅ℯ ⋅erf⎜─────────⎟ - ───── + ────⎟
-ⅈ⋅x ⎜ ⎜ ───⎟ ⎟ ⅈ⋅π
⎜ ⎜ ___ ⎟ 4 4⋅t ⎟
───── ⎜ ⎜ 4 ⎟ ⎟ ───
⎜ ⎝ 2⋅╲╱ t ⎠ π⋅x⋅ℯ ⎟ 4⋅t
___ ⎜ ⎜ x⋅ℯ ⎟ ⎟ 4
ⅈ⋅⎜- ────────────────────────────────── + ───────────────────⎟⋅ℯ
ⅈ⋅╲╱ π ⋅⎜- erf⎜───────⎟ + 1⎟⋅ℯ
⎜ ___ ___
⎟ ⎜ ⎜ ___⎟ ⎟
⎝ 2⋅╲╱ t 2⋅╲╱ t
⎠ ⎝ ⎝2⋅╲╱ t ⎠ ⎠
───────────────────────────────────────────────────────────────────── -
─────────────────────────────────
___ ___
╲╱ π
⋅x 2⋅╲╱ t
In [142]: simplify(a)
Out[142]:
⎛ ⎛4 ____ ⎞ ⎛4 ____ ⎞ ⎞
4 ____ ___ ⎜ ⎜╲╱ -1 ⋅x⎟ 4 ____ ⎜╲╱ -1 ⋅x⎟ 4 ____⎟
-╲╱ -1 ⋅ⅈ⋅╲╱ π ⋅⎜erf⎜────────⎟ + ╲╱ -1 ⋅erf⎜────────⎟ + 1 - ╲╱ -1 ⎟
⎜ ⎜ ___ ⎟ ⎜ ___ ⎟ ⎟
⎝ ⎝2⋅╲╱ t ⎠ ⎝2⋅╲╱ t ⎠ ⎠
───────────────────────────────────────────────────────────────────
___
2⋅╲╱ t
In [143]: simplify(a*exp(x**2/(4*t)))
Out[143]:
2
3⋅ⅈ⋅π x
- ───── + ───
___ 4 4⋅t
ⅈ⋅╲╱ π ⋅ℯ
──────────────────────
___
╲╱ t
But the exp(x**2/(4*t)) can be pulled out of the final expression, so
simplify() should be able to do it without it. My guess is it needs to
complete the square somewhere, but I haven't actually looked into it.
--
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.