## Monday Math 158

Find a non-summation expression for the value of the sum $\cos{x}+2\cos{2x}+3\cos{3x}+\cdots+n\cos{nx}$.

To find the sum $S(x,n)=\sum_{k=1}^{n}k\cos{kx}$, we first note that $\frac{d}{dx}\sin{kx}=k\cos{kx}$, so that our sum $S(x,n)=\frac{d}{dx}\sum_{k=1}^n\sin{kx}$. Next, we look back at this post, where it is demonstrated that $\left(\sin\frac{\pi}n\right)\left(\sum_{i=1}^{m}\sin\frac{(k-m+2i-1)\pi}n\right)=\frac12\left[\cos\left(\frac{k\pi}n-\frac{m\pi}n\right)-\cos\left(\frac{k\pi}n+\frac{m\pi}n\right)\right]$

Using a similar method, we see that $\sin\left(\frac{x}2\right)\left(\sum_{k=1}^{n}\sin{kx}\right)=\frac12\left(\cos\left(\frac{x}{2}\right)-\cos\left(\frac{(2n+1)x}{2}\right)\right)$

And thus, for $\sin\left(\frac{x}2\right)\neq{0}$,
$S(x,n)=\frac{d}{dx}\sum_{k=1}^n\sin{kx}=\frac{d}{dx}\left[\frac12\left(\cos\left(\frac{x}{2}\right)-\cos\left(\frac{(2n+1)x}{2}\right)\right)\right]$
which, using the quotient rule, gives us
$\begin{array}{rcl}\sum_{k=1}^{n}k\cos{kx}&=&\frac{\left[-\frac12\sin\left(\frac{x}2\right)+\frac{2n+1}2\sin\left(\frac{(2n+1)x}2\right)\right]\sin\left(\frac{x}2\right)-\left[\cos\left(\frac{x}2\right)-\cos\left(\frac{(2n+1)x}2\right)\right]\frac12\cos\left(\frac{x}2\right)}{2\sin^2\left(\frac{x}2\right)}\\&=&\frac{-\sin^2\left(\frac{x}2\right)+(2n+1)\sin\left(\frac{(2n+1)x}2\right)\sin\left(\frac{x}2\right)-\cos^2\left(\frac{x}2\right)+\cos\left(\frac{(2n+1)x}2\right)\cos\left(\frac{x}2\right)}{4\sin^2\left(\frac{x}2\right)}\\&=&\frac{(2n+1)\sin\left(\frac{(2n+1)x}2\right)\sin\left(\frac{x}2\right)+\cos\left(\frac{(2n+1)x}2\right)\cos\left(\frac{x}2\right)-1}{4\sin^2\left(\frac{x}2\right)}\end{array}$

However, we can express this more compactly using trigonometric identities. With the product-to-sum formulas, we see:
$\sin\left(\frac{(2n+1)x}2\right)\sin\left(\frac{x}2\right)=\frac12\left[\cos(nx)-\cos\left((n+1)x\right)\right]$
and
$\cos\left(\frac{(2n+1)x}2\right)\cos\left(\frac{x}2\right)=\frac12\left[\cos\left((n+1)x\right)+\cos(nx)\right]$

Substituting these into the numerator, and expanding, we see
$\begin{array}{rcl}\sum_{k=1}^{n}k\cos{kx}&=&\frac{\frac{2n+1}2\cos(nx)-\frac{2n+1}2\cos\left((n+1)x\right)+\frac12\cos\left((n+1)x\right)+\frac12\cos(nx)-1}{4\sin^2\left(\frac{x}2\right)}\\&=&\frac{(n+1)\cos(nx)-n\cos\left((n+1)x\right)-1}{4\sin^2\left(\frac{x}2\right)}\end{array}$
which is much more compact.

Lastly, one could also use the half-angle identity $2\sin^2\left(\frac{x}2\right)=(1-\cos{x})$ to give equivalent form
$\sum_{k=1}^{n}k\cos{kx}=\frac{(n+1)\cos(nx)-n\cos\left((n+1)x\right)-1}{2\left(1-\cos{x}\right)}$

Now, $\sin\left(\frac{x}2\right)={0}$ when x is an integer multiple of 2π. For these values, since n is an integer, $\cos(nx)=\cos\left((n+1)x\right)=1$, and so our expression has the indeterminate form 0/0. Thus, we can apply l’Hôpital’s rule (twice) for the limit as x approaches zero (and, thus due to the period, any of the other singularities):
$\begin{array}{rcl}\lim_{x\to{0}}\frac{(n+1)\cos(nx)-n\cos\left((n+1)x\right)-1}{4\sin^2\left(\frac{x}2\right)}&=&\frac{\frac{d}{dx}\left[(n+1)\cos(nx)-n\cos\left((n+1)x\right)-1\right]}{\frac{d}{dx}\left[4\sin^2\left(\frac{x}2\right)\right]}\\&=&\frac{-n(n+1)\sin(nx)+n(n+1)\sin\left((n+1)x\right)}{4\sin\left(\frac{x}2\right)\cos\left(\frac{x}2\right)}\\&=&\frac{n(n+1)\left[\sin\left((n+1)x\right)-\sin(nx)\right]}{2\sin{x}}\\&=&\frac{n(n+1)\frac{d}{dx}\left[\sin\left((n+1)x\right)-\sin(nx)\right]}{2\frac{d}{dx}\sin{x}}\\&=&\frac{n(n+1)\left[(n+1)\cos\left((n+1)x\right)-n\cos(nx)\right]}{2\cos{x}}\\&=&\frac{n(n+1)\left[(n+1)-n\right]}{2}\\\lim_{x\to0}\frac{(n+1)\cos(nx)-n\cos\left((n+1)x\right)-1}{4\sin^2\left(\frac{x}2\right)}&=&\frac{n(n+1)}{2}\end{array}$

so the singularities are removable, with a limit which matches the value expected from the sum:
for x=0, $\sum_{k=1}^{n}k\cos\left(k\cdot{0}\right)=\sum_{k=1}^{n}k=\frac{n(n+1)}{2}$.

### 2 Responses to “Monday Math 158”

1. jackaljim Says:

Reblogged this on Math Snippets and commented:
Nice Blog! 🙂 Check out new posts – very interesting Geometry and algebraic insights – every Monday! 🙂

2. jackaljim Says:

Hello! 🙂 I am just starting out with blogs (in particular Math ones)… Are there any tips you could share for posting such awesome posts??? 🙂