Comment #12 on issue 1280 by [email protected]: integrate(1/((a-x)*(b-x)), x) is giving too complex results (probably correct)
http://code.google.com/p/sympy/issues/detail?id=1280

Now I'm not so sure that unequivocally calling apart() before integrating rational functions is such a good idea. The reason is that it can result in more logarithms than before. For example (the integral of tan(x) recursively integrates a rational function u/(-u**2 + 1)

Before:

In [1]: integrate(tan(x), x)
Out[1]:
    ⎛   2       ⎞
-log⎝sin (x) - 1⎠
─────────────────
        2

After:

In [3]: integrate(tan(x), x)
Out[3]:
  log(2⋅sin(x) - 2)   log(2⋅sin(x) + 2)
- ───────────────── - ─────────────────
          2                   2


This leads to less nice results from dsolve():

Before:

In [2]: dsolve(f(x).diff(x)/tan(x) - f(x) - 2)
Out[2]:
              C₁
f(x) = ──────────────── - 2
          _____________
         ╱    2
       ╲╱  sin (x) - 1

After:

In [1]: dsolve(f(x).diff(x)/tan(x) - f(x) - 2)
Out[1]:
                     C₁
f(x) = ───────────────────────────── - 2
         ____________   ____________
       ╲╱ sin(x) - 1 ⋅╲╱ sin(x) + 1

On the other hand, there is no question that this is preferable for 1/((x-a)*(x-b)*(x-c)), because it takes forever without it and returns instantly with it.

Perhaps a better solution would be to investigate why 1/((x-a)*(x-b)*(x-c)) is so slow, and see if it can't be fixed directly.

--
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.

Reply via email to