I was asked to find the sum of $$\sum_{r=1}^n \dfrac{\tan \dfrac{x}{2^r}}{2^{r-1}\cos\dfrac{x}{2^{r-1}}}$$
I proceeded by breaking $\tan x$ into $\sin x$ and $\cos x$ and writing numerator as follows $$\sin\left(\frac{x}{2^{r-1}}-\frac{x}{2^r} \right)$$ then by opening brackets and simplifying I got $$\frac{1}{2^{r-1}}\left(\tan\frac{x}{2^{r-1}}-\tan\frac{x}{2^r}\right)$$ But I couldn't proceed from here.
Any help will be appreciated
Start with $$\cos(x/2) \cos(x/2^2) \cos(x/2^3)....\cos(x/2^n)= \frac{\sin x}{2^n\sin(x/2^{n})}$$ Take $\ln$ of both sides, then $$\sum_{r=1}^{n} \ln \cos (x/2^{r}) = -\ln \sin (x/2^{n})+\ln \sin x-n\ln 2$$ D.w.r.t x and get $$\sum_{r=1}^{n} \frac{1}{2^{r}} \tan (x/2^{r})=\frac{1}{2^{n}} \cot (x/ 2^{n})- \cot x=g(x) ~~~~(1)$$ Similarly $$\cos x \cos(x/2) \cos(x/2^2) \cos(x/2^3)....\cos(x/2^{n-1})= \frac{\sin 2x}{2^n\sin(x/2^{n-1})}$$ Take $\ln$ of both sides, then $$\sum_{r=1}^{n} \ln \cos (x/2^{r}) = -\ln \sin (x/2^{n-1})+\ln \sin 2x-n\ln 2$$ D.w.r.t x and get $$\sum_{r=1}^{n} \frac{1}{2^{r-1}} \tan (x/2^{r-1})=\frac{1}{2^{n-1}} \cot (x/ 2^{n-1})- 2\cot 2 x=f(x) ~~~~(2)$$ The required sum is $$ S=\sum_{r=1}^{n} \frac{1}{2^{r-1}} [\tan (x/2^{r-1})- \tan (x/2^r)] = f(x)-2g(x)$$ $$\Rightarrow S =\frac{1}{2^{n-1}} \left( \cot (\frac{x}{2^{n-1}})- \cot(\frac{x}{2^n}) \right) -2 (\cot 2 x -\cot x) $$ $$ \Rightarrow S=-2^{1-n} \csc(x2^{1-n})+2\csc(2x).$$