Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Rubi 4 is now available

184 views
Skip to first unread message

clicl...@freenet.de

unread,
May 17, 2013, 8:40:14 PM5/17/13
to

[Some years ago, the sci.math.symbolic newsgroup at Drexel's Math Forum
site stopped disseminating to the usenet group. In the meantime they
have extended their group name to sci.math.symbolic.independent and have
begun warning users about the separation, so their's nothing to complain
about. Yet, all posts to the usenet group sci.math.symbolic continue to
appear on their site, which is nice because they are archived. As most
of the current activity is taking place on the usenet group, however,
Math Forum users can apparently still be misled, as in the case of this
May 14, 9:20 PM post from Hawaii.

<http://mathforum.org/kb/thread.jspa?threadID=2572254>

Martin.]

> At long last the 4th version of Rubi (Rule-based integrator) has been
> posted at
>
> http://www.apmaths.uwo.ca/~arich/
>
> The entire system of rules Rubi 4 uses to symbolically integrate a
> wide variety of expressions is freely available for viewing and/or
> downloading. The rules in the files are hierarchically arranged in the
> form of a decision tree. By answering true-or-false questions in the
> tree, it is easy for a human or computer to determine exactly which of
> the more than 5000 rules is the right one to apply to a given
> integrand. Also available for those having access to Mathematica 7 or
> better are the source files necessary to actually try Rubi on
> integrands of your choice. Optionally, you can show the intermediate
> steps and the rules Rubi uses to compute antiderivatives.
>
> As evidence of the merits of using a rule-based approach to automate
> symbolic integration, the website has a table summarizing the result
> of running Rubi 4 and the two major commercial computer algebra
> systems on a grueling test suite of over 43,000 integration problems.
> Both the test-suite problems and raw test results are available for
> viewing or downloading from the website. There has been much
> discussion recently on sci.math.symbolic about establishing an
> "Independent Integration Test Suite". Perhaps some of the problems in
> this test suite warrant inclusion...
>
> Aloha from Hawaii,
> Albert D. Rich

Nasser M. Abbasi

unread,
May 17, 2013, 11:24:56 PM5/17/13
to
On 5/17/2013 7:40 PM, clicl...@freenet.de wrote:

>
>> At long last the 4th version of Rubi (Rule-based integrator) has been
>> posted at
>>
>> http://www.apmaths.uwo.ca/~arich/
>>

Thanks for the link.

fyi;

The zip file in the above url :

http://www.apmaths.uwo.ca/~arich/Rubi4.zip

looks like it contains all the rules as Mathematica packages. This way one
does not have to download each rule's as separate notebook from

http://www.apmaths.uwo.ca/~arich/IntegrationRules/MathematicaNotebookFiles/MathematicaNotebookFiles.html

>>
>> Aloha from Hawaii,
>> Albert D. Rich

--Nasser

Waldek Hebisch

unread,
May 19, 2013, 7:10:35 PM5/19/13
to
clicl...@freenet.de wrote:
>
> > At long last the 4th version of Rubi (Rule-based integrator) has been
> > posted at
> >
> > http://www.apmaths.uwo.ca/~arich/
> >
> > The entire system of rules Rubi 4 uses to symbolically integrate a
> > wide variety of expressions is freely available for viewing and/or
> > downloading.
<snip>
> > Aloha from Hawaii,
> > Albert D. Rich

A little trivia which may be of some interest: wc on Rubi files
gives 36417 lines (1495769 bytes). For comparison wc on FriCAS
integrator gives 10075 lines (400679 bytes). So, Rubi is 3.5 times
larger than FriCAS integrator...

--
Waldek Hebisch
heb...@math.uni.wroc.pl

clicl...@freenet.de

unread,
May 20, 2013, 2:28:52 AM5/20/13
to

Waldek Hebisch schrieb:
... but probably faster on average. And it would be still faster if the
linear list of conditional rules were recoded into an IF-THEN-ELSE
decision tree (actually an old idea of Albert Rich).

Perhaps the integrals from the Timofeev suite are to simple for Rubi?
Hah! Some of the following 10 specimens from K. Charlwood (2008),
Integration on Computer Algebra Systems, have brought Maple and
Mathematica to their knees, and may bring Rubi and FriCAS to their knees
also; they require integration by parts and/or judicious substitution:

<http://www.freepatentsonline.com/article/Electronic-Journal-Mathematics-Technology/188213666.html>

INT(ASIN(x)*LN(x), x)

INT(x*ASIN(x)/SQRT(1 - x^2), x)

INT(ASIN(SQRT(x + 1) - SQRT(x)), x)

INT(LN(1 + x*SQRT(1 + x^2)), x)

INT(COS(x)^2/SQRT(COS(x)^4 + COS(x)^2 + 1), x)

INT(TAN(x)*SQRT(1 + TAN(x)^4), x)

INT(TAN(x)/SQRT(SEC(x)^3 + 1), x)

INT(SQRT(TAN(x)^2 + 2*TAN(x) + 2), x)

INT(SIN(x)*ATAN(SQRT(SEC(x) - 1)), x)

INT(x^3*EXP(ASIN(x))/SQRT(1 - x^2), x)

Can you or your favorite Computer-Algebra System find real, continuous
antiderivatives valid on the entire complex plane and not involving the
imaginary unit?

Martin.

did

unread,
May 20, 2013, 3:55:00 AM5/20/13
to
What Rubi 4 on MMA 9 gives:

