Q:

Proof by mathematical induction, difficulties

Usually, proofs by mathematical induction are not that difficult (at least the ones I encountered so far in my mathematical journey), but I am stuck with this one... Spent at least 2-3 hours on it. I just can't see it... 
$$  \sum_{i=0}^n \frac{1}{2^i}\tan\left(\frac{x}{2^i}\right)=\frac{1}{2^n}\cot\left(\frac{x}{2^n}\right) - 2\cot(2x) , (n = 1,2...)$$
What I tried:
For $n=1$, I expressed the LHS in terms of $\sin$ and $\cos$, but that didn't work... For me, at least... The expression got really complicated, which is a sign that I, probably, did something wrong. 
Then I tried getting that $2\cot(2x)$ from RHS to LHS, but that didn't work also, because the expressions get really complicated... 
Please, give me a detailed answer, and thank you for your time. 

A:

\begin{align}
S_{n-1}+T_{n} &=\frac{1}{2^{n-1}}\cot \left(\frac{x}{2^{n-1}}\right)-2\cot (2x)+\frac{1}{2^{n}}\tan \left(\frac{x}{2^{n}}\right)\\
&\text{let} \, \frac{x}{2^{n}}=y\\
&=\frac{1}{2^{n}}\left( 2\cot (2y)+\tan (y)\right)-2\cot (2x)\\
&=\frac{1}{2^{n}}\left( \frac{2(\cos (2y))}{\sin (2y)}+\tan (y)\right)-2\cot (2x)\\
&=\frac{1}{2^{n}}\left( \frac{2(\cos ^2 (y)-\sin^2 (y))}{2\sin (y)\cos (y)}+\tan (y)\right)-2\cot (2x)\\
&=\frac{1}{2^{n}}\left( \cot(y)-\tan (y)+\tan (y)\right)-2\cot (2x)\\
&=\frac{1}{2^{n}}\left(\cot \left(\frac{1}{2^{n}}\right)\right)-2\cot (2x)\\
&=S_n\\
\end{align}

