Integral of difference of sin functions squared is $2\pi$? Can someone explain why this is true?
$$\int_{0}^{2\pi }\left(\sin nx-\sin kx\right)^2dx=2\pi$$ for natural numbers $n,k$ with  $n<k $

What you need here is the following fact: 

For positive integers $a$ and $b$ , we have
  $$
\int_0^{2 \pi} \sin (ax) \cdot \sin (bx) \, dx = 
\begin{cases} 0,  &a \neq b,
\\ \pi, &a = b.
\end{cases}
$$

Proof. Suppose $a \neq b$; then both $a-b$ and $a+b$ are nonzero.
$$
\begin{align*}
\int_0^{2 \pi} \sin (ax) \cdot \sin (bx) \, dx 
&=  \int_0^{2 \pi} \frac{\cos((a-b)x) - \cos ((a+b)x) }{2} \, dx
\\ &=  \frac{1}{2} \left[ \frac{\sin ((a-b)x)}{a-b} - \frac{\sin ((a+b)x)}{a+b} \right]_{x=0}^{x = 2 \pi} 
\\ &= 0,
\end{align*}
$$
since $\sin k\pi = 0$. On the other hand, if $b=a$, then
$$
\begin{align*}
\int_0^{2 \pi} \sin^2 (ax) \, dx 
&=  \int_0^{2 \pi} \frac{1 - \cos (2ax) }{2} \, dx
\\ &=  \frac{1}{2} \left[ x - \frac{\sin (2ax)}{2a} \right]_{x=0}^{x = 2 \pi} 
\\ &= \pi.
\end{align*}
$$

Having established this fact, all you need to do is to expand out the product inside the integral and integrate term by term:
$$
\int_0^{2 \pi} \left( \sin^2 nx + \sin^2 kx - 2 \sin nx \cdot \sin kx \right) \, dx = \pi + \pi - 2 \cdot 0 = 2 \pi.
$$
