I forgot to mention another alternative, which is that if you can
solve this integral "by hand", i.e., using the methods you learned in
calculus, then you can implement that algorithm in the manualintegrate
routine. The advantage of this is that you can then hook it into the
step-by-step answer in SymPy Gamma.

I'm not actually sure how to do this one by hand, but maybe after some
substitution it would become more apparent.

Aaron Meurer

On Wed, Sep 11, 2013 at 11:57 AM, Aaron Meurer <asmeu...@gmail.com> wrote:
> At https://github.com/sympy/sympy/pull/2128 the algorithms are
> implemented to simplify this, namely
>
> In [1]: a = integrate(sqrt(1 + x**3)/x)
>
> In [2]: minpoly(a.diff(x) - sqrt(1 + x**3)/x)
> Out[2]: x
>
> This means that the input satisfies the polynomial x=0, i.e., it is
> identically 0.
>
> This hasn't been integrated with simplify() yet.
>
> Aaron Meurer
>
>
> On Wed, Sep 11, 2013 at 11:34 AM, Ondřej Čertík <ondrej.cer...@gmail.com> 
> wrote:
>> On Wed, Sep 11, 2013 at 11:23 AM, Aaron Meurer <asmeu...@gmail.com> wrote:
>>> On Wed, Sep 11, 2013 at 10:37 AM, Ondřej Čertík <ondrej.cer...@gmail.com> 
>>> wrote:
>>>> Hi Peter!
>>>>
>>>> On Wed, Sep 11, 2013 at 7:19 AM, Peter Luschny <peter.lusc...@gmail.com> 
>>>> wrote:
>>>>> Consider
>>>>>
>>>>> (F1) sqrt(1+x^3)/x
>>>>> (F2) sqrt(1+1/x^3)*sqrt(x)
>>>>>
>>>>> According to Mathematica's online integrator
>>>>>
>>>>> (I1) integral F1 dx = (2/3)*(sqrt(x^3+1)-arctanh(sqrt(x^3+1)))
>>>>> (I2) integral F2 dx =
>>>>> (2*sqrt(1/x^3+1)*x^(3/2)*(sqrt(x^3+1)-arctanh(sqrt(x^3+1))))/(3*sqrt(x^3+1))
>>>>>
>>>>> SymPy Live computes (I1) as
>>>>> (S) 2*x**(3/2)/(3*sqrt(1 + x**(-3))) - 2*asinh(x**(-3/2))/3 +
>>>>> 2/(3*x**(3/2)*sqrt(1 + x**(-3)))
>>>>>
>>>>> SymPy Live timed out with (I2). SymPy 0.7.3 computes (I2) as
>>>>> (S) 2*x**(3/2)/(3*sqrt(1 + x**(-3))) - 2*asinh(x**(-3/2))/3 +
>>>>> 2/(3*x**(3/2)*sqrt(1 + x**(-3)))
>>>>>
>>>>> The derivative of (S) is (F2) and not (F1). So I am inclined to
>>>>> say that SymPy computes (I1) not correctly.
>>>>
>>>>
>>>> Thanks for reporting this. Here is what I tried:
>>>>
>>>> In [1]: x = Symbol("x", real=True)
>>>>
>>>> In [2]: f = integrate(sqrt(1+x**3)/x, x)
>>>>
>>>> In [3]: e = f.diff(x).simplify().expand().factor().cancel()
>>>>
>>>> In [4]: print e
>>>> (x**3 + 1)/(x**(5/2)*sqrt(1 + x**(-3)))
>>>>
>>>> It's kind of a pain to simplify "f", but at the end, the expression [4] is 
>>>> equal
>>>> to sqrt(1+x^3)/x, as you can check by hand, at least for x > 0.
>>>>
>>>> How did you make it equal to (F2)?
>>>
>>> F1 and F2 are equal for x > 0.
>>
>> Ah right! I see, so the problem is with proper handling of sqrt() for
>> general (complex)
>> symbols inside integrate.
>>
>> As far as I know, sympy should otherwise by handling sqrt() properly.
>>
>> Ondrej
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "sympy" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sympy+unsubscr...@googlegroups.com.
>> To post to this group, send email to sympy@googlegroups.com.
>> Visit this group at http://groups.google.com/group/sympy.
>> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to