Prove that $\frac{1}{2} + \sum_{k=1}^n\cos(kx) = \frac{\sin(n+\frac{1}{2})x}{2\sin(\frac{1}{2}x)}$ for any $x\in\Bbb R$

calculusinductionreal-analysissequences-and-seriessolution-verification

So I'd like to prove that for any $x\in\Bbb R$ the formula
$$
\frac{1}{2} + \sum_{k=1}^n\cos(kx) = \frac{\sin\Big((n+\frac{1}{2})x\Big)}{2\sin\frac{x}{2}}
$$

holds.

First of all we observe that the quantity $2\sin\frac x2$ is zero if and only if $x=2h\pi$ for any $h\in\Bbb Z$ so that to prove the formula when $x=2h\pi$ for any $h\in\Bbb Z$ we calculate the limit of the function $\frac{\sin\left(n+\frac{1}{2}\right)x}{2\sin\frac{x}{2}}$ as $x$ approaches $2h\pi$.

Previously we remember that if $k$ is even, then
$$
\sin x=\sin(x-k\pi)
$$

for any $x\in\Bbb R$ whereas if $k$ is odd then
$$
\sin x=-\sin(x-k\pi)
$$

for any $x\in\Bbb R$; moreover we remember that the product of two odd number is odd whereas the product of an odd number with a even number is even so that if $h\in\Bbb Z$ is odd then the number $(2n+1)h$ is odd whereas it is even when $h$ is even. So if $h\in\Bbb Z$ is even it follows that
$$
\sin\biggl(\Big(n+\frac 12\Big)x\biggl)=\sin\biggl(\big(2n+1\big)\frac x2\biggl)=
\sin\biggl(\big(2n+1\big)\frac x 2-\big(2n+1\big)h\pi\biggl)\,\text{and}\,\sin\frac x2=\sin\biggl(\frac x 2-h\pi\biggl)
$$

for any $x\in\Bbb R$ whereas if $h$ is odd then it follows that
$$
\sin\biggl(\Big(n+\frac 12\Big)x\biggl)=\sin\biggl(\big(2n+1\big)\frac x2\biggl)=-\sin\biggl(\big(2n+1\big)\frac x 2-\big(2n+1\big)h\pi\biggl)\,\text{and}\,\sin\frac x2=-\sin\biggl(\frac x 2-h\pi\biggl)
$$


for any $x\in\Bbb R$.

So we conclude that
$$
\lim_{x\rightarrow 2h\pi} \frac{\sin\Big((n+\frac{1}{2})x\Big)}{2\sin\frac{x}{2}}=\\
\lim_{x\rightarrow 2h\pi} \frac{\sin\Big((2n+1)\frac x2\Big)}{2\sin\frac{x}{2}}=\\
\lim_{x\rightarrow 2h\pi} \frac{\sin\Big((2n+1)\frac x2-(2n+1)h\pi\Big)}{2\sin\Big(\frac{x}{2}-h\pi\Big)}=\\
\lim_{x\rightarrow 2h\pi} \frac 1 2\cdot\frac{\sin\biggl((2n+1)\Big(\frac x2-h\pi\Big)\biggl)}{(2n+1)\Big(\frac x 2-h\pi\Big)}\cdot\frac{\frac x 2-h\pi}{\sin\Big(\frac x2-h\pi\Big)}\cdot(2n+1)=\\
\frac 1 2\cdot(2n+1)=n+\frac 1 2
$$


Now we remember that if $m\in\Bbb Z$ is an even number then
$$
\cos(m\pi)=1
$$

so that finally
$$
\lim_{x\rightarrow 2h\pi} \frac{\sin\Big((n+\frac{1}{2})x\Big)}{2\sin\frac{x}{2}}=\frac 12 +n=\frac 12+\sum_{k=1}^n\cos\big(k(2h\pi)\big)
$$

and this proves that the formula effectively holds when $x=2h\pi$ for any $h\in\Bbb Z$, provided that the argumentations I gave are correct.

So now we have to prove the formula when $x\neq2h\pi$ for any $h\in\Bbb Z$.

First of all we remember that the $4$-th prosthaphaeresis formula guarantees that
$$
\sin\alpha-\sin\beta=2\sin\frac{\alpha-\beta}2\cos\frac{\alpha+\beta}2
$$

for any $\alpha,\beta\in\Bbb R$ so that we can conclude that
$$
\sin\biggl(\Big(k+\frac 12\Big)x\biggl)-\sin\biggl(\Big(k-\frac 12\Big)x\biggl)=\\
\sin\Big(\frac{2kx+x}x\Big)-\sin\Big(\frac{2kx-x}2\Big)=\\
2\sin\Biggl(\frac{\frac{2kx+x}2-\frac{2kx-x}2}2\Biggl)\cos\Biggl(\frac{\frac{2kx+x}2+\frac{2kx-x}2}2\Biggl)=\\
2\sin\Biggl(\frac{(2kx+x)-(2kx-x)}4\Biggl)\cos\Biggl(\frac{(2kx+x)+(2kx-x)}4\Biggl)=\\
2\sin\frac x 2\cos kx
$$


for any $x\in\Bbb R$. So using this result I tried to prove the statement by induction. So let's prove the formula for $k=1$.

So for $k=1$ the above identity implies that
$$
\sin\biggl(\big(1+\frac 12\big)x\biggl)-\sin\frac x 2=\\
\sin\biggl(\Big(1+\frac 12\Big)\biggl)-\sin\biggl(\Big(1-\frac 1 2\Big)x\biggl)=2\sin\frac x 2\cos x
$$

so that it follows that
$$
\frac{\sin\biggl(\Big(1+\frac12\Big)x\biggl)}{2\sin\frac x2}-\frac 12=
\cos x\Rightarrow\frac 12+\cos x=
\frac{\sin\biggl(\Big(1+\frac12\Big)x\biggl)}{2\sin\frac x2}
$$

since $x\neq2h\pi$ for any $h\in\Bbb Z$.

So we assume that the formula holds for an arbitrary $n$ and thus we want to prove that it holds for $(n+1)$.

Well unfortuantely I am not able to show that the formula holds for $(n+1)$ when it holds for $n$ so I thought to post an another question where I ask to do it; Here I ask if the argumentations I gave for the case $x=2h\pi$ are correct. So could someone help me, please?

Best Answer

Consider, when $x\neq m.2\pi, m\in\mathbb{Z}$, $$\sum_{k=1}^{n}e^{ikx}=\frac{e^{ix}(e^{inx}-1)}{e^{ix}-1}$$(being the sum of a geometric series whose ratio is $\neq 1$) $$=\frac{e^{i\frac12x}e^{inx}-e^{i\frac12x}}{e^{i\frac12x}-e^{-i\frac12x}}$$ $$=\frac{e^{ix(n+\frac12)}-e^{i\frac12x}}{2i\sin\frac x2}$$

Considering the real part of both sides, $$\sum_{k=1}^{n}\cos(kx)=\frac{\sin(n+\frac12)x-\sin(\frac x2)}{2\sin(\frac x2)},$$ and the result follows immediately.

For $x=m.2\pi$, the proof follows the same lines as you have already done.