> INT(ASIN(x)*LN(x), x)
unable

> INT(x*ASIN(x)/SQRT(1 - x^2), x)
x - Sqrt[1 - x^2] ArcSin[x]

> INT(ASIN(SQRT(x + 1) - SQRT(x)), x)
unable

> INT(LN(1 + x*SQRT(1 + x^2)), x)
-2 x - Sqrt[1/10 (1 + Sqrt[5])] ArcTan[Sqrt[2/(1 + Sqrt[5])] x] +
2 Sqrt[1/5 (2 + Sqrt[5])] ArcTan[Sqrt[2/(1 + Sqrt[5])] x] +
Sqrt[2/(5 (-1 + Sqrt[5]))]
ArcTan[Sqrt[2/(-1 + Sqrt[5])] Sqrt[1 + x^2]] +
Sqrt[2/5 (-1 + Sqrt[5])]
ArcTan[Sqrt[2/(-1 + Sqrt[5])] Sqrt[1 + x^2]] +
2 Sqrt[1/5 (-2 + Sqrt[5])] ArcTanh[Sqrt[2/(-1 + Sqrt[5])] x] +
Sqrt[1/10 (-1 + Sqrt[5])] ArcTanh[Sqrt[2/(-1 + Sqrt[5])] x] +
Sqrt[2/(5 (1 + Sqrt[5]))]
ArcTanh[Sqrt[2/(1 + Sqrt[5])] Sqrt[1 + x^2]] -
Sqrt[2/5 (1 + Sqrt[5])]
ArcTanh[Sqrt[2/(1 + Sqrt[5])] Sqrt[1 + x^2]] +
x Log[1 + x Sqrt[1 + x^2]]

> INT(COS(x)^2/SQRT(COS(x)^4 + COS(x)^2 + 1), x)
(EllipticPi[1/2 (3 - I Sqrt[3]),
ArcSin[Sqrt[-((2 I)/(3 I + Sqrt[3]))] Tan[x]], (3 I + Sqrt[3])/(
3 I - Sqrt[3])] (3 + 3 Tan[x]^2 + Tan[x]^4))/(3 Sqrt[-((2 I)/(
3 I + Sqrt[3]))] (1 + Tan[x]^2) Sqrt[
1 + (2 Tan[x]^2)/(3 - I Sqrt[3])] Sqrt[
1 + (2 Tan[x]^2)/(3 + I Sqrt[3])] Sqrt[(
3 + 3 Tan[x]^2 + Tan[x]^4)/(1 + Tan[x]^2)^2])

> INT(TAN(x)*SQRT(1 + TAN(x)^4), x)
-(1/2) ArcSinh[Tan[x]^2] -
ArcTanh[(1 - Tan[x]^2)/(Sqrt[2] Sqrt[1 + Tan[x]^4])]/Sqrt[2] +
1/2 Sqrt[1 + Tan[x]^4]

> INT(TAN(x)/SQRT(SEC(x)^3 + 1), x)
-(2/3) ArcTanh[Sqrt[1 + Sec[x]^3]]

> INT(SQRT(TAN(x)^2 + 2*TAN(x) + 2), x)
ArcSinh[1 + Tan[x]] -
1/2 I Sqrt[1 - 2 I]
ArcTanh[((4 - 2 I) + (2 - 2 I) Tan[x])/(
2 Sqrt[1 - 2 I] Sqrt[2 + 2 Tan[x] + Tan[x]^2])] +
1/2 I Sqrt[1 + 2 I]
ArcTanh[((4 + 2 I) + (2 + 2 I) Tan[x])/(
2 Sqrt[1 + 2 I] Sqrt[2 + 2 Tan[x] + Tan[x]^2])]

> INT(SIN(x)*ATAN(SQRT(SEC(x) - 1)), x)
1/2 ArcTan[Sqrt[-1 + Sec[x]]] - ArcTan[Sqrt[-1 + Sec[x]]] Cos[x] +
1/2 Cos[x] Sqrt[-1 + Sec[x]]

> INT(x^3*EXP(ASIN(x))/SQRT(1 - x^2), x)
3/10 E^ArcSin[x] x + 1/10 E^ArcSin[x] x^3 -
3/10 E^ArcSin[x] Sqrt[1 - x^2] - 3/10 E^ArcSin[x] x^2 Sqrt[1 - x^2]

Every results were obtained instantaneously.

Did

did

unread,
May 20, 2013, 4:11:12 AM5/20/13
to
Where Rubi fails, MMA gives

FullSimplify[Integrate[ArcSin[x]*Log[x], x]]

-2 Sqrt[1 - x^2] +
x ArcSin[x] (-1 + Log[x]) + (-1 + Sqrt[1 - x^2]) Log[x] +
Log[1 + Sqrt[1 - x^2]]


FullSimplify[Integrate[ArcSin[Sqrt[x + 1] - Sqrt[x]], x]]

((Sqrt[x] + 3 Sqrt[1 + x]) Sqrt[-x + Sqrt[x] Sqrt[1 + x]])/(
4 Sqrt[2]) - x ArcSin[Sqrt[x] - Sqrt[1 + x]] -
3/8 (Sqrt[x] + Sqrt[1 + x]) Sqrt[-1 - 2 x + 2 Sqrt[x] Sqrt[1 + x]]
Log[2 Sqrt[-x + Sqrt[x] Sqrt[1 + x]] +
Sqrt[-2 - 4 x + 4 Sqrt[x] Sqrt[1 + x]]]





