When integrating sin(x)*cos(2*n*x), n=1,10,20,30, there is a unusual growth 
in run-time. I guess that the cause might be found in trigonometric 
transformations. Is that so? 
Of course we can integrate using the parameter "n" followed by evaluation, 
however, I wonder whether this behavior is normal. 


(1) -> )set mess time on                                       

(1) -> integrate(sin(x)*cos(2*x),x=0..%pi)                                  

          2
   (1)  - -
          3
                  Type: Union(f1: 
OrderedCompletion(Expression(Integer)),...)
                           Time: 0.00 (IN) + 0.00 (EV) + 0.02 (OT) = 0.02 
sec
(2) -> integrate(sin(x)*cos(2*10*x),x=0..%pi)

           2
   (2)  - ---
          399
                  Type: Union(f1: 
OrderedCompletion(Expression(Integer)),...)
                                                   Time: 0.12 (EV) = 0.12 
sec
(3) -> integrate(sin(x)*cos(2*20*x),x=0..%pi)

            2
   (3)  - ----
          1599
                  Type: Union(f1: 
OrderedCompletion(Expression(Integer)),...)
                                                   Time: 2.90 (EV) = 2.90 
sec
(4) -> integrate(sin(x)*cos(2*30*x),x=0..%pi)

            2
   (4)  - ----
          3599
                  Type: Union(f1: 
OrderedCompletion(Expression(Integer)),...)
                         Time: 0.00 (IN) + 33.10 (EV) + 0.00 (OT) = 33.11 
sec



...



(5) -> integrate(sin(x)*cos(2*m*x),x=0..%pi)

        - cos(2m %pi) - 1
   (5)  -----------------
               2
             4m  - 1
                  Type: Union(f1: 
OrderedCompletion(Expression(Integer)),...)
                           Time: 0.00 (IN) + 0.01 (EV) + 0.01 (OT) = 0.03 
sec               

(8) -> eval(%,m=30)

            2
   (8)  - ----
          3599
                                                    Type: 
Expression(Integer)
                                       Time: 0.03 (IN) + 0.02 (OT) = 0.05 
sec

-- 
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to