Heard on Wikipedia

4 views
Skip to first unread message

Fredrik Johansson

unread,
Oct 3, 2008, 4:50:53 AM10/3/08
to sy...@googlegroups.com
From http://en.wikipedia.org/wiki/Risch_algorithm, "The following is a
more complex example, which no software (as of March 2008) is known to
find an antiderivative for: [..."] But yesterday an anonymous user
pointed out on the talk page that SymPy is actually able to calculate
the integral. The user posted the interactive example here:
http://dpaste.com/81951/

I tried the integral in Mathematica, which indeed is unable to do it.

Fredrik

Ondrej Certik

unread,
Oct 3, 2008, 5:09:51 AM10/3/08
to sy...@googlegroups.com

Indeed:

In [4]: d = (1+2*x+sqrt(x+log(x))*(1+3*x) +
x**2)/(x*(x+sqrt(x+log(x)))*sqrt(x+log(x)))

In [5]: d
Out[5]:
⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽ 2
1 + 2⋅x + ╲╱ x + log(x) ⋅(1 + 3⋅x) + x
───────────────────────────────────────
⎛ ⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎞ ⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽
x⋅⎝x + ╲╱ x + log(x) ⎠⋅╲╱ x + log(x)

In [6]: integrate(d, x)
Out[6]:
⎛ ⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎞ ⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽
2⋅log⎝x + ╲╱ x + log(x) ⎠ + 2⋅╲╱ x + log(x)


Wow. Big credit goes to Mateusz for this.

Ondrej

Fredrik Johansson

unread,
Oct 3, 2008, 5:18:52 AM10/3/08
to sy...@googlegroups.com
On Fri, Oct 3, 2008 at 11:09 AM, Ondrej Certik <ond...@certik.cz> wrote:
> Wow. Big credit goes to Mateusz for this.
>
> Ondrej

Indeed. And let's add a test for this.

On the other hand, SymPy is unable to do the integral
x/sqrt(x^4+10x^2-96x-71), also mentioned on the Wikipedia page.
Apparently Axiom (but no other systems) can do it.

Fredrik

Ondrej Certik

unread,
Oct 3, 2008, 5:31:01 AM10/3/08
to sy...@googlegroups.com
On Fri, Oct 3, 2008 at 11:18 AM, Fredrik Johansson
<fredrik....@gmail.com> wrote:
>
> On Fri, Oct 3, 2008 at 11:09 AM, Ondrej Certik <ond...@certik.cz> wrote:
>> Wow. Big credit goes to Mateusz for this.
>>
>> Ondrej
>
> Indeed. And let's add a test for this.

http://code.google.com/p/sympy/issues/detail?id=1132

>
> On the other hand, SymPy is unable to do the integral
> x/sqrt(x^4+10x^2-96x-71), also mentioned on the Wikipedia page.
> Apparently Axiom (but no other systems) can do it.


Ondrej

Mateusz Paprocki

unread,
Oct 3, 2008, 5:37:59 AM10/3/08
to sy...@googlegroups.com
Hi,

> From http://en.wikipedia.org/wiki/Risch_algorithm, "The following is a
> more complex example, which no software (as of March 2008) is known to
> find an antiderivative for: [..."] But yesterday an anonymous user
> pointed out on the talk page that SymPy is actually able to calculate
> the integral. The user posted the interactive example here:
> http://dpaste.com/81951/

Indeed, interesting example. So we have another place were SymPy is
better than others :)

> On the other hand, SymPy is unable to do the integral
> x/sqrt(x^4+10x^2-96x-71), also mentioned on the Wikipedia page.
> Apparently Axiom (but no other systems) can do it.

Unfortunately heurisch() works poorly with integrals of this kind.
There are specialized algorithms to solve this problem.

It seems that our implementation of heuristic Risch algorithm can
handle really complicated integrals but also fails miserably on
trivial problems, e.g.:

In [16]: integrate(log(x)/x, x)
Out[16]:

⎮ log(x)
⎮ ────── dx
⎮ x

Mateusz

2008/10/3 Fredrik Johansson <fredrik....@gmail.com>:

Alex_Gaynor

unread,
Oct 3, 2008, 12:59:56 PM10/3/08
to sympy
I was the wiki user who pointed that out, it's a real credit to the
sympy devs to pass that challenge!

On Oct 3, 5:37 am, "Mateusz Paprocki" <matt...@gmail.com> wrote:
> Hi,
>
> > Fromhttp://en.wikipedia.org/wiki/Risch_algorithm, "The following is a
> > more complex example, which no software (as of March 2008) is known to
> > find an antiderivative for: [..."] But yesterday an anonymous user
> > pointed out on the talk page that SymPy is actually able to calculate
> > the integral. The user posted the interactive example here:
> >http://dpaste.com/81951/
>
> Indeed, interesting example. So we have another place were SymPy is
> better than others :)
>
> > On the other hand, SymPy is unable to do the integral
> > x/sqrt(x^4+10x^2-96x-71), also mentioned on the Wikipedia page.
> > Apparently Axiom (but no other systems) can do it.
>
> Unfortunately heurisch() works poorly with integrals of this kind.
> There are specialized algorithms to solve this problem.
>
> It seems that our implementation of heuristic Risch algorithm can
> handle really complicated integrals but also fails miserably on
> trivial problems, e.g.:
>
> In [16]: integrate(log(x)/x, x)
> Out[16]:
> ⌠
> ⎮ log(x)
> ⎮ ────── dx
> ⎮   x
> ⌡
>
> Mateusz
>
> 2008/10/3 Fredrik Johansson <fredrik.johans...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages