# Complex numbers De Moivre's theorem

1. Jan 21, 2017

### iDimension

1. The problem statement, all variables and given/known data
If
$$C = 1+cos\theta+...+cos(n-1)\theta,$$
$$S = sin\theta+...+sin(n-1)\theta,$$

prove that
$$C=\frac{sin\frac{n\theta}{2}}{sin\frac{\theta}{2}} cos\frac{(n-1)\theta}{2} \enspace and \enspace S = \frac{sin\frac{n\theta}{2}}{sin\frac{\theta}{2}}sin\frac{(n-1)\theta}{2}$$

2. Relevant equations

3. The attempt at a solution
$$C+iS = 1+(cos\theta+isin\theta)+...+(cos(n-1)\theta+isin(n-1)\theta)$$
$$=1+e^{i\theta}+...+e^{i(n-1)\theta}$$
$$=1+z+...+z^{n-1}, \enspace where \enspace z=e^{i\theta}$$
$$=\frac{1-z^n}{1-z}, \enspace if \enspace z\neq1$$
$$=\frac{1-e^{in\theta}}{1-e^{i\theta}}=\frac{e^\frac{in\theta}{2}(e^\frac{-in\theta}{2}-e^\frac{in\theta}{2})}{e\frac{i\theta}{2}(e\frac{-i\theta}{2}-e\frac{i\theta}{2})}$$
$$=e^{i(n-1)\frac{\theta}{2}}\frac{sin\frac{n\theta}{2}}{sin\frac{\theta}{2}}$$
$$=(cos(n-1)\frac{\theta}{2}+isin(n-1)\frac{\theta}{2})\frac{sin\frac{n\theta}{2}}{sin\frac{\theta}{2}}$$

Is this correct? I'm not sure about the final solution. The final result is that the real parts equal the imaginary parts?

2. Jan 21, 2017

### ehild

Yes, your derivation is correct, but the the real part is not equal to the imaginary part.

3. Jan 21, 2017

### FactChecker

Correct. But I have an important word-smithing note:
Throughout the entire post, you should put parentheses around all the angles that you take sins and cos of.
Not
$$=cos(n-1)\frac{\theta}{2}$$
but
$$=cos((n-1)\frac{\theta}{2})$$

4. Jan 21, 2017

### Ray Vickson

Also: do not write $sin \theta$ and $cos \theta$ (ugly and hard to read); instead, write $\sin \theta$ and $\cos \theta$ (easy to read and looks good). To do it, just put a "\" before your sin or cos, so say "\sin" instead of "sin", etc. This holds as well for all the other trig functions, as well as 'log', 'ln', 'lim', 'max', 'min', 'exp' and several others.