I came across this exercise:
Prove that $$\tan x+2\tan2x+4\tan4x+8\cot8x=\cot x$$
Proving this seems tedious but doable, I think, by exploiting double angle identities several times, and presumably several terms on the left hand side would vanish or otherwise reduce to $\cot x$.
I started to wonder if the pattern holds, and several plots for the first few powers of $2$ seem to suggest so. I thought perhaps it would be easier to prove the more general statement:
For $n\in\{0,1,2,3,\ldots\}$, prove that $$2^{n+1}\cot(2^{n+1}x)+\sum_{k=0}^n2^k\tan(2^kx)=\cot x$$
Presented this way, a proof by induction seems to be the smart way to do it.
Base case: Trivial, we have
$$\tan x+2\cot2x=\frac{\sin x}{\cos x}+\frac{2\cos2x}{\sin2x}=\frac{\cos^2x}{\sin x\cos x}=\cot x$$
Induction hypothesis: Assume that
$$2^{N+1}\cot(2^{N+1}x)+\sum_{k=0}^N2^k\tan(2^kx)=\cot x$$
Inductive step: For $n=N+1$, we have
$$\begin{align*} 2^{N+2}\cot(2^{N+2}x)+\sum_{k=0}^{N+1}2^k\tan(2^kx)&=2^{N+2}\cot(2^{N+2}x)+2^{N+1}\tan(2^{N+1}x)+\sum_{k=0}^N2^k\tan(2^kx)\\[1ex] &=2^{N+2}\cot(2^{N+2}x)+2^{N+1}\tan(2^{N+1}x)-2^{N+1}\cot(2^{N+1}x)+\cot x \end{align*}$$
To complete the proof, we need to show
$$2^{N+2}\cot(2^{N+2}x)+2^{N+1}\tan(2^{N+1}x)-2^{N+1}\cot(2^{N+1}x)=0$$
I noticed that if I ignore the common factor of $2^{N+1}$ and make the substitution $y=2^{N+1}x$, this reduces to the base case,
$$2^{N+1}\left(2\cot2y+\tan y-\cot y\right)=0$$
and this appears to complete the proof, and the original statement is true.
First question: Is the substitution a valid step in proving the identity?
Second question: Is there a nifty way to prove the special case for $n=2$?
Defining $t:=\tan y$, $$2\cot 2y+\tan y-\cot y=\frac{1-t^2}{t}+t-\frac{1}{t}=0.$$This will work for any $y$, so I guess I've answered your questions in reverse order (but to both I say yes).