Comment #7 on issue 636 by mattpap: integrate(1/(x**2+1)) should return  
arctan(x)
http://code.google.com/p/sympy/issues/detail?id=636

I've made some progress on this issue:

In [1]: from sympy.integrals.rationaltools import *

In [2]: integrate(1/(x**2+1), x)
Out[2]:
ⅈ⋅log(x + ⅈ)   ⅈ⋅log(x - ⅈ)
──────────── - ────────────
      2              2

In [3]: ratint(1/(x**2+1), x)
Out[3]: atan(x)

In [4]: A = x**4 - 3*x**2 + 6

In [5]: D = x**6 - 5*x**4 + 5*x**2 + 4

In [6]: time r = ratint(A/D, x)
CPU times: user 0.54 s, sys: 0.01 s, total: 0.55 s
Wall time: 0.57 s

In [8]: r
Out[8]:
                          ⎛       3    5⎞
               ⎛ 3⎞       ⎜x   3⋅x    x ⎟
atan(x) + atan⎝x ⎠ + atan⎜─ - ──── + ──⎟
                          ⎝2    2     2 ⎠

In [9]: time R = integrate(A/D, x)
CPU times: user 2.08 s, sys: 0.02 s, total: 2.09 s
Wall time: 2.16 s

In [11]: R
(here starts universe filling expression :)

In [12]: P = x**7-24*x**4-4*x**2+8*x-8

In [13]: Q = x**8+6*x**6+12*x**4+8*x**2

In [14]: integrate(P/Q, x)
Out[14]:
               ⎽⎽⎽               ⎽⎽⎽
         3⋅ⅈ⋅╲╱ 2          3⋅ⅈ⋅╲╱ 2
   1/2 - ─────────   1/2 + ─────────                          
⎽⎽⎽                ⎽⎽⎽
             4                 4                1      3⋅ⅈ⋅╲╱ 2            
3⋅ⅈ⋅╲╱ 2
- ─────────────── - ─────────────── + log(x) + ─ - ──────────────── +  
────────────────
             ⎽⎽⎽               ⎽⎽⎽              x                   
2                  2
     x + ⅈ⋅╲╱ 2        x - ⅈ⋅╲╱ 2                     ⎛        ⎽⎽⎽⎞       
⎛        ⎽⎽⎽⎞
                                                    4⋅⎝x - ⅈ⋅╲╱ 2 ⎠    4⋅⎝x  
+ ⅈ⋅╲╱ 2 ⎠

In [15]: ratint(P/Q, x)
Out[15]:
              2      3
4 + 6⋅x + 8⋅x  + 3⋅x
───────────────────── + log(x)
             3    5
    4⋅x + 4⋅x  + x

However I still can't make 1/(x**5+1) to integrate (to something readable).

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

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