Looks like FriCAS is giving quite a long result in contrast to Maple or
Mathematica. See attachements.

Waldek,

seems like FriCAS is trying to keep the coefficients real. Is this why
the output becomes so long? The derivative D(a,x) looks terribly big,
although I haven't yet investigated whether or not its still correct.

Ralf

On 11/29/2014 01:54 PM, [email protected] wrote:
> Thank you for taking the time to generate a bug report.
> 
>> I'm exploring the power of integrate() in Axiom, and find that
>>
>> f:=1/(sin(x)^4+1)
>> a:=integrate(f,x)
>> b:=differentiate(a,x,1)
>> draw(b, x=0..4)
>> draw(f, x=0..4)
>>
>> give me inconsistent result.
> 
> Yes, Axiom did give an "inconsistent result", which is most likely
> a "wrong" result as well.
> 
>> If change to say f:=1/(x^4+1), then I get consistent result.
> 
> Actually that looks wrong also. Click on the graph to bring up
> the control panel, click on "units on", and you'll find that
> the curves are different. The integrate/differentiate is failing.
> 
>> Also tested latest code (2014-11-28) in github(git clone 
>> git://github.com/daly/axiom.git).
>>
>> bug 7251, 7147, 7085/15, 7084/293 may be related to this bug?
>> Note that strictly speaking, integrate(1/(x^4+1),x) also returns an 
>> incorrect result (correct only when understand it as a complex 
>> multi-value function).
> 
> I don't know if these are related (the integration code is not
> simple and chasing bugs is time-consuming). 
> 
>> One more note: I have tried FriCAS (also the latest version), it give me 
>> the correct integration result.
> 
> I tried FriCAS (2013-04-06 on MAC OS X). 
> 
> I found that 
> 
> f:=1/(sin(x)^4+1)
> a:=integrate(f,x)
> b:=differentiate(a,x,1)
> draw(b, x=0..4)
> 
> fails with the message:
> 
> draw(b,x=0..4)
>   Compiling function %O with type DoubleFloat -> DoubleFloat
> 
>   >> System error:
>   Too large to be represented as a SINGLE-FLOAT
>   14353327979561593211089438493917727500805625855126443
> 
> Also, the graphs show that the result is wrong when you turn
> "units on".
> 
> When I get near my office I will try the test in Maple and MMA.
> 
> Thanks for the bug report.
> 
> Can you send your full name to "[email protected]" so I
> can list you in the credits?
> 
> Tim
> 
> 
> 
> _______________________________________________
> Axiom-developer mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/axiom-developer
> 

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
(33) -> a:=integrate(1/(sin(x)^4+1),x)

   (33)
          4+-+
         4\|2
      *
         atan
                +-+4+-+
              2\|2 \|2 sin(x)
           /
                                                +---------+
                                                |  +-+
                     +-+               +-+      |2\|2  - 4
                  ((\|2  - 1)cos(x) + \|2  - 1) |---------
                                                |  +-+
                                               \|2\|2  - 3
               *
                  ROOT
                                                          +---------+
                                                          |  +-+
                               +-+       4+-+             |2\|2  - 4
                         (- 96\|2  + 136)\|2 cos(x)sin(x) |---------
                                                          |  +-+
                                                         \|2\|2  - 3
                       +
                                +-+      4+-+2      +-+            2
                         ((- 56\|2  + 80)\|2   + 56\|2  - 80)cos(x)
                       +
                             +-+      4+-+2
                         (56\|2  - 80)\|2
                    /
                          +-+            2       +-+                 +-+
                       (7\|2  - 10)cos(x)  + (14\|2  - 20)cos(x) + 7\|2  - 10
              +
                                  +---------+
                                  |  +-+
                   +-+            |2\|2  - 4         +-+     4+-+
                (2\|2  - 4)cos(x) |---------  + (- 2\|2  + 4)\|2 sin(x)
                                  |  +-+
                                 \|2\|2  - 3
     +
          4+-+
         4\|2
      *
         atan
                +-+4+-+
              2\|2 \|2 sin(x)
           /
                                                +---------+
                                                |  +-+
                     +-+               +-+      |2\|2  - 4
                  ((\|2  - 1)cos(x) + \|2  - 1) |---------
                                                |  +-+
                                               \|2\|2  - 3
               *
                  ROOT
                                                        +---------+
                                                        |  +-+
                             +-+       4+-+             |2\|2  - 4
                         (96\|2  - 136)\|2 cos(x)sin(x) |---------
                                                        |  +-+
                                                       \|2\|2  - 3
                       +
                                +-+      4+-+2      +-+            2
                         ((- 56\|2  + 80)\|2   + 56\|2  - 80)cos(x)
                       +
                             +-+      4+-+2
                         (56\|2  - 80)\|2
                    /
                          +-+            2       +-+                 +-+
                       (7\|2  - 10)cos(x)  + (14\|2  - 20)cos(x) + 7\|2  - 10
              +
                                  +---------+
                                  |  +-+
                   +-+            |2\|2  - 4       +-+     4+-+
                (2\|2  - 4)cos(x) |---------  + (2\|2  - 4)\|2 sin(x)
                                  |  +-+
                                 \|2\|2  - 3
     +
             +-+     4+-+
         (- \|2  + 1)\|2
      *
         log
                                               +---------+
                                               |  +-+
                    +-+       4+-+             |2\|2  - 4
                (96\|2  - 136)\|2 cos(x)sin(x) |---------
                                               |  +-+
                                              \|2\|2  - 3
              +
                     +-+      4+-+2      +-+            2       +-+      4+-+2
              ((- 56\|2  + 80)\|2   + 56\|2  - 80)cos(x)  + (56\|2  - 80)\|2
           /
                 +-+            2       +-+                 +-+
              (7\|2  - 10)cos(x)  + (14\|2  - 20)cos(x) + 7\|2  - 10
     +
           +-+     4+-+
         (\|2  - 1)\|2
      *
         log
                                                 +---------+
                                                 |  +-+
                      +-+       4+-+             |2\|2  - 4
                (- 96\|2  + 136)\|2 cos(x)sin(x) |---------
                                                 |  +-+
                                                \|2\|2  - 3
              +
                     +-+      4+-+2      +-+            2       +-+      4+-+2
              ((- 56\|2  + 80)\|2   + 56\|2  - 80)cos(x)  + (56\|2  - 80)\|2
           /
                 +-+            2       +-+                 +-+
              (7\|2  - 10)cos(x)  + (14\|2  - 20)cos(x) + 7\|2  - 10
  /
                 +---------+
                 |  +-+
        +-+      |2\|2  - 4
     (4\|2  - 8) |---------
                 |  +-+
                \|2\|2  - 3
                                         Type: Union(Expression(Integer),...)

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
    |\^/|     Maple 16 (X86 64 LINUX)
