Sum of $x^k \cos(kx)$

70 Views Asked by At

Is there a nice way to obtain a the following summation? $$\sum_{k=0}^{n}x^k \cos kx$$ I have tried evaluating the real part of the sum $1+z+z^2 +...+z^n $ where $z=x(\cos x + i \sin x)$ Though realizing it and doing the algebra wasn't so neat, I eventually obtained an expression: $$\frac{x^{n+2} \cos (nx)-x^{n+1} \cos\bigl( (n+1)x \bigr)-x \cos x+1}{x^2-2x \cos x+1} $$ But I'm just wondering, is there a nicer way to do this / a nicer expression? Thanks