Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

The following integral gives the correct result

Assuming[{n, m} \[Element] Integers, 
2/W Sin[(n Pi z)/W] D[Sin[(m Pi z)/W], {z}], {z, 0, W}] // 

(2 (-1+(-1)^(m+n)) m n)/((m^2-n^2) W)

However, the following expression returns 0, which is, i.g., wrong (for m=n=1 this should give 1)

Assuming[{n, m} \[Element] Integers, 
Integrate[2/W Sin[(n Pi z)/W] D[Sin[(m Pi z)/W], {z, 0}], {z, 0, W}]//

Edit: To make the disaster clearer:

Assuming[{m, n} \[Element] Integers, 
Integrate[2 Sin[n \[Pi] z] Sin[m \[Pi] z], {z, 0, 1}]//Simplify]

returns 0!

share|improve this question
Some references: 1 2 –  Daniel Lichtblau May 26 at 15:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.