# How can I express the sum of $\sin a+\sin2a+\sin3a+\cdots+\sin(n-1)a$?

I want to sum up the partials of a harmonic series, how do I do it?

If I was using the 'Lagrange trigonometric identity to solve this problem', how would I plot it on Wolfram mathematica (using which input)?

• A harmonic series ($\sum \frac1n$) or a sum of sines, $\sum \sin (ka)$? – Daniel Fischer Oct 29 '13 at 19:32
• A sum of sines as described in the question: sina+sin2a+sin3a+...+(n-1)a – Alex Oct 29 '13 at 19:33
• I asked because the question body speaks of a harmonic series, that is something different. – Daniel Fischer Oct 29 '13 at 19:34
• Basically, I want to show that when a string on a piano is plucked, not only the fundamental frequency of the string plucked eg. 'a' for example resonates, but also multiples of that frequency, such as the octave above....and then I wanted to add these sin waves and create a function from there... – Alex Oct 29 '13 at 19:35
• Harmonic in music $\neq$ harmonic in mathematics. Not entirely unrelated, but different. Do you already know Euler's formulae relating the exponential function and the trigonometric functions? – Daniel Fischer Oct 29 '13 at 19:38

Using De Moivre's formula, you find that

$$\sin(na)=\mathrm{Im}\left(\left(e^{ia}\right)^n\right)$$

for every real number $a$.

Then, using the linearity of the imaginary part, your sum is clearly equal to the imaginary part of another much simpler sum :

$$\sin(a)+\ldots+\sin((n-1)a)=\mathrm{Im}\left(e^{ia}\right)+\ldots+\mathrm{Im}\left(\left(e^{ia}\right)^{n-1}\right)=\mathrm{Im}\left(e^{ia}+\ldots+\left(e^{ia}\right)^{n-1}\right)$$

If $a$ is an integer multiple of $2\pi$, then your sum is clearly equal to $0$.

If $a$ is not an integer multiple of $2\pi$, then $r=e^{ia}\neq 1$, and the terms of the sum $e^{ia}+\ldots+\left(e^{ia}\right)^{n-1}$ are just the terms of the geometric sequence

$$r,r^2,\ldots,r^{n-1}$$

Now, you should remember that if $(u_n)_{n\geqslant 0}$ is a geometric sequence with ratio $r\neq 1$, then the sum of the $N$ first terms of this sequence is :

$$u_0\frac{r^N-1}{r-1}$$

In our case, we have $u_0=r$ and $N=n-1$, so :

$$e^{ia}+\ldots+\left(e^{ia}\right)^{n-1}=e^{ia}\frac{e^{i(n-1)a}-1}{e^{ia}-1}$$

Now, we'll use this useful formula :

$$\forall \alpha\in\mathbb R,\ e^{i\alpha}-1=2ie^{i\frac\alpha 2}\sin\left(\frac\alpha 2\right)$$

(To prove it, just use the fact that $\sin(\theta)=\dfrac{e^{i\theta}-e^{-i\theta}}{2i}$ for all real number $\theta$ and develop the RHS).

Using this formula on both the numerator and denominator of our latest identity, we get :

$$e^{ia}+\ldots+\left(e^{ia}\right)^{n-1}=e^{ia}\frac{2ie^{i\frac{N-1}2a}\sin\left(\frac{N-1}2a\right)}{2ie^{i\frac a2}\sin\left(\frac a2\right)}=e^{i\frac N2a}\frac{\sin\left(\frac{N-1}2a\right)}{\sin\left(\frac a2\right)}$$

The imaginary part of the RHS is just the sum you wanted :

$$\sin(a)+\ldots+\sin((n-1)a)=\sin\left(\frac N2a\right)\frac{\sin\left(\frac{N-1}2a\right)}{\sin\left(\frac a2\right)}\quad (a\notin 2\pi\mathbb Z)$$

They are called Lagrange's trigonometric identities

$$\sum_{n=1}^N \sin (na)= \frac{1}{2}\cot\frac{a}{2}-\frac{\cos(N+\frac{1}{2})a}{2\sin\frac{a}{2}}$$

$$\sum_{n=1}^N \cos(na)= -\frac{1}{2}+\frac{\sin(N+\frac{1}{2})a}{2\sin\frac{a}{2}}$$

• that looks very good, thank you! – Alex Oct 29 '13 at 19:50
• Do you have a proof for that? – Alex Oct 29 '13 at 19:51

Hint: Multiple by $\sin\frac{a}{2}$ and use the equality $\sin x\sin y=\frac{1}{2}(\cos(x-y)-\cos(x+y))$:

$$\sin\frac{a}{2}(\sin a+\sin 2a+\ldots)= \frac{1}{2}(\cos\frac{a}{2}-\cos\frac{3a}{2}+\cos\frac{3a}{2}-\cos\frac{5a}{2}+\ldots)$$ etc.

• What do you mean by that? Could you show an example? – Alex Oct 29 '13 at 19:42
• I corrected and added the answer. – Boris Novikov Oct 29 '13 at 19:53
• is it true that all the -cos(3a/2)+cos(3a/2) cancel? – Alex Oct 30 '13 at 12:18
• Yes, of course, except the first and the last summands. – Boris Novikov Oct 30 '13 at 13:33
• That's a very nice trick! – Prism Nov 11 '13 at 19:18

$\sin a + \sin2a+\cdots+\sin((n-1)a)$ is the imaginary part of $e^{ia}+e^{2ia}+e^{3ia}+\cdots+e^{(n-1)ia}$. That is a finite geometric series whose sum is expressible in closed form. It will be $\dfrac{\text{something}}{1-e^{ia}}$. Multiplying the top and bottom both by $e^{-ia/2}$ will make it

$$\frac{\text{something}}{e^{-ia/2}-e^{ia/2}} = 2i\cdot \frac{\text{something}}{\sin(a/2)}.$$

Once it's in that form you only have to look at the numerator to find the imaginary part.

Use the formula $$2\sin(x)\sin(y)= \cos(x-y)-\cos(x+y)$$

Then

$$2\sin(\frac{a}{2})\sin(a)=\cos(\frac{a}{2})-\cos(\frac{3a}{2}) \\ 2\sin(\frac{a}{2})\sin(2a)=\cos(\frac{3a}{2})-\cos(\frac{5a}{2}) \\ 2\sin(\frac{a}{2})\sin(3a)=\cos(\frac{5a}{2})-\cos(\frac{7a}{2}) \\ ....\\ 2\sin(\frac{a}{2})\sin(na)=\cos(\frac{(2n-1)a}{2})-\cos(\frac{(2n+1)a}{2}) \\$$

• @Alex All these equalities. Note that on the RHS you get a telescopic sum, while on the LHS $2 \sin(\frac{a}{2})$ is a common factor. – N. S. Oct 29 '13 at 22:46
• @Alex no it doesn't. The last term is just the relation with $x=\frac{a}{2}$ and $y=na$. – N. S. Oct 29 '13 at 22:49