Message Boards Message Boards

3 Replies
0 Total Likes
View groups...
Share this post:

Trouble with Mathematica Integration and using Assumptions

Posted 10 years ago

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 :)

POSTED BY: larry davis
3 Replies

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 BY: David Reiss


 Integrate[Exp[a x] Cos[n*x], {x, -\[Pi], \[Pi]}, 
  Assumptions -> n \[Element] Integers], n \[Element] Integers]
POSTED BY: David Reiss
Posted 10 years ago

That did the trick. Thanks so much.

POSTED BY: larry davis
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract