NOTE: Please do not provide any sort of a solution to what I am trying to do, as this ia an assessed question. Just let me know whether or not it is a valid use and explain please.
I am trying to show that the following holds: $$\int_{-\infty}^{\infty}\frac{2}{L}\sin{\frac{n\pi x}{L}}\cos{\frac{m\pi x}{L}}dx=0$$ where $n,m\in\mathbb{N}^+$ and $n\neq m$. After integrating by parts I end up with $$\int_{-\infty}^{\infty}\frac{2}{L}\sin{\frac{n\pi x}{L}}\sin{\frac{m\pi x}{L}}dx=0.$$ This is where I decide to use the delta function, but I am unsure whether it is a valid use. I let $$\int_{-\infty}^{\infty}\sin{\frac{n\pi x}{L}}\sin{\frac{m\pi x}{L}}=\delta_{nm}$$ and thus it would follow that, since $m\neq n$, $$\int_{-\infty}^{\infty}\sin{\frac{n\pi x}{L}}\sin{\frac{m\pi x}{L}}=\delta_{nm}=0.$$ Does it make sense to use the delta function in such a way? Or is it being equal to $\delta_{nm}$ a consequence of the fact that it is equal to zero?
This does not have anything to do with delta function, as it was written before.
Why do you need a by parts integration? Wouldn't it be more convenient to work with a starting problem, but rewrite it in Euler-like form?