Waldek Hebisch

unread,
May 20, 2013, 11:08:07 AM5/20/13
to
clicl...@freenet.de wrote:
>
> Waldek Hebisch schrieb:
> >
> >
> > A little trivia which may be of some interest: wc on Rubi files
> > gives 36417 lines (1495769 bytes). For comparison wc on FriCAS
> > integrator gives 10075 lines (400679 bytes). So, Rubi is 3.5 times
> > larger than FriCAS integrator...
> >
>
> ... but probably faster on average. And it would be still faster if the
> linear list of conditional rules were recoded into an IF-THEN-ELSE
> decision tree (actually an old idea of Albert Rich).

Averages tell only part of the story. My measurements indicate
that FriCAS could do significant part of Rubi 1 testsuite
using 4ms or less per integral. Most integrals was done below 10ms.
The average was completely dominated by a small number of long
running integrals.

>
> Perhaps the integrals from the Timofeev suite are to simple for Rubi?
> Hah! Some of the following 10 specimens from K. Charlwood (2008),
> Integration on Computer Algebra Systems, have brought Maple and
> Mathematica to their knees, and may bring Rubi and FriCAS to their knees
> also; they require integration by parts and/or judicious substitution:
>
> <http://www.freepatentsonline.com/article/Electronic-Journal-Mathematics-Technology/188213666.html>

It seems that three of them hit bugs:

integrate(cos(x)^2/sqrt(cos(x)^4 + cos(x)^2 + 1), x)
integrate(tan(x)*sqrt(sec(x)^3 + 1), x)
integrate(sqrt(tan(x)^2 + 2*tan(x) + 2), x)

One hits unimplemented part of Risch algorithm:

integrate(sin(x)*atan(sqrt(sec(x) - 1)), x)

AFAICS the other works, the asin(sqrt(x+1) - sqrt(x)) case
is slow (19 s on fast machine):


integrate(asin(x)*log(x), x)


(1)
+--------+ +--------+
| 2 | 2
log(2\|- x + 1 + 2) - log(- 2\|- x + 1 + 2)
+
+--------+
| 2 +--------+
x\|- x + 1 | 2
(- 2x log(x) + 2x)atan(------------) + (2log(x) - 4)\|- x + 1
2
x - 1
/
2
Type: Union(Expression(Integer),...)
integrate(x*asin(x)/sqrt(1 - x^2), x)


+--------+
+--------+ | 2
| 2 x\|- x + 1
(2) \|- x + 1 atan(------------) + x
2
x - 1
Type: Union(Expression(Integer),...)
integrate(asin(sqrt(x+1) - sqrt(x)), x)


(3)
+------------------+
+-----+ +-+ | +-+ +-----+ +-----+ +-+
(3\|x + 1 + \|x )\|2\|x \|x + 1 - 2x + (8x + 3)asin(\|x + 1 - \|x )
-----------------------------------------------------------------------
8
Type: Union(Expression(Integer),...)
integrate(log(1 + x*sqrt(1 - x^2)), x)


(4)
-
4
*
atan
2 +-+ +-+ 2 +-+
x \|2 \|3 - 2x \|2
/
+--------------------------------------------------+
| +--------+
| 2 | 2 4 +-+ 4 2
2 |(8x - 16)\|- x + 1 - 8x \|3 + 16x - 16x + 16
x |--------------------------------------------------
| 4
\| x
+
+--------+
+-+ | 2 2 +-+
- 2\|2 \|- x + 1 + (- x + 2)\|2
+
4
*
atan
2 +-+ +-+ 2 +-+
x \|2 \|3 + 2x \|2
/
+--------------------------------------------------+
| +--------+
| 2 | 2 4 +-+ 4 2
2 |(8x - 16)\|- x + 1 + 8x \|3 + 16x - 16x + 16
x |--------------------------------------------------
| 4
\| x
+
+--------+
+-+ | 2 2 +-+
- 2\|2 \|- x + 1 + (- x + 2)\|2
+
+--------+
| 2
4x log(x\|- x + 1 + 1)
+
+--------+
2 | 2 4 +-+ 4 2
+-+ (8x - 16)\|- x + 1 + 8x \|3 + 16x - 16x + 16
- \|3 log(--------------------------------------------------)
4
x
+
+--------+
2 | 2 4 +-+ 4 2
+-+ (8x - 16)\|- x + 1 - 8x \|3 + 16x - 16x + 16
\|3 log(--------------------------------------------------)
4
x
+
+-+
\|2
- 4atan(------------------------------------------)
+------------------+
| +-+ 2 +-+ +-+ +-+
2\|- 2x\|3 + 2x + 2 - \|2 \|3 + 2x\|2
+
+-+
\|2
- 4atan(----------------------------------------)
+----------------+
| +-+ 2 +-+ +-+ +-+
2\|2x\|3 + 2x + 2 + \|2 \|3 + 2x\|2
+
+-+ +-+ 2 +-+ +-+ 2
\|3 log(2x\|3 + 2x + 2) - \|3 log(- 2x\|3 + 2x + 2) - 8x
/
4
Type: Union(Expression(Integer),...)

integrate(tan(x)*sqrt(1 + tan(x)^4), x)


(5)
+-----------+
| 4 2
2log(\|tan(x) + 1 - tan(x) )
+
+-----------+
+-+ 2 +-+ | 4 4 2
+-+ (2\|2 tan(x) - 2\|2 )\|tan(x) + 1 + 3tan(x) - 2tan(x) + 3
\|2 log(--------------------------------------------------------------)
4 2
tan(x) + 2tan(x) + 1
+
+-----------+
| 4
2\|tan(x) + 1
/
4
Type: Union(Expression(Integer),...)

integrate(x^3*exp(asin(x))/sqrt(1-x^2), x)


+--------+
| 2
x\|- x + 1
- atan(------------)
+--------+ 2
2 | 2 3 x - 1
((- 3x - 3)\|- x + 1 + x + 3x)%e
(6) --------------------------------------------------------
10
Type: Union(Expression(Integer),...)


--
Waldek Hebisch
heb...@math.uni.wroc.pl

clicl...@freenet.de

unread,
May 20, 2013, 12:09:48 PM5/20/13
to

Waldek Hebisch schrieb:
>
> clicl...@freenet.de wrote:
> >
> > Perhaps the integrals from the Timofeev suite are to simple for Rubi?
> > Hah! Some of the following 10 specimens from K. Charlwood (2008),
> > Integration on Computer Algebra Systems, have brought Maple and
> > Mathematica to their knees, and may bring Rubi and FriCAS to their knees
> > also; they require integration by parts and/or judicious substitution:
> >
> > <http://www.freepatentsonline.com/article/Electronic-Journal-Mathematics-Technology/188213666.html>
>
> It seems that three of them hit bugs:
>
> integrate(cos(x)^2/sqrt(cos(x)^4 + cos(x)^2 + 1), x)
> integrate(tan(x)*sqrt(sec(x)^3 + 1), x)
> integrate(sqrt(tan(x)^2 + 2*tan(x) + 2), x)
>
> One hits unimplemented part of Risch algorithm:
>
> integrate(sin(x)*atan(sqrt(sec(x) - 1)), x)
>
> AFAICS the other works, the asin(sqrt(x+1) - sqrt(x)) case
> is slow (19 s on fast machine):
>
> [...]

Some comments on the Rubi 4, Mathematica 9, and FriCAS 1.2.0 results for
the ten Charlwood integrals:

Rubi's failure on problem #1 is serious: Derive 6.10 (and many other
systems) can do it. The Mathematica antiderivative for problem #3 is not
real for x>0. In Rubi's result for problem #4 the terms are
insufficiently simplified (numerical prefactors should be fused). Rubi
misses the fact that the antiderivative #5 is elementary, not elliptic.
Rubi's results for problems #6 and #7 are excellent. Rubi's
antiderivative for problem #8 is complex without need and inacceptably
discontinuous.

On ten difficult but otherwise random problems, the three failures of
FriCAS from "bugs" (?) plus one from an incomplete implementation are
very serious indeed. The 19 second antiderivative of FriCAS for problem
#3 is superb. The high-order polynomials in the FriCAS antiderivative #4
look quite awful, however.

Derive 6.10 succeeds on problems #1, #2, #4, #7 and #9; it fails on #3,
#5, #8 and #10; on problem #6 it succeeds only if the integration
variable is declared real. I will post my choice of "optimal" (compact,
real, continuous, ...) antiderivatives later.

Martin.

Axel Vogt

unread,
May 20, 2013, 1:49:33 PM5/20/13
to
On 20.05.2013 08:28, clicl...@freenet.de wrote:
...
> Hah! Some of the following 10 specimens from K. Charlwood (2008),
> Integration on Computer Algebra Systems, have brought Maple and
> Mathematica to their knees, and may bring Rubi and FriCAS to their knees
> also; they require integration by parts and/or judicious substitution:
>
> <http://www.freepatentsonline.com/article/Electronic-Journal-Mathematics-Technology/188213666.html>
>
> INT(ASIN(x)*LN(x), x)
> INT(x*ASIN(x)/SQRT(1 - x^2), x)
> INT(ASIN(SQRT(x + 1) - SQRT(x)), x)
> INT(LN(1 + x*SQRT(1 + x^2)), x)
> INT(COS(x)^2/SQRT(COS(x)^4 + COS(x)^2 + 1), x)
> INT(TAN(x)*SQRT(1 + TAN(x)^4), x)
> INT(TAN(x)/SQRT(SEC(x)^3 + 1), x)
> INT(SQRT(TAN(x)^2 + 2*TAN(x) + 2), x)
> INT(SIN(x)*ATAN(SQRT(SEC(x) - 1)), x)
> INT(x^3*EXP(ASIN(x))/SQRT(1 - x^2), x)
>
> Can you or your favorite Computer-Algebra System find real, continuous
> antiderivatives valid on the entire complex plane and not involving the
> imaginary unit?
>
> Martin.
>

His tests where done against Maple 11, using Version 17 there where
answers for #1 - #8, some quite lengthy. Non-tricky simplification
gives 194,44,920,1215,864,301,97,1334 length in characters.

I have not checked validity over C or for only real, continous.

#9 = Int(sin(x)*arctan((sec(x)-1)^(1/2)),x) is answered, after
re-writing sec as sin (I hate that notation anyway).

#10 = Int(x^3*exp(arcsin(x))/(-x^2+1)^(1/2),x) needs a substitution,
arcsin(x) = t (it is a bit sloppy to write down the integral in the
given way, not all x are allowed), then it is answered as well.

Waldek Hebisch

