1. ## Cauchy integral formula

Okay this has been driving me crazy and I cant find my error.

Okay here it is.

$\int_{0}^{\pi}\sin^{2n}(\theta)d\theta ,n \in \mathbb{Z}^{+}$

So first Since sine is periodic and it is squared

$2\int_{0}^{\pi}\sin^{2n}(\theta)d\theta=\int_{0}^{ 2\pi}\sin^{2n}(\theta)d\theta$

So if I parameterize the unit circle in in the complex plane with

$z=e^{i\theta} \implies dz=ie^{i\theta}d\theta \iff \frac{dz}{iz}=d\theta$

Since $\sin(\theta)=\frac{e^{i\theta}-e^{i\theta}}{2i} \implies \sin^{2n}(\theta)=\left( \frac{e^{i\theta}-e^{i\theta}}{2i} \right)^{2n}$

Now if I sub z in I get

$\sin^{2n}(z)=\frac{(z-z^{-1})^{2n}}{(2i)^{2n}}$

$\int_{\Gamma}\frac{(z-z^{-1})^{2n}}{(2i)^{2n}}\frac{dz}{iz}=\frac{1}{i\cdot 2^{2n}}\int_{\Gamma}\left(z- \frac{1}{z}\right)^{2n}\frac{dz}{z}=$

$\frac{1}{i\cdot 2^{2n}}\int_{\Gamma}\frac{(z^2-1)^{2n}}{z^{2n}}\frac{dz}{z} = \frac{1}{i\cdot 2^{2n}}\int_{\Gamma}\frac{(z^2-1)^{2n}}{z^{2n+1}}dz$

Here I use the binomial theorem to expand the numerator

$(z^2-1)^{2n}=\sum_{k=0}^{2n}\binom{2n}{k}(z^2)^{2n-k}(-1)^{k}$

$\frac{1}{i\cdot 2^{2n}}\int_{\Gamma}\frac{1}{z^{2n+1}}\left(\sum_{ k=0}^{2n}\binom{2n}{k}(z^2)^{2n-k}(-1)^{k} \right)dz=$

$\frac{1}{i\cdot 2^{2n}}\int_{\Gamma}\left(\sum_{k=0}^{2n}\binom{2n }{k}(z)^{2n-2k-1}(-1)^{k} \right)dz=$

$\frac{1}{i\cdot 2^{2n}} \left(\sum_{k=0}^{2n}\binom{2n}{k}(-1)^{k} \right)\int_{\Gamma}(z)^{2n-2k-1} dz=$

Now by the cauchy integral theorem the only non zero integral is when k=n and it gives

$\int_{\Gamma}\frac{1}{z}dz =2\pi i$

$\frac{1}{i\cdot 2^{2n}} \left(\sum_{k=0}^{2n}\binom{2n}{k}(-1)^{k} \right)\int_{\Gamma}(z)^{2n-2k-1} dz=\frac{1}{i\cdot 2^{2n}}\binom{2n}{n}(-1)^{n}(2\pi i)=\frac{2\pi (2n)!}{(n!)^22^{2n}}(-1)^{n}$

So finally we have

$2\int_{0}^{\pi}\sin^{2n}(\theta)d\theta=\frac{2\pi (2n)!}{(n!)^22^{2n}}(-1)^{n}$

$\int_{0}^{\pi}\sin^{2n}(\theta)d\theta=\frac{\pi (2n)!}{(n!)^22^{2n}}(-1)^{n}$

So I checked this formula numerically and it works except for the $(-1)^{n}$

I know that is can't be correct becuase the integrand is always non negative.

Thanks for looking

2. Okay I see it

$\int_{\Gamma}\frac{(z-z^{-1})^{2n}}{(2i)^{2n}}\frac{dz}{iz}=\frac{1}{i\cdot 2^{2n}}\int_{\Gamma}\left(z- \frac{1}{z}\right)^{2n}\frac{dz}{z}=$

When I factored this out I made a mistake

$\frac{1}{(2i)^{2n}}=\frac{1}{2^{2n}(i)^{2n}}=\frac {1}{2^{2n}[(i)^2]^n}=\frac{1}{2^{2n}(-1)^n}$

I made that same mistake 3 times and never saw it

3. I was going to say that .(not really)

What course is this ?

4. Originally Posted by TheEmptySet
Okay this has been driving me crazy and I cant find my error.

Okay here it is.

$\int_{0}^{\pi}\sin^{2n}(\theta)d\theta ,n \in \mathbb{Z}^{+}$

So first Since sine is periodic and it is squared

$2\int_{0}^{\pi}\sin^{2n}(\theta)d\theta=\int_{0}^{ 2\pi}\sin^{2n}(\theta)d\theta$

