# Compute $\sum_{k=0}^n\cos(k\theta)\cos^k(\theta)$

I want to compute $$S=\sum_{k=0}^n\cos(k\theta)\cos^k(\theta)$$ for real $$\theta$$ and positive integer $$n$$. I tried to solve this using Complex Numbers.

Let $$C=\sum\limits_{k=0}^n\sin(k\theta)\cos^k\theta$$

$$\Rightarrow S+iC=\sum\limits_{k=0}^n\cos^k\theta\left[\cos(k\theta)+i\sin(k\theta)\right]$$

$$=\sum\limits_{k=0}^ne^{ik\theta}\cos^k(\theta)=\sum\limits_{k=0}^n\left[e^{i\theta}\cos\theta\right]^k$$

using geometric progression formula $$a=1,r=e^{i\theta}\cos\theta$$

$$\Rightarrow S+iC=\dfrac{e^{i(n+1)\theta}\cos^{n+1}\theta-1}{e^{i\theta}\cos\theta-1}$$

At this point I tried many times to covert this into $$a+ib$$ form

this way i can let

$$S=\sum_{k=0}^n\cos(k\theta)\cos^k(\theta)=a$$

by Complex Numbers theorem

But seems like I am just stuck. Can someone help?

• As pointed out in a comment to your previous question math.stackexchange.com/q/4658732/42969, this is a special case of math.stackexchange.com/q/3419462/305862. Mar 15 at 18:58
• Re-posting of your yesterday question (math.stackexchange.com/q/4658732/305862) (which has been close by lack of personal work) to which I had given a thorough track. Imagine everybody reposts his questions ... Mar 15 at 19:00
• I’m voting to close this question because it is a re-posting of a previous answer (without mentionning it) Mar 15 at 19:01

You got stuck at the point

$$S=\Re\left(\dfrac{e^{i(n+1)\theta}\cos^{n+1}\theta-1}{e^{i\theta}\cos\theta-1}\right)$$

$$\dfrac{e^{ix}a-1}{e^{iy}b-1}=\dfrac{e^{ix}a-1}{e^{iy}b-1}\cdot \frac{e^{-iy}b-1}{e^{-iy}b-1}=\frac{(e^{ix}a-1)(e^{-iy}b-1)}{b^2+1-2b\cos(y)}$$

The numerator here is

$$(e^{ix}a-1)(e^{-iy}b-1)=e^{i(x-y)}ab-e^{ix}a-e^{-iy}b+1$$

The real part of this is

$$\cos(x-y)ab-\cos(x)a-\cos(-y)b+1$$

Putting this all together we have

$$S=\frac{\cos(x-y)ab-\cos(x)a-\cos(y)b+1}{b^2+1-2b\cos(y)}$$

$$=\frac{\cos(n\theta)\cos^{n+2}(\theta)-\cos((n+1)\theta)\cos^{n+1}(\theta)-\cos^2(\theta)+1}{\sin^2(\theta)}$$

• \$(e^{ix}a-1)(e^{-iy}b-1)\ne e^{i(x-y)}ab-e^{ix}-e^{-iy}+1.$$S=\frac{\cos(n\theta)\cos^{n+2}\theta-\cos^{n+1}\theta\cos((n+1)\theta)-\cos^2\theta+1}{\sin^2\theta}.$$ Mar 15 at 19:39
• You're correct, fixed Mar 16 at 5:09

How do you convert any formula of the form $$\frac{a+bi}{c+di}$$ into $$u+vi$$ where $$u,v$$ are real? You multiply the numerator and the denominator by the complex conjugate of the denominator, $$c-di.$$

From your $$S+iC,$$ we multiplying top and bottom by the complex conjugate $$e^{-i\theta}\cos\theta-1.$$

You will get, in the denominator: \begin{align}(e^{i\theta}\cos\theta-1)(e^{-i\theta}\cos\theta-1)&=\cos^{2}\theta -\cos \theta\left(e^{i\theta}+e^{-i\theta}\right)+1\\&=1-\cos^2\theta\\&=\sin^2\theta.\end{align}

I'll leave the numerator to you.