unread,
May 20, 2013, 5:27:36 PM5/20/13
to
clicl...@freenet.de wrote:
>
> Waldek Hebisch schrieb:
> >
> > It seems that three of them hit bugs:
> >
> > integrate(cos(x)^2/sqrt(cos(x)^4 + cos(x)^2 + 1), x)
> > integrate(tan(x)*sqrt(sec(x)^3 + 1), x)
> > integrate(sqrt(tan(x)^2 + 2*tan(x) + 2), x)
> >
> > One hits unimplemented part of Risch algorithm:
> >
> > integrate(sin(x)*atan(sqrt(sec(x) - 1)), x)
> >

> On ten difficult but otherwise random problems, the three failures of
> FriCAS from "bugs" (?) plus one from an incomplete implementation are
> very serious indeed.

I consider the 'sqrt(tan(x)^2 + 2*tan(x) + 2); serious: I get
unevaluated result which means that integrator thinks that
the integral is nonelementary, which is wrong. The
'cos(x)^2/sqrt(cos(x)^4 + cos(x)^2 + 1)' signals error
during computation.

In 'tan(x)*sqrt(sec(x)^3 + 1)' integrator pulled out a quadratic
factor outside of the squre root. I used complex setting
for simplifier and it was not simplifing difference of
integrand and derivatieve of the integral to 0.


(24) -> integrate(tan(x)*sqrt(sec(x)^3 + 1), x)

(24)
+----------------------+
| 2
3 2 |4cos(x) - 4cos(x) + 4 3
cos(x)log((- cos(x) - cos(x) ) |---------------------- - 2cos(x) - 1)
| 2
\| cos(x) + cos(x)
+
+----------------------+
| 2
|4cos(x) - 4cos(x) + 4
(- cos(x) - 1) |----------------------
| 2
\| cos(x) + cos(x)
/
3cos(x)

clicl...@freenet.de

unread,
May 21, 2013, 10:10:20 AM5/21/13
to

Axel Vogt schrieb:
>
> On 20.05.2013 08:28, clicl...@freenet.de wrote:
> > <http://www.freepatentsonline.com/article/Electronic-Journal-Mathematics-Technology/188213666.html>
> >
> > INT(ASIN(x)*LN(x), x)
> > INT(x*ASIN(x)/SQRT(1 - x^2), x)
> > INT(ASIN(SQRT(x + 1) - SQRT(x)), x)
> > INT(LN(1 + x*SQRT(1 + x^2)), x)
> > INT(COS(x)^2/SQRT(COS(x)^4 + COS(x)^2 + 1), x)
> > INT(TAN(x)*SQRT(1 + TAN(x)^4), x)
> > INT(TAN(x)/SQRT(SEC(x)^3 + 1), x)
> > INT(SQRT(TAN(x)^2 + 2*TAN(x) + 2), x)
> > INT(SIN(x)*ATAN(SQRT(SEC(x) - 1)), x)
> > INT(x^3*EXP(ASIN(x))/SQRT(1 - x^2), x)
> >
>
> His tests where done against Maple 11, using Version 17 there where
> answers for #1 - #8, some quite lengthy. Non-tricky simplification
> gives 194,44,920,1215,864,301,97,1334 length in characters.
>
> I have not checked validity over C or for only real, continous.
>
> #9 = Int(sin(x)*arctan((sec(x)-1)^(1/2)),x) is answered, after
> re-writing sec as sin (I hate that notation anyway).

You have rewritten SEC(x) as 1/COS(x)? I myself have trouble memorizing
the definitions of SEC and CSC, but their conversion to SIN and COS is
straightforward, and should be no problem for a CAS.

>
> #10 = Int(x^3*exp(arcsin(x))/(-x^2+1)^(1/2),x) needs a substitution,
> arcsin(x) = t (it is a bit sloppy to write down the integral in the
> given way, not all x are allowed), then it is answered as well.

I think this integrand becomes complex for |x| > 1, much like others of
Charlwood's specimens do, but it is defined on the entire complex plane,
excluding isolated points where it is singular.

Martin.

clicl...@freenet.de

unread,
May 21, 2013, 10:10:55 AM5/21/13
to

Waldek Hebisch schrieb:
>
> clicl...@freenet.de wrote:
> >
I have transcribed this result as

(COS(x)*LOG((- COS(x)^3 - COS(x)^2)*SQRT((4*COS(x)^2 - 4*COS(x) + 4)/
(COS(x)^2 + COS(x))) - 2*COS(x)^3 - 1) + (- COS(x) - 1)*
SQRT((4*COS(x)^2 - 4*COS(x) + 4)/(COS(x)^2 + COS(x))))/(3*COS(x))

which is not a valid antiderivative even on the real axis because the
sign is flipped periodically along the axis (it is even flipped at the
origin, for -pi/2 < x < pi/2). Apart from the sign, however, the result
is correct; so this looks like just another instance of branch-cut
memory loss.

Note that Charlwood's original problem #7 was INT(TAN(x)/SQRT(SEC(x)^3 +
1), x) and not INT(TAN(x)*SQRT(SEC(x)^3 + 1), x).

More integrals of this kind are apparently collected in an appendix to
his paper, but at the appendix at the link given reads only
"[MATHEMATICAL EXPRESSION NOT REPRODUCIBLE IN ASCII]". In view of the
number of problems encountered so far, I expect additional chapters from
the Timofeev suite to be similarly useful in debugging FriCAS and Rubi,
however.

Martin.

Waldek Hebisch

unread,
May 21, 2013, 1:15:51 PM5/21/13
to
--
Waldek Hebisch
heb...@math.uni.wroc.pl

