Forums before death by AOL, social media and spammers... "We can't have nice things"
|    sci.math.symbolic    |    Symbolic algebra discussion    |    10,432 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 9,837 of 10,432    |
|    clicliclic@freenet.de to clicliclic@freenet.de    |
|    Re: how does your CAS handle this integr    |
|    04 Mar 18 18:09:20    |
   
   clicliclic@freenet.de schrieb:   
   >   
   > "Nasser M. Abbasi" schrieb:   
   > >   
   > > so far, Maple 2017.3 and Mathematica 11.2 give wrong results   
   > > on this:   
   > >   
   > > integrand := cos(x)* sin(x)^2*cos(n*x);   
   > >   
   > > Now I wanted to integrate the above from 0..2PI   
   > > with the assumption that n above is integer and   
   > > positive.   
   > >   
   > > What does your CAS give for the integral? hint:   
   > > it should not be zero. But....   
   > >   
   > > Maple:   
   > > integrand := cos(x)* sin(x)^2*cos(n*x);   
   > > assume(n,integer,n>0);   
   > > int(integrand,x=0..2*Pi);   
   > >   
   > > 0   
   > >   
   > > Mathematica:   
   > > Assuming[Element[n, Integers] && n > 0,   
   > > Integrate[integrand, {x, 0, 2 Pi}]]   
   > > 0   
   > >   
   > > But this integral is not zero for all integer n.   
   > >   
   > > Table[Integrate[integrand, {x, 0, 2 Pi}], {n, 1, 5}]   
   > > {Pi/4,0,-Pi/4,0,0}   
   > >   
   > > I do not know how to use assumptions yet in Fricas   
   > > to test this. Will try to learn how to.   
   > >   
   > > I really do not understand how advanced and mature CAS   
   > > systems like Maple and Mathematica can get this wrong.   
   > >   
   > > Or may be it is by design. I do not know. Someone told   
   > > me it is hard to program these exception cases into CAS   
   > > and have it check for each special case. Any thoughts?   
   > >   
   >   
   > Letting Derive 6.10 loose on your definite integral for symbolic   
   > positive integer n:   
   >   
   > n :epsilon Real(0, inf)   
   >   
   > INT(COS(x)*SIN(x)^2*COS(n*x), x, 0, 2*pi)   
   >   
   > 2*n*SIN(2*pi*n)/((n + 1)*(1 - n)*(n + 3)*(n - 3))   
   >   
      
   Oops, this should have been Integer instead of Real:   
      
   n :epsilon Integer(0, inf)   
      
   INT(COS(x)*SIN(x)^2*COS(n*x), x, 0, 2*pi)   
      
   0   
      
   >   
   > Perfect all around, I would say :).   
      
   Not at all so perfect, unfortunately :(.   
      
   Martin.   
      
   PS: This was a honest mistake: I happened to select the wrong variable   
   type in a menu and didn't examine the Derive instruction generated.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca