Here is an integrand
integrand = Cos[x] Sin[x]^2 Cos[n x];
One can see it is not zere for all integer positive n as follows
Table[Integrate[integrand, {x, 0, 2 Pi}], {n, 1, 5}]

However, when called like this Integrate gives zero
Assuming[Element[n, Integers] && n > 0,Integrate[integrand, {x, 0, 2 Pi}]]

This seems to be related to Mathematica giving a general result, rather than specific result? But I think it is a little misleading. Since the result is not valid for all n>0.
Should Mathmatica have given zero above? Is there a way to tell Mathematica not to do this? Does your version of Mathematica give zero as well?
Mathematica 11.2 on windows.
0is correct answer here. – Nasser Mar 02 '18 at 00:54Integrateshould not return zero in these cases. Better to return no answer than an answer which is not valid as in this case. – Nasser Mar 03 '18 at 00:11FourierCosCoefficient[]:FourierCosCoefficient[Cos[x] Sin[x]^2, x, n, FourierParameters -> {-1, 1}]returns0without any indication that something's amiss, even if one obtains different results for $n=1$ and $n=3$. – J. M.'s missing motivation Mar 04 '18 at 15:54Integrate[integrand, {x, 0, 2 Pi}]should not evaluate, but thatAssuming[Element[n, Integers] && n > 0,Integrate[integrand, {x, 0, 2 Pi}]]returning zero is the problem. zero result is simply wrong. I used this wrong result in my other calculations and wasted long time to find what was wrong. That is why it is better not to return result, than returning wrong result. If you thinkAssuming[Element[n, Integers] && n > 0,Integrate[integrand, {x, 0, 2 Pi}]]returning zero is valid, I'd like to learn how that can be justified. – Nasser Mar 04 '18 at 18:48SimplifythanIntegrateper se, the latter just happens to use the former. `In[324]:= Assuming[Element[n, Integers], Simplify[Sin[n*Pi]/n]]Out[324]= 0
– Daniel Lichtblau Mar 04 '18 at 20:40(3) I'm pretty sure I've commented in past about the issues involved in usingAssumingvsAssumptions->...and also the issue of making discrete-valuedElement` assumptions. This is an area where improvements might be made, but that's by no means a given.