Nasser M. Abbasi

unread,
May 21, 2013, 4:06:37 PM5/21/13
to
fyi;

It is easier to see these 10 integrals by downloading the PDF file itself from
eJMT web site directly:

https://php.radford.edu/~ejmt/ContentIndex.php#v2n2

search the page for Kevin CHARLWOOD, you'll see the article there,
2/3 down the web page.

free to download, just need to create an account there.
click on the PDF link.

--Nasser

Waldek Hebisch

unread,
May 25, 2013, 10:41:32 PM5/25/13
to
Waldek Hebisch <heb...@math.uni.wroc.pl> wrote:
> clicl...@freenet.de wrote:
> >
> > Waldek Hebisch schrieb:
> > >
> > > It seems that three of them hit bugs:
> > >
> > > integrate(cos(x)^2/sqrt(cos(x)^4 + cos(x)^2 + 1), x)
> > > integrate(tan(x)*sqrt(sec(x)^3 + 1), x)
> > > integrate(sqrt(tan(x)^2 + 2*tan(x) + 2), x)
> > >
> > > One hits unimplemented part of Risch algorithm:
> > >
> > > integrate(sin(x)*atan(sqrt(sec(x) - 1)), x)
> > >
>
> > On ten difficult but otherwise random problems, the three failures of
> > FriCAS from "bugs" (?) plus one from an incomplete implementation are
> > very serious indeed.
>
> I consider the 'sqrt(tan(x)^2 + 2*tan(x) + 2); serious: I get
> unevaluated result which means that integrator thinks that
> the integral is nonelementary, which is wrong. The
> 'cos(x)^2/sqrt(cos(x)^4 + cos(x)^2 + 1)' signals error
> during computation.

Both problems have similar reason: trigonomerics internally are
converted to complex exponentials which leads to complex
coefficient. However, routine handling algebraic functions
wants rational coefficients (with algebraics given by
equations with rational coefficients). In the first case
the integration routine missed fact that a factor of Trager
resultant which was irreducible over rationals factored over
complex numbers. In the second case complex coefficient
was discoverd in unexpected place. The issue with
complex coefficients is relatively easy to fix. However,
the problem is deeper: in principle any algebraics,
like sqrt(2) may cause wrong factorization and fixing
that require more work.

BTW: The examples were clearly selected to trigger that
sort of problems, for example also Maxima throws error
due to unexpected complex number.

BTW2: I now tried other Charlwood examples and I do not
see new problems (beside 41 hitting unimplemented parts
of Risch algorithm and second 3 added by A Rich taking
more time than I was willing to wait).

BTW3: Sorry for earlier post with no added text.

--
Waldek Hebisch
heb...@math.uni.wroc.pl

clicl...@freenet.de

unread,
May 26, 2013, 11:25:19 AM5/26/13
to

Waldek Hebisch schrieb:
So the riddle is solved why the second volume of Bronstein's opus was
never completed!

Which integrals are the "second 3 added by A Rich"?

The post with no text added was simply taken as a clear sign that you
had fallen asleep over the keyboard ;).

Martin.

Waldek Hebisch

unread,
May 27, 2013, 6:47:23 AM5/27/13
to
clicl...@freenet.de wrote:
>
> Waldek Hebisch schrieb:
> >
> > BTW2: I now tried other Charlwood examples and I do not
> > see new problems (beside 41 hitting unimplemented parts
> > of Risch algorithm and second 3 added by A Rich taking
> > more time than I was willing to wait).
> >
>
> Which integrals are the "second 3 added by A Rich"?
>

INT(sqrt(-x + sqrt(x)*sqrt(1 + x))/sqrt(1 + x), x)

--
Waldek Hebisch
heb...@math.uni.wroc.pl

clicl...@freenet.de

unread,
May 27, 2013, 12:24:13 PM5/27/13
to

Waldek Hebisch schrieb:
I see: what integration by parts takes Charlwoods problem #3 into.

Thanks,

Martin.

Waldek Hebisch

unread,
Jun 20, 2013, 10:38:41 AM6/20/13
to
Waldek Hebisch <heb...@math.uni.wroc.pl> wrote:
> Waldek Hebisch <heb...@math.uni.wroc.pl> wrote:
> > clicl...@freenet.de wrote:
> > >
> > > Waldek Hebisch schrieb:
> > > >
> > > > It seems that three of them hit bugs:
> > > >
> > > > integrate(cos(x)^2/sqrt(cos(x)^4 + cos(x)^2 + 1), x)
> > > > integrate(tan(x)*sqrt(sec(x)^3 + 1), x)
> > > > integrate(sqrt(tan(x)^2 + 2*tan(x) + 2), x)
> > > >
> > > > One hits unimplemented part of Risch algorithm:
> > > >
> > > > integrate(sin(x)*atan(sqrt(sec(x) - 1)), x)
> > > >
>
> BTW2: I now tried other Charlwood examples and I do not
> see new problems (beside 41 hitting unimplemented parts
> of Risch algorithm and second 3 added by A Rich taking
> more time than I was willing to wait).
>

FYI, on run the second 3 on a fast machine overnight and
the result is:

(1) -> )set messages time on
(1) -> setSimplifyDenomsFlag(true)

(1) false
Type: Boolean
Time: 0.02 (IN) + 0.03 (OT) = 0.06 sec
(2) -> integrate(sqrt(-x + sqrt(x)*sqrt(1 + x))/sqrt(1 + x), x)

