Prove that $$J_n=\int_0^\frac{\pi}{4}\frac{\cos (n-2)x}{\cos^nx}dx=\frac{1}{n-1}2^\frac{n-1}{2}\sin\frac{(n-1)\pi}{4}$$
For $n=2$, it is OK. For general $n$, it seems impossible by integration by parts. Any other method?
When I calculate an integral $I_n=\int_0^\frac{\pi}{4}\frac{\cos nx}{\cos^nx}dx$, we find $I_n/2^{n-1}-I_{n-1}/2^{n-1}=-1/2^{n-1}J_n$. So we need to find the $J_n$, as the problem states.
The proof of $I_n/2^{n-1}-I_{n-1}/2^{n-1}=-1/2^{n-1}J_n$ is as follows.
\begin{align} I_n/2^{n-1}-I_{n-1}/2^{n-1} &=\frac{1}{2^{n-1}} \int_0^\frac{\pi}{4}\left(\frac{\cos nx}{\cos^nx}-\frac{2\cos(n-1)x}{\cos^{n-1}x}\right)dx\\ &=\frac{1}{2^{n-1}}\int_0^\frac{\pi}{4}\frac{\cos[(n-1)x+x]-2\cos(n-1)x\cos x}{\cos^nx}dx\\ &=-\frac{1}{2^{n-1}}\int_0^\frac{\pi}{4}\frac{\cos(n-2)x}{\cos^nx}dx =-1/2^{n-1}J_n \end{align}