Find the rank of the following matrix I am thinking on the following problem and have some results but I need a little help. Can some one give me a little hint?
Suppose $a_{ij}= \cos (i +j )$ in the matrix $A$ find $\operatorname{rank}(A)$.
Here is my attempt:
We know that:
 $${\cos(\theta)} = {{e^{i \theta} + e^ {-i \theta} }\over{2}}$$
so we can write :
$$
   A={1 \over 2} \begin{pmatrix}
    e^{2i} + e^ {-2i} & e^{3i} + e^ {-3i} & \cdots & e^{i(2+n-1)} + e^ {-i(2+n-1)} \\
    e^{3i} + e^ {-3i} & e^{4i} + e^ {-4i} & \cdots & e^{i(3+n-1)} + e^ {-i(3+n-1)} \\
    \vdots & \vdots & \ddots  & \vdots \\
    e^{i(2+n-1)} + e^ {-i(2+n-1)} & e^{i(3+n-1)}+ e^ {-i(3+n-1)} & \cdots & e^{i(2+2n-2)}+ e^ {-i(2+2n-2)} \\
    \end{pmatrix}
$$
Now we try to show that $\det(A)=0$ , which show us $\operatorname{rank}(A) < n$. First we show that for odd $n$ , suppose $n=2k+1$, we use middle column of matrix , to change first and last column of the matrix to compute determinant, the middle column will be $(k+1)^\mathrm{th}$ column so suppose :
$$
   C_{k+1}={1 \over 2} \begin{pmatrix}
    e^{i(2+k)} + e^ {-i(2+k)} \\
    e^{i(2+k+1)} + e^ {-i(2+k+1)} \\
    \vdots \\
    e^{i(2+k+n-1)} + e^ {-i(2+k+n-1)} \\
    \end{pmatrix}
$$
Now if we compute $C_{k+1} \times (-e^{-k})+C_1$ we have :
$$
{1 \over 2} \begin{pmatrix}
    e^ {-2i} - e^{-i(2+2k)} \\
    e^ {-3i} - e^{-i(2+2k+1)} \\
    \vdots \\
    e^ {-i(2+n-1)} - e^{-i(2+2k+n-1)} \\
    \end{pmatrix}
$$
and now if we compute $C_{k+1} \times (-e^k) +C_n$ we have :
$$
{1 \over 2} \begin{pmatrix}
    e^{-i(2+2k)} - e^{-2i} \\
    e^{-i(2+2k+1)} - e^{-3i} \\
    \vdots \\
    e^{-i(2+2k+n-1)} - e^{-i(2+n-1)} \\
    \end{pmatrix}
$$
So it is clear if we add $C_{k+1} \times (-e^k) +C_n$ to the $C_1$,  $A$ will be $0$ which mean $\det(A)=0$.
For the case $n$ even, I was able to cease a column with $n-1$ zeroes but I could not show that $\det(A)=0$, but I used mathematica and verified for $n \in \{ 3,4,5 \}$ determinant is $0$, also at first I thought $\operatorname{rank}(A)=n$ but now I know it is not and get a little bit confused, can some one give me a little hint?
Thanks.
 A: Notice that your first matrix shows that $A$ is the sum of two matrices (split each entry at the $+$ sign) that each have rank only $1$! This strongly suggests that $A$ has rank $2$.
I'm sure there's a way to prove this from your representation. However, I suggest using the identity
$$
\cos(i+j) = \cos i \cos j - \sin i \sin j
$$
as a way of working out, for example, the column space of $A$.
A: Let 
$$
A=\begin{pmatrix}
    \cos(2) & \cos(3) & \cdots & \cos(2+n-1) \\
    \cos(3) & \cos(4) & \cdots & \cos(3+n-1) \\
    \vdots & \vdots & \ddots  & \vdots \\
    \cos(2+n-1) & \cos(2+n) & \cdots & \cos(2+n-1+n-1) \\
    \end{pmatrix}
$$
Suppose $V_i$ is the $i$th row of the $A$ , it is clear:
$$
V_i=\begin{pmatrix}
    \cos(2+i-1) & \cos(2+i-1+1) & \cdots & \cos(2+i-1+n-1) \\
\end{pmatrix}
$$
Using $\cos(i+j)=\cos(i)\cos(j)-\sin(i)\sin(j)$ and $\cos(i)-\cos(j)=-2\sin({(i-j) \over 2})\sin({(i+j) \over 2})$ we show that :
$$
V_i-{{V_i-V_{i-2}} \over 2}-V_{i-1}\cos(1)=0
$$
With computin ${{V_i-V_{i-2}} \over 2}$ we have :
$$
{{V_i-V_{i-2}} \over 2}=\begin{pmatrix}
    -\sin(1)\sin(2+i-2) & -\sin(1)\sin(2+i-1) & \cdots & -\sin(1)\sin(2+i-2+n-1) \\
\end{pmatrix}
$$
No using the identities we can write :
$$
V_i=\begin{pmatrix}
    \cos(1)\cos(2+i-2)-\sin(1)\sin(2+i-2) & \cos(1)\cos(2+i-1)-\sin(1)\sin(2+i-1) & \cdots & \cos(1)\cos(2+i-2+n-1)-\sin(1)\sin(2+i-2+n-1) \\
\end{pmatrix}
$$
Thus $V_i-{{V_i-V_{i-2}} \over 2}$ equals to :
$$
V_i=\begin{pmatrix}
    \cos(1)\cos(2+i-2) & \cos(1)\cos(2+i-1) & \cdots & \cos(1)\cos(2+i-2+n-1) \\
\end{pmatrix}
$$
Now it is easy to see that :
$$
V_i-{{V_i-V_{i-2}} \over 2}-V_{i-1}\cos(1)=0
$$
It is show that all the $V_i, 3\le i\le n$ genrated by first two row thus $rank(A)=2$.
