I stumbled opon the orthogonality relation $$\int_{-π}^{π}\sin(ax)\cos(bx) \,dx = 0$$
and
$$\int_{-π}^{π}\sin(ax)\sin(bx)\,dx = \int_{-π}^{π}\cos(ax)\cos(bx)\,dx = \begin{cases} π & \text{if } a = b \\ 0 & \text{otherwise} \end{cases}$$
where $a,b \in \mathbb{N}$.
I understand the first one, it's because $\sin(ax)\cos(bx)$ is even, so the areas cancel each other out, but what is the explanation for the second one?
Why does $a$ have to be equal to $b$ and why is the integral $0$ otherwise?
$$I=\int_{-π}^{π}\sin(ax)\sin(bx)\,dx = \int_{-π}^{π}\cos(ax)\cos(bx)\,dx $$
$$I+I=\int_{-\pi}^\pi\cos(a-b)x\ dx=?$$
Check with $a-b=0$ and otherwise?