RE: Negative Area

*To*: mathgroup at christensen.cybernetics.net*Subject*: [mg220] RE: [mg213] Negative Area*From*: Chip Sample <sample at shire.ac.arknet.edu>*Date*: Wed, 23 Nov 1994 11:12:10 CST

On integrating a +ve function (A>B) I obtain a -ve function. Would you consider this to be a bug? In[347]:= Integrate[1/(A+B Cos[x])^2,{x,0,2 Pi}]/.{A->2,B->1} Out[347]= -4 Pi --------- 3 Sqrt[3] --- Yours, Roger (rmj at llewelyn.slac.stanford.edu) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Since the form of the indefinite integral depends on the values of A and B, the proper thing for Mma to do is leave the integral unevaluated. Maybe this is related to other complaints that MMa is incapable of keeping track of such constraints as A is integer or B >0. It would seem to need this capability to recognize that a pattern match is conditional on such a constraint. At any rate, it seems like a good idea to give Mma all the inputs you have up front if possible to avoid this "bug". I tried: Integrate[1/(A+B Cos[x])^2/.{A->2,B->1},{x,0,2 Pi}] Out[4]= 4 Pi --------- 3 Sqrt[3] apparently the right answer. Chip