Ralf Hemmecke wrote:
> 
> 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.
>

If you trace INTEF you will see that the result from core
integrator is quite small:

(1) -> f:=1/(sin(x)^4+1)

             1
   (1)  -----------
              4
        sin(x)  + 1
                                                    Type: Expression(Integer)
(2) -> a:=integrate(f,x)
 1<enter ElementaryIntegration.lfintegrate,43 : 
            x 8        x 6        x 4        x 2
        tan(-)  + 4tan(-)  + 6tan(-)  + 4tan(-)  + 1
            2          2          2          2
 arg1= ---------------------------------------------
           x 8        x 6         x 4        x 2
       tan(-)  + 4tan(-)  + 22tan(-)  + 4tan(-)  + 1
           2          2           2          2
 arg2= x
  2<enter ElementaryIntegration.lfintegrate,43 : 
  arg1= 0
  arg2= x
  2>exit  ElementaryIntegration.lfintegrate,43 : 
  0
 1>exit  ElementaryIntegration.lfintegrate,43 : 
          --+                         x   3         x          x 2
          >             %D log(256tan(-)%D  + 16tan(-)%D + tan(-)  - 1)
          --+                         2             2          2
   4    1   2    1
 %D  + -- %D  + ---= 0
       16       512


The mess you see is result of explicit formulas for roots of quartic
and making the result real.  The code computing real part of log
tries to also get correct imaginary part, which results in bigger
formulas.  Without forcing real expressions we get:

(4) -> a:=integrate(f,x)  

   (4)
                                            +----------+
        +----------+       +---+            | +---+          +-+
        | +---+         (2\|- 1  + 2)sin(x)\|\|- 1  - 1  - 2\|2 cos(x)
       \|\|- 1  - 1 log(----------------------------------------------)
                                          cos(x) + 1
     + 
                                                +------------+
          +------------+       +---+            |   +---+          +-+
          |   +---+         (2\|- 1  - 2)sin(x)\|- \|- 1  - 1  - 2\|2 cos(x)
       - \|- \|- 1  - 1 log(------------------------------------------------)
                                               cos(x) + 1
     + 
                                                +------------+
        +------------+         +---+            |   +---+          +-+
        |   +---+         (- 2\|- 1  + 2)sin(x)\|- \|- 1  - 1  - 2\|2 cos(x)
       \|- \|- 1  - 1 log(--------------------------------------------------)
                                              cos(x) + 1
     + 
                                                +----------+
          +----------+         +---+            | +---+          +-+
          | +---+         (- 2\|- 1  - 2)sin(x)\|\|- 1  - 1  - 2\|2 cos(x)
       - \|\|- 1  - 1 log(------------------------------------------------)
                                             cos(x) + 1
  /
       +-+
     4\|2
                                         Type: Union(Expression(Integer),...)


The problem is that limit code can not handle complex expressions,
so definite integrals would fail.

-- 
                              Waldek Hebisch
[email protected] 

-- 
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