Prove that $$\sum_{n=1}^{\infty}\frac{1}{n^2}=\frac{\pi^2}{6}$$
I have actually got the HINT for this Proof from a very nice book:
The HINT i started with is:
$$\frac{1}{\sin^2 x}=\frac{1}{4\sin^2\left(\frac{x}{2}\right)\cos^2\left(\frac{x}{2}\right)}=\frac{1}{4}\left(\frac{1}{\sin^2\left(\frac{x}{2}\right)}+\frac{1}{\sin^2\left(\frac{x+\pi}{2}\right)}\right) \tag{1}$$
Now we have:
$$1=\frac{1}{\sin^2\left(\frac{\pi}{2}\right)}=\frac{1}{4}\left(\frac{1}{\sin^2\left(\frac{\pi}{4}\right)}+\frac{1}{\sin^2\left(\frac{3\pi}{4}\right)}\right)$$
Applying $(1)$ Repeatedly we get
$$1=\frac{1}{16}\left (\frac{1}{\sin^2\left(\frac{\pi}{8}\right)}+\frac{1}{\sin^2\left(\frac{3\pi}{8}\right)}+\frac{1}{\sin^2\left(\frac{5\pi}{8}\right)}+\frac{1}{\sin^2\left(\frac{7\pi}{8}\right)}\right)$$
So Generalizing we get:
$$1=\frac{1}{4^n}\sum_{k=0}^{2^n-1} \frac{1}{\sin^2\left(\frac{(2k+1)\pi}{2^{n+1}}\right)}$$
EDIT:
Ok let me explain the next step the author of the book has followed: $$1=\frac{1}{4^n}\sum_{k=0}^{2^n-1} \frac{1}{\sin^2\left(\frac{(2k+1)\pi}{2^{n+1}}\right)}=\frac{2}{4^n}\sum_{k=0}^{2^{n-1}-1} \frac{1}{\sin^2\left(\frac{(2k+1)\pi}{2^{n+1}}\right)}$$
My doubt is how a factor of $2$ came outside and why the upper limit has changed?
This answer is limited to the question asked in the OP's edit. The puzzling step taken there uses the fact that $\sin(\pi-x)=\sin x$ and may best be explained with the example
$$\begin{align} {1\over16}\left({1\over\sin^2\left(\pi\over8\right)}+{1\over\sin^2\left(3\pi\over8\right)}+{1\over\sin^2\left(5\pi\over8\right)}+{1\over\sin^2\left(7\pi\over8\right)} \right) &={1\over16}\left({1\over\sin^2\left(\pi\over8\right)}+{1\over\sin^2\left(3\pi\over8\right)}+{1\over\sin^2\left(3\pi\over8\right)}+{1\over\sin^2\left(\pi\over8\right)} \right)\\ &={2\over16}\left({1\over\sin^2\left(\pi\over8\right)}+{1\over\sin^2\left(3\pi\over8\right)} \right) \end{align}$$