I've found online that $\int_0^{\frac{\pi}{2}}\cos^{2n}{(x)}\,dx = \frac{\pi}{2^{2n-1}} \binom{2n}{n}$. I've tried it on my own and I've got $\int_0^{\frac{\pi}{2}}\cos^{2n}{x}\,dx = \frac{\pi}{2^{n+1}} \frac{(2n-1)!!}{n!}$, where the double factorial is the product of all odd numbers from $1$ up to $2n-1$.
To compute the integral, I've integrated by parts splitting $\cos^{2n}{(x)}$ in $\cos^{2n-1}{(x)}$ and $\cos{(x)}$, then iterating, obtaining the following:
$I_n = \int_0^{\frac{\pi}{2}}\cos^{2n}{(x)}\,dx = (2n-1)\int_0^{\frac{\pi}{2}}(\cos^{2n-2}{(x)} - \cos^{2n}{(x)})\,dx = (2n-1)(I_{n-1} - I_n)$
$\Rightarrow I_n = \frac{2n-1}{2n}I_{n-1} \Rightarrow I_n = \frac{(2n-1)!!}{2^n n!} I_0 = \frac{(2n-1)!!}{2^n n!} \int_0^{\frac{\pi}{2}}\,dx = \frac{\pi}{2^{n+1}} \frac{(2n-1)!!}{n!}$
Unfortunately for me, this formula is wrong, but I can't quite figure out where I'm going wrong.
Could somebody please help me find the mistake?