Hello Everybody,
this is a rather interesting problem that Dimitrios raised here. My first suspicion was that it is related to the rather agressive transformation that FullSimplify attempts but it turns out that Simplify also faisl to generate the condition. So let us dig a little bit deeper. I The first step is to do the integration exactly like Dimitrios has done it already
int = Integrate[
2/L*Sin[(2*\[Pi]*q*x)/L + \[Phi]1]*Sin[(2*\[Pi]*q*x)/L + \[Phi]2]*
Sin[(2*\[Pi]*qt*x)/L + \[Phi]3], {x, 0, L}];
Mathematica solves the integral symbolically and correctly. However, if the expression is simplified acknowledging that both q and qt are integers, FullSimplify and Simplify fail to generate conditions for which the integral does not evaluate to zero. So I do not agree to Hendrik's statement that the conditions should be applied to the integrand nor to Gianluca's statement that the integration should generate a condition. To my understanding the conditions that are generated by integration deals with convergence with the integral which is not an issue here. The condition comes into play once the condition that both q and qt should be integers which restricts the general solution of the integral (up to here I just repeated the stuff Dimitrios has already stated).
So what can be done? From my knowledge the tool of choice to deal with this kind of problems in Mathematica is Reduce. Reduce does not work on expressions, but requires equations or inequalities as input. So we assign the expression produced by integration to a variable var.
sol1 = Reduce[int == var, var]
Reduce has now generated a condition for which the integral will evaluate to some lengthy expression . Introducing the conditions that q and qt are Integers shows now that the integral evaluates to zero for the condition qt ( -4 q^2 + qt^2) != 0
Simplify[var /. Flatten[Solve[sol1 , var]], {q, qt} \[Element]
Integers]
Now we look at the cases not covered by the condition . The simplest way to do this is to eliminate var form the equation .
Eliminate[sol1, var]
Next we evaluate the integral expression for each of these conditions
Simplify[Limit[int, qt -> 0], q \[Element] Integers]
Simplify[Limit[int, qt -> -2 q], q \[Element] Integers]
Simplify[Limit[int, qt -> 2 q], q \[Element] Integers]
So we have obtained now 4 solutions for the integral depending on the conditions on q and qt . Two were already covered by Dimitrios.
Please let me know if any of you agrees or whether there is some misconcept in my statements.
Best regards,
Michael