The following two codes give conflicting answers, when integrating $\sin(k\pi x)\sin(2n\pi x)$ from $0$ to $1$, where both $k$ and $n$ are positive integers.
Code 1 assumes that $k$,$n$ are independent integers:
Integrate[
Sin[k*Pi*x]*Sin[2*n*Pi*x], {x, 0, 1},
Assumptions -> {k ∈ Integers, n ∈ Integers}]
The result given by mathematica is 0.
Code 2 assumes that $k=2n$ and $n$ is integer:
Integrate[
Sin[k*Pi*x]*Sin[2*n*Pi*x], {x, 0, 1},
Assumptions -> {n ∈ Integers,k = 2*n}]
The result is 1/2.
The result of Code 2 should be included in that of Code 1. It seems that Code 1 doesn't manage to give a generaluniversal result. Isn't Code 1 supposed to give a general result?Isn't Code 1 supposed to give a universal result? if not, how to get one?