._|\|   |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2012
 \  MAPLE  /  All rights reserved. Maple is a trademark of
 <____ ____>  Waterloo Maple Inc.
      |       Type ? for help.
> int(1/(sin(x)^4+1),x);
      1/2     1/2     1/2     1/2    1/2     1/2     1/2                  2
1/16 2    (2 2    - 2)    ln(2    + 2    (2 2    - 2)    tan(x) + 2 tan(x) )

                      %1 + 4 tan(x)   1/2                  %1 + 4 tan(x)
           arctan(1/2 -------------) 2          arctan(1/2 -------------)
                            1/2 1/2                              1/2 1/2
                      (1 + 2   )                           (1 + 2   )
     + 1/4 ------------------------------ + 1/4 ------------------------- -
                         1/2 1/2                            1/2 1/2
                   (1 + 2   )                         (1 + 2   )

    1/16

     1/2     1/2     1/2     1/2    1/2     1/2     1/2                  2
    2    (2 2    - 2)    ln(2    - 2    (2 2    - 2)    tan(x) + 2 tan(x) )

                      -%1 + 4 tan(x)   1/2                  -%1 + 4 tan(x)
           arctan(1/2 --------------) 2          arctan(1/2 --------------)
                            1/2 1/2                               1/2 1/2
                      (1 + 2   )                            (1 + 2   )
     + 1/4 ------------------------------- + 1/4 --------------------------
                          1/2 1/2                            1/2 1/2
                    (1 + 2   )                         (1 + 2   )

       1/2     1/2     1/2
%1 := 2    (2 2    - 2)

> diff(%,x);
      1/2     1/2     1/2
1/16 2    (2 2    - 2)

      1/2     1/2     1/2            2                        2     /
    (2    (2 2    - 2)    (1 + tan(x) ) + 4 tan(x) (1 + tan(x) ))  /  (
                                                                  /

     1/2    1/2     1/2     1/2                  2
    2    + 2    (2 2    - 2)    tan(x) + 2 tan(x) )

                                2   1/2
                   (4 + 4 tan(x) ) 2
     + 1/8 -------------------------------------
                      /                       2\
                 1/2  |        (%1 + 4 tan(x)) |
           (1 + 2   ) |1 + 1/4 ----------------|
                      |                 1/2    |
                      \            1 + 2       /

                                   2
                       4 + 4 tan(x)                      1/2     1/2     1/2
     + 1/8 ------------------------------------- - 1/16 2    (2 2    - 2)
                      /                       2\
                 1/2  |        (%1 + 4 tan(x)) |
           (1 + 2   ) |1 + 1/4 ----------------|
                      |                 1/2    |
                      \            1 + 2       /

       1/2     1/2     1/2            2                        2     /
    (-2    (2 2    - 2)    (1 + tan(x) ) + 4 tan(x) (1 + tan(x) ))  /  (
                                                                   /

     1/2    1/2     1/2     1/2                  2
    2    - 2    (2 2    - 2)    tan(x) + 2 tan(x) )

                                 2   1/2
                    (4 + 4 tan(x) ) 2
     + 1/8 --------------------------------------
                      /                        2\
                 1/2  |        (-%1 + 4 tan(x)) |
           (1 + 2   ) |1 + 1/4 -----------------|
                      |                 1/2     |
                      \            1 + 2        /

                                   2
                       4 + 4 tan(x)
     + 1/8 --------------------------------------
                      /                        2\
                 1/2  |        (-%1 + 4 tan(x)) |
           (1 + 2   ) |1 + 1/4 -----------------|
                      |                 1/2     |
                      \            1 + 2        /

       1/2     1/2     1/2
%1 := 2    (2 2    - 2)

> simplify(%);
                                       1
                            -----------------------
                                  4               2
                            cos(x)  + 2 - 2 cos(x)

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
Mathematica 9.0 for Linux x86 (64-bit)
Copyright 1988-2013 Wolfram Research, Inc.

In[1]:= Integrate[1/(Sin[x]^4+1),x]

        ArcTan[Sqrt[1 - I] Tan[x]]   ArcTan[Sqrt[1 + I] Tan[x]]
Out[1]= -------------------------- + --------------------------
              2 Sqrt[1 - I]                2 Sqrt[1 + I]

In[2]:= D[%,x]

                      2                         2
                Sec[x]                    Sec[x]
Out[2]= ----------------------- + -----------------------
                             2                         2
        2 (1 + (1 - I) Tan[x] )   2 (1 + (1 + I) Tan[x] )

In[3]:= Simplify[%-1/(Sin[x]^4+1)]

Out[3]= 0

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to