# Sum evaluation help

1. Jul 2, 2006

hi,
i am trying to evaluate the following
$$A=\sum_{m=-N}^{N} \cos(\frac{mk\pi}{N+1})\cos(\frac{mj\pi}{N+1})$$

to give you an idea of the sort of answer i am after i present to you the following
$$\sum_{m=-N}^{N} \sin(\frac{mk\pi}{N+1})\sin(\frac{mj\pi}{N+1})=(N+1)\delta_{k,j}$$

hopefully there are some knowledgable people that can shed some light on the matter
thanks.

i come up with the following
A=2N+1 if k=j=0
A=N if k=j, k not equal to 0
A=1 if (k+j) is even
A=-1 if (k+j) is odd
but i am not sure how to get this into one nice function so to speak like the example i gave above

Last edited: Jul 2, 2006
2. Jul 2, 2006

### 0rthodontist

The statements you have at the end can't all be true. k + j is always either even or odd, but A is not always -1 or 1.

Since the example is so similar to what you have, you may be able to use trigonometric identities to write your problem in terms of sums in the example form and sums that you know. For example
cos x cos y = sin x sin y + cos (x + y), so if you can sum the case when j or k = 0, you can find A.

3. Jul 2, 2006

### 0rthodontist

In fact, summing cos(x + y) is in a standard form for a recurrence relation. You have
(with $$\theta = \frac{(k + j) \pi}{N+1}$$)
$$a_n = a_{n-1}+2cos(\theta n)$$
And $$a_0 = 1$$
The homogenous solution to this is of the form $$C_0$$, and the particular solution is of the form $$C_1 sin(\theta n) + C_2 cos(\theta n)$$
So the solution to your whole problem, N, is
$$(N+1)\delta_{k,j} + a_N$$