Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

A Fourier-type integral

By: a guest on Oct 12th, 2011  |  syntax: None  |  size: 0.96 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. (*  http://stackoverflow.com/q/7743774/421225  *)
  2.  
  3. In[1]:= $Version
  4.  
  5. Out[1]= "8.0 for Linux x86 (64-bit) (February 23, 2011)"
  6.  
  7. In[2]:= res = Integrate[
  8.   Cos[(Pi x)/2]^2 Cos[((2 n + 1) Pi x)/2] Cos[((2 m + 1) Pi x)/2], {x, -1, 1},
  9.    Assumptions -> Element[{n, m}, Integers]]
  10.  
  11. Out[2]= ((-(1 + 2*n))*(3*m*(1 + m) + n + n^2)*Cos[n*Pi]*
  12.     Sin[m*Pi] + (1 + 2*m)*(m + m^2 + 3*n*(1 + n))*Cos[m*Pi]*Sin[n*Pi])/
  13.    (2*(-1 + m - n)*(m - n)*(1 + m - n)*(m + n)*(1 + m + n)*(2 + m + n)*Pi)
  14.  
  15. In[3]:= nonzero = Flatten@Solve[Denominator[res] == 0, m]
  16.  
  17. Out[3]= {m -> -2 - n, m -> -1 - n, m -> -1 + n, m -> -n, m -> n, m -> 1 + n}
  18.  
  19. In[4]:= Table[Simplify[Limit[res, lim], Element[{m, n}, Integers]], {lim, nonzero}]
  20.  
  21. Out[4]= {1/4, 1/2, 1/4, 1/4, 1/2, 1/4}
  22.  
  23. The documentation claims that
  24. "The result of Reduce[expr,vars] always describes exactly the same mathematical set as expr."
  25. However:
  26.  
  27. In[5]:= Reduce[res == 0, {m, n}, Integers]
  28.  
  29. Out[5]= Element[m | n, Integers]
  30.