(2)
+----------------+
+-+ +-----+ +-+ +-+ | +-+ +-----+
+-+ (2\|2 \|x + 1 + 6\|2 \|x )\|\|x \|x + 1 - x
3\|2 atan(----------------------------------------------)
8x - 1
+
+----------------+
+-----+ +-+ | +-+ +-----+
(12\|x + 1 + 4\|x )\|\|x \|x + 1 - x
/
8
Type: Union(Expression(Integer),...)
Time: 0.00 (IN) + 22432.48 (EV) + 0.19 (OT) = 22432.67 sec


This and original 3 may look equivalent, but in fact atan in
original 3 is a hint which FriCAS is able to use to give
answer in much shorther time.

BTW: Current developement FriCAS can also do #9:

(3) -> integrate(sin(x)*atan(sqrt(sec(x) - 1)), x)

(3)
+------------+
|- cos(x) + 1
cos(x) |------------
+----------+ \| cos(x)
- 2cos(x)atan(\|sec(x) - 1 ) + atan(---------------------)
cos(x) - 1
+
+------------+
|- cos(x) + 1
cos(x) |------------
\| cos(x)
/
2
Type: Union(Expression(Integer),...)

BTW2: Older versions of FriCAS could do #5 and #8. But the underlying
bug was there all the time. Simply in the past integration of those
two examples took different path which avoided the bug. With
moderate effort it should be possible to restore old behaviour.
However:
- restoring old behaviour would have undesirable consequences of
other integrals
- I would loose a testcase for deep problem.

--
Waldek Hebisch
heb...@math.uni.wroc.pl

clicl...@freenet.de

unread,
Jun 20, 2013, 1:21:57 PM6/20/13
to

Waldek Hebisch schrieb:
22432/60^2 = 6.23 hours. This must be one of the hardest nested-square-
root integrands FriCAS ever tackled successfully. I remember it couldn't
do INT(SQRT(SQRT(x^4 + 1) + x^2)/((x + 1)^2*SQRT(x^4 + 1)), x) in a
month three years ago. Is Davenport's 'algint' handling nested square
roots faster in general?

>
> BTW: Current developement FriCAS can also do #9:
>
> (3) -> integrate(sin(x)*atan(sqrt(sec(x) - 1)), x)
>
> (3)
> +------------+
> |- cos(x) + 1
> cos(x) |------------
> +----------+ \| cos(x)
> - 2cos(x)atan(\|sec(x) - 1 ) + atan(---------------------)
> cos(x) - 1
> +
> +------------+
> |- cos(x) + 1
> cos(x) |------------
> \| cos(x)
> /
> 2
> Type: Union(Expression(Integer),...)

Did you supply the missing part of the Risch algorithm, or just send the
evaluation onto a different path?

>
> BTW2: Older versions of FriCAS could do #5 and #8. But the underlying
> bug was there all the time. Simply in the past integration of those
> two examples took different path which avoided the bug. With
> moderate effort it should be possible to restore old behaviour.
> However:
> - restoring old behaviour would have undesirable consequences of
> other integrals
> - I would loose a testcase for deep problem.

Martin.

Waldek Hebisch

unread,
Jun 20, 2013, 4:11:33 PM6/20/13
to
'setSimplifyDenomsFlag(true)' usually gives huge speedup on such
integrals. With this flag
'integrate(sqrt(sqrt(x^4 + 1) + x^2)/((x + 1)^2*sqrt(x^4 + 1)), x)'
takes 9.67 sec on the same machine.

So, yes, this version of #3 is quite hard for FriCAS.

> Is Davenport's 'algint' handling nested square
> roots faster in general?

I did not seroiusly try 'algint'. Theoretically Davenport's
method is slower, but a lot depends on implementation
details. For example FriCAS converts nested roots to
a single algebraic element. IIRC Davenport explicitely
handled nested roots. This can make notrivial difference.

In few examples I noted that computing determinants via
minor expansion was much faster than default Gaussion
elimination. But minor expansion is very slow on large
matrices and Gaussion handles them quite well, so
changing default to minor expansion is out of question.

My point is that time needed for computations depends on
many choices, and choices good for one example may be
quite bad for other.

> >
> > BTW: Current developement FriCAS can also do #9:
> >
> > (3) -> integrate(sin(x)*atan(sqrt(sec(x) - 1)), x)
> >
> > (3)
> > +------------+
> > |- cos(x) + 1
> > cos(x) |------------
> > +----------+ \| cos(x)
> > - 2cos(x)atan(\|sec(x) - 1 ) + atan(---------------------)
> > cos(x) - 1
> > +
> > +------------+
> > |- cos(x) + 1
> > cos(x) |------------
> > \| cos(x)
> > /
> > 2
> > Type: Union(Expression(Integer),...)
>
> Did you supply the missing part of the Risch algorithm, or just send the
> evaluation onto a different path?

