Establishing a trigonometric identity for $n\in\mathbb{N}$ The original problem was showing that this infinite sum converges to $\tan\theta$:
$$\sum_{n=1}^\infty \frac{\tan\dfrac{\theta}{2^n}}{\cos\dfrac{\theta}{2^{n-1}}}$$
One hint was given: the series telescopes. I figured this meant I could factorize the denominator if I just apply some identities, and indeed it does:
$$\frac{\tan\dfrac{\theta}{2^n}}{\cos\dfrac{\theta}{2^{n-1}}}=\frac{\sec\dfrac{\theta}{2^n}}{\cos\dfrac{\theta}{2^n}-\sin\dfrac{\theta}{2^n}}-\frac{\sec\dfrac{\theta}{2^n}}{\cos\dfrac{\theta}{2^n}+\sin\dfrac{\theta}{2^n}}$$
I plugged in the first few $n$ to see if a pattern emerges, and indeed it does. Mathematica gives me this output:

This gives me the identity,
$$\dfrac{1}{\cos\dfrac{\theta}{2^n}-\sin\dfrac{\theta}{2^n}}+\dfrac{1}{\cos\dfrac{\theta}{2^n}+\sin\dfrac{\theta}{2^n}}=\dfrac{\sin\left(1-\dfrac{1}{2^n}\right)\theta}{\cos \dfrac{\theta}{2^n}}$$
where $x=\theta$, and this converges to $\tan \theta$ as $k\to\infty$. So I'm curious, how would I come to derive something like this?
A simpler approach was expected, I'll have to check to see if I still remember it. Something to do with a tangent identity, if I recall correctly. If I find it, I'll include it in an edit.

hint
Call $\tan{\frac{\theta}{2^n}}=t_n$ and use the identity $\cos{\frac{\theta}{2^{n-1}}}=\frac{1-t_n^2}{1+t_n^2}$ the term of the series is
$$\frac{t_n(1+t_n^2)}{1-t_n^2}$$
And you decompose that into a sum of rational fractions
