MathGroup Archive 2005

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

Search the Archive

Re: evaluate assuming odd integers?


Clear[n];

int=Integrate[Sin[n*Pi*(z/L)],{z,0,L}];

Simplify[
  Simplify[
      int/.n->2*m+1,
      Element[m, Integers]]/.
    m->(n-1)/2]

(2*L)/(n*Pi)


Bob Hanlon

> 
> From: "ab at sd.com" <at2 at ads.com>
To: mathgroup at smc.vnet.net
> Date: 2005/07/25 Mon AM 01:12:15 EDT
> Subject: [mg58982] [mg58961] evaluate assuming odd integers?
> 
> Is there a way in Mathematica to evaluate an expression assuming some 
> varialbe is Odd integer, for example in below integral how can i tell it 
> that n is odd integer in the Assumptions section of FullSimplify command 
or 
> the integral itself??:
> In[35]:=
> Integrate[Sin[n*Pi*(z/L)], {z, 0, L}]
> FullSimplify[%, n \[Element] Integers && n >= 0 &&
> L \[Element] Reals && L > 0 && z \[Element] Reals]
> 
> 


  • Prev by Date: Re: evaluate assuming odd integers?
  • Next by Date: Re: Passing options through user-defined functions
  • Previous by thread: Re: evaluate assuming odd integers?
  • Next by thread: How to plot individual 2D data points, where each must have its own color.