for an assignment in numerical analysis, I need to find the eigenvalues of a matrix with values only in the diagonal, upper diagonal and lower diagonal. I guess there is an easy formula for this sort of Matrices, Specifically if all the values are similar.
If not in the general, so specifically:
$A(jj) = 1-k$, $A(j-1, j ) = A(j, j-1) = A(1,N) = A(N,1) = k$ $\forall j \in \{ 1 ... N\} $
Your matrix is circulant (not tri-diagonal). If we write $$ T=\left(\begin{array}{rrrrrr} 0&1&0&0&\cdots&0\\ 0&0&1&0&\cdots&0\\ 0&0&0&1&\cdots&0\\ \vdots&\vdots&\vdots&\vdots&\ddots&\vdots\\ 0&0&0&0&\cdots&1\\ 1&0&0&0&\cdots&0 \end{array}\right) $$ for the matrix with ones one step above the diagonal and at bottom left, and zeros elsewhere, then your matrix is $$ A=(1-k)I+kT+kT^{N-1}, $$ where we can, if we so desire, us $T^{-1}$ in place of $T^{N-1}$, as $T^N=I$.
A general circulant matrix would be one of the form $p(T)$, where $p(T)=\sum_{i=0}^{N-1}p_iT^i$ is any polynomial of degree $<N$: $$ p(T)=\left(\begin{array}{cccccc} p_0&p_1&p_2&p_3&\cdots&p_{N-1}\\ p_{N-1}&p_0&p_1&p_2&\cdots&p_{N-2}\\ p_{N-2}&p_{N-1}&p_0&p_1&\cdots&p_{N-3}\\ \vdots&\vdots&\vdots&\vdots&\ddots&\vdots\\ p_2&p_3&p_4&p_5&\cdots&p_1\\ p_1&p_2&p_3&p_4&\cdots&p_0 \end{array}\right). $$
The eigenvalues of circulant matrices are fully known. The eigenvalues of $T$ are the $N$th roots of unity, $\zeta_N^\ell=e^{2\pi i k/N}$ for $\ell=0,1,\ldots,N-1$, and the eigenvalues of $p(T)$ are then simply $\lambda_\ell=p(\zeta_N^\ell), \ell=0,1,\ldots,N-1$. This is because powers of $T$ all commute with each other, and they are all simultaneously diagonalizable, so we can just add the eigenvalues of the terms together. They share the eigenvectors with $T$, but I leave it to you as an exercise to find them. You may(?) have seen the eigenvectors in a context of discrete Fourier Transforms, if that happens to be in your repertoire.
The determinant of your matrix is the product of its eigenvalues $$ \begin{aligned} \det A&=\prod_{\ell=0}^{N-1}(1+k[\zeta_N^\ell-1+\zeta_N^{-\ell}])\\ &=\prod_{\ell=0}^{N-1}(1-k+2k\cos\frac{2\pi\ell}N). \end{aligned} $$