Re: What assumptions to use to check for orthogonality

*To*: mathgroup at smc.vnet.net*Subject*: [mg112904] Re: What assumptions to use to check for orthogonality*From*: Patrick Scheibe <pscheibe at trm.uni-leipzig.de>*Date*: Tue, 5 Oct 2010 05:35:54 -0400 (EDT)

Hi, sorry I just skimmed over your post. What about Clear[n, m, x] r = Integrate[Cos[n*x]*Cos[m*x], {x, -Pi, Pi}] (* The case m=n *) FullSimplify[Limit[r, m -> n], Element[n, Integers]] (* The case m!=n *) FullSimplify[r, Element[{n, m}, Integers] && n != m] Cheers Patrick On Mon, 2010-10-04 at 06:06 -0400, Nasser M. Abbasi wrote: > This is basic thing, and I remember doing this or reading about it before. > > I am trying to show that Cos[m Pi x], Cos[n Pi x] are orthogonal > functions, m,n are integers, i.e. using the inner product definition > > Integrate[Cos[n*Pi*x]*Cos[m*Pi*x], {x, 0, 1}]; > > So, the above is ZERO when n not equal to m and 1/2 when n=m. hence > orthogonal functions. > > This is what I tried: > > ------ case 1 ------------- > Clear[n, m, x] > r = Integrate[Cos[n*Pi*x]*Cos[m*Pi*x], {x, 0, 1}]; > Assuming[Element[{n, m}, Integers], Simplify[r]] > > Out[167]= 0 > ---------------- > > I was expecting to get a result with conditional on it using Piecewise > notation. > > Then I tried > > ---------case 2 ------------ > Clear[n, m, x] > r = Integrate[Cos[n*Pi*x]*Cos[m*Pi*x], {x, 0, 1}]; > Assuming[Element[{n, m}, Integers] && n != m, Simplify[r]] > > Out[140]= 0 > > Assuming[Element[{n, m}, Integers] && n == m, Simplify[r]] > > Out[184]= Indeterminate > ---------------- > > So, it looks like one has to do the limit by 'hand' to see that for n=m > we get non-zero? > > ------------------- > Clear[n, m, x] > r = Integrate[Cos[n*Pi*x]*Cos[m*Pi*x], {x, 0, 1}]; > Limit[Limit[r, n -> m], m -> 1] > > Out[155]= 1/2 > > Limit[Limit[r, n -> 1], m -> 99] > > Out[187]= 0 > ---------------------------- > > > So, is there a way to get Mathematica to tell me that the integral is > zero for m!=n and 1/2 when n=m? (tried Reduce, Refine). It seems the > problem is that the Integrate is not taking the limit automatically to > determine what happens when n=m? Should it at least in case have told me > that when n!=m it is zero, and when n=m it is Indeterminate? It just > said zero which is not correct when n=m and I did say n,m are integers. > > thanks > --Nasser >