Re: A question about $Assumptions
- To: mathgroup at smc.vnet.net
- Subject: [mg68960] Re: [mg68909] A question about $Assumptions
- From: Daniel Lichtblau <danl at wolfram.com>
- Date: Fri, 25 Aug 2006 05:35:21 -0400 (EDT)
- References: <200608231115.HAA24937@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Led wrote: > Mathematica 5.2 (Windows) gives: > > In[1]:= > Integrate[ Cos[m*x] * Cos[n*x] ,{x,0,Pi}] > > Out[1]= > \!\(\(m\ Cos[n\ Ï?]\ Sin[m\ Ï?] - n\ Cos[m\ Ï?]\ Sin[n\ Ï?]\)\/\(m\^2 - > n\^2\)\) > > which is the expected result. But if instead one writes > > In[1]:= > $Assumptions={{m,n}â??Integers}; > Integrate[ Cos[m*x] * Cos[n*x] ,{x,0,Pi}] > > Out[1]= > 0 > > the result is correct only if m~=n. > > What's the problem with $Assumptions? > Shouldn't it be used that way? Generally speaking Integrate will give results that may be wrong on a "small" subset in parameter space, for example a discrete set. If you do something like In[10]:= Integrate[Cos[m*x]*Cos[n*x], {x,0,Pi}, Assumptions->Element[{m,n},Integers]] Out[10]= 0 you indeed get a result that is wrong on a "small" discrete subset of Z^2, to wit, the diagonal. My view is one should not expect much from assumptions of integrality on parameters used in Limit, Series, or Integrate. If only because I've never had any good ideas for how to make them behave well. Daniel Lichtblau Wolfram Research
- References:
- A question about $Assumptions
- From: "Led" <zep.led@laposte.net>
- A question about $Assumptions