Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: A question about $Assumptions

  • To: mathgroup at
  • Subject: [mg68958] Re: A question about $Assumptions
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at>
  • Date: Fri, 25 Aug 2006 05:35:20 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <echdmb$oji$>
  • Sender: owner-wri-mathgroup at

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