Comment #5 on issue 1304 by akshaysrinivasan: Integrate sqrt(x**2 + y**2)  
fails
http://code.google.com/p/sympy/issues/detail?id=1304

I tried this:
diff --git a/sympy/integrals/risch.py b/sympy/integrals/risch.py
index 81e2b7a..124ac38 100644
--- a/sympy/integrals/risch.py
+++ b/sympy/integrals/risch.py
@@ -186,12 +186,12 @@ def heurisch(f, x, **kwargs):
                 elif g.is_Pow:
                     if g.exp.is_Rational and g.exp.q == 2:
                         M = g.base.match(a*x**2 + b)
                         if M is not None and
M[b].is_positive:(M[b].as_coeff_terms()[0] > 0) :
                             if M[a].is_positive:
                                 terms.add(asinh(sqrt(M[a]/M[b])*x))
                             elif M[a].is_negative:
                                 terms.add(asin(sqrt(-M[a]/M[b])*x))
--------------

I tried adding this to the test_risch , and stumbled upon what I believe is  
another
issue.

In the python intepreter, doing
>>> integrate(sqrt(x**2+y**2),x)
y**2*asinh(x*(y**(-2))**(1/2))/2 + x*(x**2 + y**2)**(1/2)/2

>>> (y**2*asinh(x*(y**(-2))**(1/2))/2 + x*(x**2 + y**2)**(1/2)/2).args
(y**2*asinh(x)/2, x/2)

>>> heurisch(sqrt(x**2+y**2),x,hints=[]) == \
... y**2*asinh(x*(y**(-2))**(1/2))/2 + x*(x**2 + y**2)**(1/2)/2
False

This works fine on isympy though. Isn't this a bug?


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