The simple integral
$$\int_0^b \cos\left(\frac{2\pi m(y-\eta)}{b}\right) \cos\left(\frac{2\pi \eta}{b}\right)\mathrm{d}\eta$$
can be easily evaluated by Mathematica as,
Integrate[
Cos[(2 m π (y - η))/b] Cos[(2 π η)/b], {η, 0, b}]
(* (b m Cos[(m π (b - 2 y))/b] Sin[m π])/((-1 + m^2) π) *)
Due to the $\sin(m \pi)$ term this is zero whenever $m$ is an integer, except when $m^2=1$, when it evaluates to a something different,
Limit[(
b m Cos[(m π (b - 2 y))/b] Sin[m π])/((-1 + m^2) π),
m -> 1]
(* 1/2 b Cos[(2 π y)/b] *)
This much is clear, but when I try to use Assuming on this integral, taking m to be an integer, it does not recognize this case and instead returns simply 0.
Assuming[m ∈ Integers,
Integrate[
Cos[(2*Pi*m*(y - η))/b]*Cos[(2*Pi*η)/b], {η, 0, b}]]
(* 0 *)
the same occurs for Simplify[]
Simplify[Integrate[Cos[(2*Pi*η)/b]*
Cos[(2*Pi*m*(y - η))/b], {η, 0, b}],
Assumptions -> Element[m, Integers]]
(* 0 *)
An even more minimal example of the problem would be
Simplify[ Sin[m π]/((-1 + m^2) π),
Assumptions -> m ∈ Integers]
(* 0 *)
Why is this? Is this a bug?
Interestingly, but somewhat unrelated to the above question, if instead of using Assuming, you provide an Assumptions to Integrate, via Integrate[ Cos[(2 m π (y - η))/b] Cos[(2 π η)/b], {η, 0, b}, Assumptions -> {m ∈ Integers}], it does not make this mistake.
Integrate[ Cos[(2 m π (y - η))/b] Cos[(2 π η)/b], {η, 0, b}, Assumptions -> {m ∈ Integers}]gives a different result thanAssuming[m ∈ Integers, Integrate[ Cos[(2 m π (y - η))/b] Cos[(2 π η)/b], {η, 0, b}]]– Jason B. Mar 09 '16 at 13:26Assuming?" But that's pretty localized, and is related to the question of why you get the right answer using theIntegrate[...., Assumptions->...]form. – Jason B. Mar 09 '16 at 13:31AssumingandAssumptionshas been discussed, too. The integral is generically correct, which is all some solvers, likeSolve, guarantee. HoweverReduce, which is usually rigorous, gets the second wrong (i0equals the 1st integral): (1)Reduce[y == i0 && m \[Element] Integers]vs. (2)Reduce[y == i0 && m \[Element] Integers, y]. – Michael E2 Mar 09 '16 at 14:35