Message Boards Message Boards


[✓] Integrate a given symbolic limit of integration?

Posted 11 months ago
4 Replies
4 Total Likes

Hi, I am new to Mathematica. Please advise how I can obtain the symbolic result of the following integral, where n is a positive integer and a is a real number. Thank you.

enter image description here

4 Replies

You can use Simplify:

Simplify[Integrate[(2 x^2)/a Sin[n*Pi*x/a]^2, {x, 0, a}], 
 Element[n, Integers]]

or Assuming:

Assuming[Element[n, Integers], 
 Integrate[(2 x^2)/a Sin[n*Pi*x/a]^2, {x, 0, a}]]

Assumptions inside Integrate has no particular effect:

Integrate[(2 x^2)/a Sin[n*Pi*x/a]^2, {x, 0, a}, 
 Assumptions -> Element[n, Integers]]

With correct syntax:

In[2]:= Integrate[(2 x^2/a) Sin[n Pi x/a]^2, {x, 0, a}]

Out[2]= (a^2 (4 n^3 \[Pi]^3 - 
   6 n \[Pi] Cos[2 n \[Pi]] + (3 - 6 n^2 \[Pi]^2) Sin[
     2 n \[Pi]]))/(12 n^3 \[Pi]^3)
Posted 11 months ago

Thank you very much for your help, now solved. I had placed the assumptions inside the Integrate command [ ] and was getting the error message "Invalid integration variable or limit(s) in n "is a member of" Z". This error message did not clarify the situation for me!

"I had placed the assumptions inside the Integrate command [ ] and ..."

Which raises the question: Why was this code not indicated in the original post? If you do not provide actual code then (i) Nobody can diagnose for possible mistakes and (ii) everyone who wishes to work on the problem has to retype the input for themselves.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract