Infinite Series $\sum\limits_{n=1}^{\infty}\frac{1}{4^n\cos^2\frac{x}{2^n}}$
Often when $\sin(x)$ and $x$ appear in a formula such as this, it is based on the fact that $$ \lim_{a\to0}\frac{\sin(ax)}{a}=x\tag{1} $$ Since the summands are $\dfrac{4^{-k}}{\cos^2(2^{-k}x)}$ , it appears that an identity involving a double angle formula is being exploited. Therefore, with an eye toward a telescoping sum, I started with $$ \begin{align} \frac4{\sin^2(2x)}-\frac1{\sin^2(x)} &=\frac{4-4\cos^2(x)}{4\sin^2(x)\cos^2(x)}\\ &=\frac{4\sin^2(x)}{4\sin^2(x)\cos^2(x)}\\ &=\frac1{\cos^2(x)}\tag{2} \end{align} $$ Substitute $x\mapsto 2^{-k}x$ and multiply by $4^{-k}$ and sum (and telescope) $$ \begin{align} \sum_{k=1}^n\frac{4^{-k}}{\cos^2(2^{-k}x)} &=\sum_{k=1}^n\left(\frac{4^{-k+1}}{\sin^2(2^{-k+1}x)}-\frac{4^{-k}}{\sin^2(2^{-k}x)}\right)\\ &=\frac1{\sin^2(x)}-\frac{4^{-n}}{\sin^2(2^{-n}x)}\\ &\to\frac1{\sin^2(x)}-\frac1{x^2}\tag{3} \end{align} $$ since, by $(1)$, $$ \lim_{n\to\infty}\frac{4^{-n}}{\sin^2(2^{-n}x)}=\frac1{x^2}\tag{4} $$
Viète's formula gives:
$$\prod_{k\geq 1} \cos\left(\frac{x}{2^k}\right)=\frac{\sin x}{x}\Rightarrow \prod_{k\geq 1} \sec\left(\frac{x}{2^k}\right)=\frac{x}{\sin x}\Rightarrow\sum_{k\geq 1} \ln \sec\left(\frac{x}{2^k}\right)=\ln x-\ln \sin x$$
Differentiate twice and you have your result.
Since $$1 = \sin^2(\theta) + \cos^2(\theta)$$ dividing by $\sin^2(\theta) \cos^2(\theta)$, we get that $$4\csc^2(2 \theta) = \csc^2(\theta) + \sec^2(\theta)$$ Replace $\theta$ as $\dfrac{x}{2^n}$, we get that $$\sec^2\left(\dfrac{x}{2^{n+1}}\right) = 4\csc^2\left(\dfrac{x}{2^n}\right) - \csc^2\left(\dfrac{x}{2^{n+1}}\right)$$ Divding by $4^{n+1}$, we get that $$\dfrac{\sec^2\left(\dfrac{x}{2^{n+1}}\right)}{4^{n+1}} = \dfrac{\csc^2\left(\dfrac{x}{2^n}\right)}{4^n} - \dfrac{\csc^2\left(\dfrac{x}{2^{n+1}}\right)}{4^{n+1}}$$ Now telescopic summation gives us $$\sum_{n=0}^{N} \dfrac{\sec^2\left(\dfrac{x}{2^{n+1}}\right)}{4^{n+1}} = \csc^2\left(x\right) - \dfrac{\csc^2\left(\dfrac{x}{2^{N+1}}\right)}{4^{N+1}}$$ Now letting $N \to \infty$, we get what you want.