So if I parameterize the unit circle in in the complex plane with

$z=e^{i\theta} \implies dz=ie^{i\theta}d\theta \iff \frac{dz}{iz}=d\theta$

Since $\sin(\theta)=\frac{e^{i\theta}-e^{i\theta}}{2i} \implies \sin^{2n}(\theta)=\left( \frac{e^{i\theta}-e^{i\theta}}{2i} \right)^{2n}$

Now if I sub z in I get

$\sin^{2n}(z)=\frac{(z-z^{-1})^{2n}}{(2i)^{2n}}$

$\int_{\Gamma}\frac{(z-z^{-1})^{2n}}{(2i)^{2n}}\frac{dz}{iz}=\frac{1}{i\cdot 2^{2n}}\int_{\Gamma}\left(z- \frac{1}{z}\right)^{2n}\frac{dz}{z}=$

$\frac{1}{i\cdot 2^{2n}}\int_{\Gamma}\frac{(z^2-1)^{2n}}{z^{2n}}\frac{dz}{z} = \frac{1}{i\cdot 2^{2n}}\int_{\Gamma}\frac{(z^2-1)^{2n}}{z^{2n+1}}dz$

Here I use the binomial theorem to expand the numerator

$(z^2-1)^{2n}=\sum_{k=0}^{2n}\binom{2n}{k}(z^2)^{2n-k}(-1)^{k}$

$\frac{1}{i\cdot 2^{2n}}\int_{\Gamma}\frac{1}{z^{2n+1}}\left(\sum_{ k=0}^{2n}\binom{2n}{k}(z^2)^{2n-k}(-1)^{k} \right)dz=$

$\frac{1}{i\cdot 2^{2n}}\int_{\Gamma}\left(\sum_{k=0}^{2n}\binom{2n }{k}(z)^{2n-2k-1}(-1)^{k} \right)dz=$

$\frac{1}{i\cdot 2^{2n}} \left(\sum_{k=0}^{2n}\binom{2n}{k}(-1)^{k} \right)\int_{\Gamma}(z)^{2n-2k-1} dz=$

Now by the cauchy integral theorem the only non zero integral is when k=n and it gives

$\int_{\Gamma}\frac{1}{z}dz =2\pi i$

$\frac{1}{i\cdot 2^{2n}} \left(\sum_{k=0}^{2n}\binom{2n}{k}(-1)^{k} \right)\int_{\Gamma}(z)^{2n-2k-1} dz=\frac{1}{i\cdot 2^{2n}}\binom{2n}{n}(-1)^{n}(2\pi i)=\frac{2\pi (2n)!}{(n!)^22^{2n}}(-1)^{n}$

So finally we have

$2\int_{0}^{\pi}\sin^{2n}(\theta)d\theta=\frac{2\pi (2n)!}{(n!)^22^{2n}}(-1)^{n}$

$\int_{0}^{\pi}\sin^{2n}(\theta)d\theta=\frac{\pi (2n)!}{(n!)^22^{2n}}(-1)^{n}$

So I checked this formula numerically and it works except for the $(-1)^{n}$

I know that is can't be correct becuase the integrand is always non negative.

Thanks for looking
*Sigh* If only all question posters showed their working and what they tried ....

5. Originally Posted by TheEmptySet
$\frac{1}{i\cdot 2^{2n}} \left(\sum_{k=0}^{2n}\binom{2n}{k}(-1)^{k} \right)\int_{\Gamma}(z)^{2n-2k-1} dz=$

Now by the cauchy integral theorem the only non zero integral is when k=n and it gives

$\int_{\Gamma}\frac{1}{z}dz =2\pi i$
Hi

I saw your mistake but you saw it before me

Just a question anyway : I would say that the Cauchy integral theorem tells that the integrals are zero for $0 \leq k \leq n-1$ ; the integrals for $n+1 \leq k \leq 2n$ are also zero but not for the same reason. Or could you explain how you can use the Cauchy integral theorem for $n+1 \leq k \leq 2n$ ?

6. Originally Posted by running-gag
Hi

I saw your mistake but you saw it before me

Just a question anyway : I would say that the Cauchy integral theorem tells that the integrals are zero for $0 \leq k \leq n-1$ ; the integrals for $n+1 \leq k \leq 2n$ are also zero but not for the same reason. Or could you explain how you can use the Cauchy integral theorem for $n+1 \leq k \leq 2n$ ?
You are absolutely correct they are zero, but not by the cauchy integral fromula.

They are zero becuase they are entire functions on $\mathbb{C}$ so the integral around any close path must be zero.

Thanks

7. If you want more methods for calculating this integral, it is referred as "Wallis sine formula"