[tex]\boxed{\cos(\pi - x)=-\cos x}\\\\\boxed{\cos x = -\cos (\pi - x)} \\\\ \\ \cos\dfrac{(n-1)\pi}{n} = \cos \Big(\pi - \dfrac{\pi}{n}\Big)\\ \\\cos\dfrac{(n-2)\pi}{n} = \cos \Big(\pi - \dfrac{2\pi}{n}\Big)\\ \\ \text{Fie }\dfrac{\pi}{n} = t \\ \\ S = \cos (t)+\cos (2t)+...+\cos(\pi-2t)+\cos (\pi - t) \\ S = \cos(\pi-t)+\cos(\pi-2t)+...+\cos(2t)+\cos(t) \\ \\\Updownarrow\\ \\S = \cos (t)+\cos (2t)+...+\cos(\pi-2t)+\cos (\pi - t) \\ S = -\cos(t)-\cos (2t)-...-\cos(\pi - 2t)-\cos(\pi-t) \\ \\ 2S = 0+0+...+0+0 \\ \\\Rightarrow \boxed{S = 0}[/tex]