At missing part choose different path. FriCAS in few places tries
changes of variable. Now instead of giving up FriCAS tries
change of variables (taking complex exponential as a new variable).
For this example (and all of category "algebraic function of
trigonometrics") change of variables works. If change of
variables does not work then FriCAS will give up as before.

--
Waldek Hebisch
heb...@math.uni.wroc.pl

Nasser M. Abbasi

unread,
Jun 20, 2013, 5:41:40 PM6/20/13
to
On 6/20/2013 9:38 AM, Waldek Hebisch wrote:
> BTW: Current developement FriCAS can also do #9:
>
> (3) -> integrate(sin(x)*atan(sqrt(sec(x) - 1)), x)
>
> (3)
> +------------+
> |- cos(x) + 1
> cos(x) |------------
> +----------+ \| cos(x)
> - 2cos(x)atan(\|sec(x) - 1 ) + atan(---------------------)
> cos(x) - 1
> +
> +------------+
> |- cos(x) + 1
> cos(x) |------------
> \| cos(x)
> /
> 2
> Type: Union(Expression(Integer),...)

Thanks for the update. I updated the score table with the above result.

http://www.12000.org/my_notes/ten_hard_integrals/index.htm

current scores:
================
Mathematica 90%
Maple, Rubi, Axiom, FriCAS 80%
Sage 50%
Maxima, XCAS 40%
sympy, Reduce, mupad 20%

ps. I could not find a way to make a link to your post. I searched
google messages

https://groups.google.com/forum/#!topic/sci.math.symbolic/D9W45zQTY3U

and searched

http://mathforum.org/kb/thread.jspa?threadID=2573190

They both seem to stop the thread earlier. And found no way
to make a link to a specific posting.

--Nasser

clicl...@freenet.de

unread,
Jun 21, 2013, 8:41:33 AM6/21/13
to

"Nasser M. Abbasi" schrieb:
>
> Thanks for the update. I updated the score table with the above result.
>
> http://www.12000.org/my_notes/ten_hard_integrals/index.htm
>
> current scores:
> ================
> Mathematica 90%
> Maple, Rubi, Axiom, FriCAS 80%
> Sage 50%
> Maxima, XCAS 40%
> sympy, Reduce, mupad 20%
>
> ps. I could not find a way to make a link to your post. I searched
> google messages
>
> https://groups.google.com/forum/#!topic/sci.math.symbolic/D9W45zQTY3U
>
> and searched
>
> http://mathforum.org/kb/thread.jspa?threadID=2573190
>
> They both seem to stop the thread earlier. And found no way
> to make a link to a specific posting.
>

At Math Forum at least, they are not simply ordered by date:

<http://mathforum.org/kb/message.jspa?messageID=9141345>

Martin.

clicl...@freenet.de

unread,
Jun 21, 2013, 2:24:44 PM6/21/13
to

"Nasser M. Abbasi" schrieb:
>
> http://www.12000.org/my_notes/ten_hard_integrals/index.htm
>
> current scores:
> ================
> Mathematica 90%
> Maple, Rubi, Axiom, FriCAS 80%
> Sage 50%
> Maxima, XCAS 40%
> sympy, Reduce, mupad 20%
>

I notice that you list problem #3 as "done" by Sage while no result is
shown on the problem page

<http://www.12000.org/my_notes/ten_hard_integrals/inse3.htm#x4-30003>

Martin.

Nasser M. Abbasi

unread,
Jun 21, 2013, 3:56:29 PM6/21/13
to
On 6/21/2013 1:24 PM, clicl...@freenet.de wrote:

>
> I notice that you list problem #3 as "done" by Sage while no result is
> shown on the problem page
>
> <http://www.12000.org/my_notes/ten_hard_integrals/inse3.htm#x4-30003>
>
> Martin.
>

opps, thanks Martin. This was my manual book-keeping lookup mistake. Yes,
Sage does not do #3. It just hangs in there actually. I do not get any output
after waiting for a while on the web page. I am using Sage 5.4 from
http://www.sagenb.org

Just fixed it and updated the table, score now is:
-----------------------------
Mathematica 90%
Maple, Rubi, Axiom, FriCAS 80%
Sage, Maxima, XCAS 40%
sympy, Reduce, mupad 20%


The hardest integrals out of these 10, which had most
number of CAS systems not give an answer for are #3 and #5
(8 out 11 systems did not answer)
---------------------------------------------
#3) int(asin(sqrt(x+1)-sqrt(x)),x)
#5) int(cos(x)^2/sqrt(cos(x)^4+cos(x)^2+1),x)

The easiest, which had most number of CAS systems give an
answer on was #2 (only 2 out of 11 systems did not answer):
-------------------------------------------------
#2) int(x*asin(x)/sqrt(1-x^2),x)


--Nasser

Axel Vogt

unread,
Jun 22, 2013, 4:14:59 PM6/22/13
to
On 21.06.2013 21:56, Nasser M. Abbasi wrote:
...
>
> Just fixed it and updated the table, score now is:
> -----------------------------
> Mathematica 90%
> Maple, Rubi, Axiom, FriCAS 80%
> Sage, Maxima, XCAS 40%
> sympy, Reduce, mupad 20%

Side remark - as Maple does not solve #9, #10 at the page
http://www.12000.org/my_notes/ten_hard_integrals/maple_8.html

# 9
Generally Maple it seems that Maple wants 'cos' or 'sin' instead of
'sec'. After convert(%, cos) it gives an [ugly] answer

I do not want to discuss this

# 10
It seems that Maple hesitates to work with arcsin, but changing the
variable x= sin(t) and *enforcing* arcsin(sin(t)) = t does it

# 8
That looks ugly. To have it even more ugly:

Int(sqrt(tan(x)^2+2*tan(x)+2),x);
convert(%, cos); simplify(%);

Int(((cos(x)^2+2*sin(x)*cos(x)+1)/cos(x)^2)^(1/2),x)

value(%);

results in an useless expression of 15520465 characters :-)
0 new messages