I need to calculate that $\int_{0}^{\pi} D_{n}(y)dy=\frac{1}{2}$ with $D_{n}(y)= \frac{1}{2\pi}\frac{\sin((n+\frac{1}{2})y)}{\sin(\frac{y}{2})}$ from Dirichlet.
Now I tried to do this with the known that $D_{n}(y)=\frac{1}{2\pi}\sum_{k=-1}^{n}e^{iky}$.
I tried to things but I never become 1/2.
- First I tried to solve the somation and then integrate: $\int_{0}^{\pi} D_{n}(y)dy=\int_{0}^{\pi} \frac{1}{2\pi}\sum_{k=-1}^{n}e^{iky}dy=\int_{0}^{\pi} \frac{1}{2\pi}(\frac{e^{-niy}-e^{iy(n+1)}}{1-e^{iy}})dy$. This integral doesn't converges so I did something wrong but I don't know what?
- Second I tried to switch the integral and the sommetion and then solve it: $\int_{0}^{\pi} D_{n}(y)dy=\int_{0}^{\pi} \frac{1}{2\pi}\sum_{k=-1}^{n}e^{iky}dy=\int_{0}^{\pi} D_{n}(y)dy=\frac{1}{2\pi}\sum_{k=-1}^{n}\int_{0}^{\pi}e^{iky}dy=\frac{1}{2\pi}\sum_{k=-1}^{n}\frac{1}{ik}(1-e^{-\pi i k})$. But this sometion will give $i\infty -i \infty$ so this doesn't work eather.
Can someone eplain me what I do wrong and how I can fix it?
You're using a wrong definition of the Dirichlet kernel. The proper one is
$$D_n(x) = \frac{1}{2\pi}\sum_{k=-n}^n e^{ikx} = \frac{1}{2\pi}\frac{\sin \left(\frac{(n+1)x}{2}\right)}{\sin \left(\frac{x}{2}\right)}.$$
Based on that you have by switching $\int$ and $\sum$
$$\int_0^{2\pi}D_n(x) = \int_0^{2\pi}\frac{1}{2\pi}\sum_{k=-n}^n e^{ikx} = 1.$$
as $\int_{0}^{2\pi}e^{ikx}=0 $ for $k\neq 0$ integer.
And as $D_n$ is even
$$\int_0^{\pi}D_n(x) = \frac{1}{2}.$$