Good evening everybody,
the appended file shows an irritating (at least for me) behavior.
Simplifying the integral of the title under the assumption that m and n are integers one gets 0.
This is obviously wrong for m==n ! Is there a reason?
Thank you, Gentlemen
for the fast and insightful response. Particularly that of Illian made me better prepared for similar situations.
This is largely a duplicate of a thread from last year.
Also, your sol2 seems to use the assumptions after the actual integration. This seems to work better:
Integrate[Sin[n*Pi*x]*Sin[m*Pi*x], {x, 0, 1}, Assumptions -> {m \[Element] Integers, n \[Element] Integers, m == n}]
There is some discussion of this topic in the documentation
http://reference.wolfram.com/language/tutorial/GenericAndNonGenericCases.html