Calculation of Complex Trigonometric Summation 
Evaluation of $$\sum^{n}_{k=1}\frac{\tan(x/2^k)}{2^{k-1}\cdot \cos(x/2^{k-1})}.$$

Try:Let $$S=\sum^{n}_{k=1}\frac{\sin(x/2^k)}{2^{k-1}\cos(x/2^{k-1})\cdot \cos(x/2^k)}$$
$$S=\sum^{n}_{k=1}\frac{\sin\bigg(\frac{x}{2^{k-1}}-\frac{x}{2^k}\bigg)}{2^{k-1}\cos(x/2^{k-1})\cdot \cos(x/2^k)}$$
So $$S =\sum^{n}_{k=1}\bigg[\frac{1}{2^{k-1}}\tan(x/2^{k-1})-\frac{1}{2^{k-1}}\tan(x/2^k)\bigg]$$
But is is not in Telescopic sum.
I did not understand how to find that sum.   
Could some help me how to sole it, Thanks 
 A: HINT: The trick is to find:
$$f(x)=\sum_{k=1}^{n}\frac{1}{2^{k-1}}{\tan\frac{x}{2^{k-1}}}$$
Introduce function:
$$F(x)=\int_0^x f(x) \ dx=\int_0^x \sum_{k=1}^{n}\frac{1}{2^{k-1}}{\tan\frac{x}{2^{k-1}}}\ dx$$
$$F(x)=\sum_{k=1}^{n}\int_0^x \frac{1}{2^{k-1}}{\tan\frac{x}{2^{k-1}}} \ dx$$
$$F(x)=-\sum_{k=1}^{n}\ln \cos\frac{x}{2^{k-1}}$$
$$F(x)=-\ln\prod_{k=0}^{n-1}\cos\frac{x}{2^{k}}\tag{1}$$
On the other side it's easy to prove that:
$$\sin x = {2^n}\sin \frac{x}{{{2^n}}}\prod\limits_{k = 1}^n {\cos \frac{x}{{{2^k}}}}$$
$$\prod\limits_{k = 1}^n {\cos \frac{x}{{{2^k}}}}=\frac{\sin x}{{2^n}\sin \frac{x}{{{2^n}}}}$$
$$\prod\limits_{k = 0}^n {\cos \frac{x}{{{2^k}}}}=\frac{\sin x \cos x}{{2^n}\sin \frac{x}{{{2^n}}}}$$
$$\prod\limits_{k = 0}^n {\cos \frac{x}{{{2^k}}}}=\frac{\sin 2x}{{2^{n+1}}\sin \frac{x}{{{2^n}}}}$$
$$\prod\limits_{k = 0}^{n-1} {\cos \frac{x}{{{2^k}}}}=\frac{\sin 2x}{{2^{n}}\sin \frac{x}{{{2^{n-1}}}}}\tag{2}$$
Now replace (2) into (1) and you get:
$$F(x)=-\ln\frac{\sin 2x}{{2^{n}}\sin \frac{x}{{{2^{n-1}}}}}$$
The first sum in your final expression is the first derivative:
$$f(x)=F'(x)=\frac{1}{2^{n-1}}\cot\frac{x}{2^{n-1}}-2\cot2x$$
...and you can tackle the second sum by using the result for the first one.
A: Thanks Friends Got it.
$$\sum^{n}_{k=1}\frac{\tan(x/2^k)}{2^{k-1} \cos(x/2^{k-1})} = \sum^{n}_{k=1}\frac{\sin^2(x/2^k)}{2^{k-1}\sin (x/2^k)\cos(x/2^k)\cos(x/2^{k-1})}$$
$$=2\sum^{n}_{k=1}\frac{1-\cos(x/2^{k-1})}{2^{k-1}\sin(x/2^{k-1})\cos(x/2^{k-1})}$$
$$= 2\sum^{n}_{k=1}\bigg[\frac{1}{2^{k-2}\sin(x/2^{k-2})}-\frac{1}{2^{k-1}\sin(x/2^{k-1})}\bigg]$$
$$ = 2\sum^{n}_{k=1}\bigg[\frac{2}{\sin x}-\frac{2}{2^n \sin (2x/2^n)}\bigg].$$
