The specific integral I'm working with is the following: $$ \int_0^a\sin(n\pi y/a)\sin(n'\pi y/a) $$ This is supposed to come out to $0$ in the case that $ n \neq n' $ and $\frac{1}{2}a$ in the case that $n= n'$. I can obtain this result sometimes, but the method I'm using currently is giving me a value of $0$ all the time. I'm applying a product-to-sum formula and then integrating. Only resources I've managed to find on this equate the following expression (which is my final result before applying limits of integration) to the Kroenecker delta: $$ \frac{\sin((n-m)\pi)}{(n-m)\pi} - \frac{\sin((n+m)\pi)}{(n+m)\pi} $$
Basically asserting that this evaluates to $1$ when $ n = m$ and to $0$ when $ n \neq m $. I've been staring at this for minutes now and I feel like I'm going insane. It seems obvious to me that if I set $n =m$ the whole thing evaluates to $0$ regardless. We get $\sin(0)$ in the first term and we get $\sin(2n\pi)$ in the second term, which also is $0$ because $n$ is an integer. What am I missing here?