MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: A question about $Assumptions

Led wrote:
 > [...]
> 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.
> [...]
> Shouldn't it be used that way? 

No. Rather than modifying directly a system value, it is always better 
and safer to use one of the following constructs:

Block[ { $Assumptions= { m,n}\[Element]Integers},
  Integrate[ Cos[ m*x]* Cos[ n*x], { x,0,Pi}]]

Integrate[Cos[m*x]*Cos[n*x], {x, 0, Pi}, Assumptions -> {m, n} 
\[Element] Integers]

Assuming[{m, n} \[Element] Integers, Integrate[Cos[m*x]*Cos[n*x], {x, 0, 


  • Prev by Date: path along equi-contours
  • Next by Date: RE: Graph inside another graph
  • Previous by thread: Re: A question about $Assumptions
  • Next by thread: Re: A question about $Assumptions