# Trouble with Mathematica Integration and using Assumptions

Posted 9 years ago
4175 Views
|
3 Replies
|
0 Total Likes
|
 Hi All,I am having trouble here getting Mathematica to Integrate a simple function where inside the cosine function, n is just a simple integer.Here is what I have tried. Integrate[Exp[a*x]*Cos[n*x], {x, -\[Pi], \[Pi]}, Assumptions -> n \[Element] Integers] and I get out (2 (n Cosh[a \[Pi]] Sin[n \[Pi]] + a Cos[n \[Pi]] Sinh[a \[Pi]]))/(a^2 + n^2) But since n is an integer, the Sin(n [Pi]) term should be zero but for some reason I cannot get Mathematica to go there. It is like it is ignoring the Assumption that n are Integers.Anyone know what I am doing wrong? Thanks in advance :)
3 Replies
Sort By:
Posted 9 years ago
 Yes, it fixes it, but I would have expected the Assumptions inside of Integrate to have taken care of it too... I think though that the assumptions did not limit Integrate from getting a correct answer: the answer is not restricted in this case by the n \[Element] Integers assumption and hence is correct.
Posted 9 years ago
 Try FullSimplify[ Integrate[Exp[a x] Cos[n*x], {x, -\[Pi], \[Pi]}, Assumptions -> n \[Element] Integers], n \[Element] Integers] 
Posted 9 years ago
 That did the trick. Thanks so much.
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.