Updates:
        Labels: Integration

Comment #3 on issue 2066 by asmeurer: integration of c**2*exp(c/x)/(x**3*(1+exp(c/x)**2)) fails
http://code.google.com/p/sympy/issues/detail?id=2066

Because I can't resist showing off my work, I can't help but mention that this is going to be much more awesome with the new Risch Algorithm integrator (issue 2010):

In [1]: var('c')
Out[1]: c

In [2]: f = c**2*exp(c/x)/(x**3*(1+exp(c/x))**2)

In [3]: f
Out[3]:
       c
       ─
    2  x
   c ⋅ℯ
────────────
           2
   ⎛     c⎞
   ⎜     ─⎟
 3 ⎜     x⎟
x ⋅⎝1 + ℯ ⎠

In [4]: integrate(f, x)
Out[4]:
   ⎛     ⎛     c⎞       c    ⎛     c⎞           c     ⎞
   ⎜     ⎜     ─⎟       ─    ⎜     ─⎟           ─     ⎟
   ⎜     ⎜     x⎟       x    ⎜     x⎟           x     ⎟
 2 ⎜x⋅log⎝1 + ℯ ⎠    x⋅ℯ ⋅log⎝1 + ℯ ⎠        c⋅ℯ      ⎟
c ⋅⎜────────────── + ──────────────── - ──────────────⎟
   ⎜             c                 c                 c⎟
   ⎜             ─                 ─                 ─⎟
   ⎜   2      2  x       2      2  x       2      2  x⎟
   ⎝x⋅c  + x⋅c ⋅ℯ     x⋅c  + x⋅c ⋅ℯ     x⋅c  + x⋅c ⋅ℯ ⎠

In [5]: risch_integrate(f, x)
Out[5]:
               ⎛         c⎞
               ⎜         ─⎟
               ⎜ 2    2  x⎟      c       c
-2⋅log(x) + log⎝x  + x ⋅ℯ ⎠ + ──────── - ─
                                     c   x
                                     ─
                                     x
                              x + x⋅ℯ

In [6]: %timeit integrate(f, x)
1 loops, best of 3: 36.4 s per loop

In [7]: %timeit risch_integrate(f, x)
1 loops, best of 3: 313 ms per loop


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