From: Albert on
On Jul 16, 9:45 pm, Vladimir Bondarenko <v...(a)cybertester.com> wrote:

> What is the origin of the Mathematica 7
> human unreadable library-size answer?

Integration is hard! It is easy for a system to go blindly down the
wrong path. But there are lots of examples where Mathematica gets
better answers than Rubi and Maple. Similarly, there are other
examples that Maple can do, but the others can't. (For hundreds of
such examples, see the test result files available on the website.)

But what makes Rubi unique is that its operation is transparent to the
user. If unhappy with a result, you can single-step through the
problem, determine what is wrong, and correct it.

Mathematica's ByteCount function is a low-level, system-dependent
measure of mathematical expression size. Instead I recommend using the
higher-level LeafCount function. Another possible measure of
expression size is the number of occurrences of the integration
variable in the antiderivative. Also the number of terms in the
antiderivative is a quick-and-dirty measure a person can determine
simply by viewing it in expanded form.

Albert
From: clicliclic on

Vladimir Bondarenko schrieb:
>
> > > >
> > > > f = Tan[z]/Sqrt[1+Tan[z]^4];
> > > >
> > > > Timing[ByteCount[Integrate[f, z]]] {30.078, 1071488}
> > > >
> > > > Timing[ByteCount[Int[f, z]]] {0.125, 1952}
>
> [...]
>
> What is the origin of the Mathematica 7
> human unreadable library-size answer?
>

Book, not library, size answer. Substituting t for TAN(z) gives
INT(t/((t^2 + 1)*SQRT(t^4 + 1)), t). Obviously, Mathematica does not see
a way to evaluate this in elementary terms, and goes down the standard
elliptic path. Nonetheless, applying traditional textbook recipes
designed for paper-and-pencil integration would leave the expression
size manageable even then, I think. So, what MMA is doing here suggests
a serious design mistake.

Maple's result

> -1/4*2^(1/2)*arctanh(1/4*(2-2*tan(z)^2)*2^(1/2)/
> ((1+tan(z)^2)^2-2*tan(z)^2)^(1/2))

must be close to the optimum answer. The size remains small when the
logarithm is used instead of the area function. E.g.

SQRT(2)/4*LN(COS(z)^2*(SQRT(2/COS(z)^4-4*TAN(z)^2)-2)+1)

Martin.
From: Albert on
On Jul 17, 7:36 am, cliclic...(a)freenet.de wrote:

> Substituting t for TAN(z) gives
> INT(t/((t^2 + 1)*SQRT(t^4 + 1)), t).

For this integral Rubi retuns

-ArcTanh[Sqrt[2]*Sqrt[1+t^4]/(1-t^2)]/(2*Sqrt[2])

Therefore I posit

-ArcTanh[Sqrt[2]*Sqrt[1+Tan[z]^4]/(1-Tan[z]^2)]/(2*Sqrt[2])

as the optimal antiderivative of

Tan[z]/Sqrt[1+Tan[z]^4]

which is equivalent to, but slightly simpler than, Maple's result.
Obviously, Mathematica and Rubi need work...

Albert
From: Jon McLoone on
On Jul 17, 9:52 pm, Albert <Albert_R...(a)msn.com> wrote:
> On Jul 17, 7:36 am, cliclic...(a)freenet.de wrote:
>
> > Substituting t for TAN(z) gives
> > INT(t/((t^2 + 1)*SQRT(t^4 + 1)), t).
>
> For this integral Rubi retuns
>
> -ArcTanh[Sqrt[2]*Sqrt[1+t^4]/(1-t^2)]/(2*Sqrt[2])
>
> Therefore I posit
>
> -ArcTanh[Sqrt[2]*Sqrt[1+Tan[z]^4]/(1-Tan[z]^2)]/(2*Sqrt[2])
>
> as the optimal antiderivative of
>
> Tan[z]/Sqrt[1+Tan[z]^4]
>
> which is equivalent to, but slightly simpler than, Maple's result.
> Obviously, Mathematica and Rubi need work...
>
> Albert

Some improvement in the next release...

In[1]:= f = Tan[z]/Sqrt[1 + Tan[z]^4];

In[2]:= Timing[ByteCount[Integrate[f, z]]]

Out[2]= {0.031, 1840}

In[3]:= Integrate[f, z]

Out[3]= -((Sqrt[3 + Cos[4*z]]*Log[Sqrt[2]*Cos[2*z] + Sqrt[3 +
Cos[4*z]]]*Sec[z]^2)/(4*Sqrt[2]*Sqrt[1 + Tan[z]^4]))
From: Albert on
On Jul 19, 12:34 am, Jon McLoone <j...(a)wolfram.co.uk> wrote:

> Some improvement in the next release...
>
> In[1]:= f = Tan[z]/Sqrt[1 + Tan[z]^4];
>
> In[2]:= Timing[ByteCount[Integrate[f, z]]]
>
> Out[2]= {0.031, 1840}
>
> In[3]:= Integrate[f, z]
>
> Out[3]= -((Sqrt[3 + Cos[4*z]]*Log[Sqrt[2]*Cos[2*z] + Sqrt[3 +
> Cos[4*z]]]*Sec[z]^2)/(4*Sqrt[2]*Sqrt[1 + Tan[z]^4]))

Great! When is the next release, presumably Mathematica 8, going to be
released? I note that WolframAlpha is still unable to integrate this
expression.

I recommend including in your test suite for the next release the more
general problem

Integrate[Tan[x]/Sqrt[a + b*Tan[x]^2 + c*Tan[x]^4], x]

for which Rubi 2 returns

-(ArcTanh[(2*Sqrt[a-b+c]*Sqrt[a + b*Tan[x]^2 + c*Tan[x]^4])/
(2*a - b + (b-2*c)*Tan[x]^2)]/
(2*Sqrt[a-b+c]))

Also don't forget to include the corresponding tests for Cot and the
hyperbolic functions Tanh and Coth...

Albert