Let $n$ be a positive integer. Evaluate in closed form: $$\begin{align} S_n &= \sum_{k=0}^{n-1}\tan^2{\left( \frac {2k+1}{2n+1} \cdot \frac{\pi}{4} \right)} &+\cot^2{\left( \frac {2k+1}{2n+1} \cdot \frac{\pi}{4} \right)} \end{align}$$
This is an intresting problem which has had me stumped for days. I don't really see complex numbers here so I tried to simplify it using some trig identities and some algebra. $$S_n=\sum_{k=0}^{n-1} \frac{4}{\cos^2\left(\frac{n-k}{2n+1}\cdot \pi\right)}-2$$ After this I tried partial fraction but that feels wrong. Even after further manipulation and pairing terms nothing worthwhile is coming up. The solution key says the answer is $8n^2+6n.$ (although we would not be given the closed form) I also tried induction on it but that didn't work out.
I solved this problem now, but was wondering if there are alternate ways to do it!
Thank you in advance!