Updates:
Status: Started
Owner: mattpap
Labels: Milestone-Release0.7.0 Polynomial Integration
Comment #3 on issue 1280 by mattpap: integrate(1/((a-x)*(b-x)), x) is
giving too complex results (probably correct)
http://code.google.com/p/sympy/issues/detail?id=1280
Recently I added undetermined coefficients method to apart(), so now we
have:
In [1]: var('a,b,c')
Out[1]: (a, b, c)
In [2]: 1/((x-a)*(x-b)*(x-c))
Out[2]:
1
───────────────────────
(x - a)⋅(x - b)⋅(x - c)
In [3]: %time apart(_, x)
CPU times: user 0.60 s, sys: 0.00 s, total: 0.60 s
Wall time: 0.62 s
Out[4]:
1
1 1
────────────────────────────── + ────────────────────────────── +
──────────────────────────────
⎛ 2⎞ ⎛ 2⎞
⎛ 2⎞
(x - a)⋅⎝b⋅c - a⋅b - a⋅c + a ⎠ (x - b)⋅⎝a⋅c - a⋅b - b⋅c + b ⎠ (x -
c)⋅⎝a⋅b - a⋅c - b⋅c + c ⎠
In [5]: integrate(_, x)
Out[5]:
log(x - a) log(x - b) log(x - c)
──────────────────── + ──────────────────── + ────────────────────
2 2 2
b⋅c - a⋅b - a⋅c + a a⋅c - a⋅b - b⋅c + b a⋅b - a⋅c - b⋅c + c
In [6]: factor(together(diff(_, x)))
Out[6]:
1
───────────────────────
(x - a)⋅(x - b)⋅(x - c)
Result [5] is still far from the "best", but at least it doesn't hang. New
apart() is still a bit slow, especially when additional parameters are
involved (this is because of slow matrices and solve()).
What remains to do in this issue, is to add new apart() support to
integrate().
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to sympy-iss...@googlegroups.com.
To unsubscribe from this group, send email to
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.