# Determinant of the following n×n matrix: [duplicate]

Determinant of the following $n \times n$ matrix: $$\begin{pmatrix} 2\cos \theta& 1 & 0 & \ldots & \ldots & 0 \\ 1 & 2\cos \theta & 1 & \ddots & & \vdots \\ 0 & 1& 2\cos \theta & \ddots & \ddots & \vdots \\ \vdots & \ddots & \ddots & \ddots & \ddots & 0 \\ \vdots & & \ddots & \ddots & 2\cos \theta & 1 \\ 0 & \ldots & \ldots & 0 & 1 & 2\cos \theta\\ \end{pmatrix}.$$

Letting given matrix determinant as $D_n$, I find a relation $D_n-2\cos \theta D_{n-1}+D_{n-2}=0$, but after that how I calculate $D_n?$ Please help.

## marked as duplicate by Hans Lundmark, The Phenotype, g.kov, GNUSupporter 8964民主女神 地下教會, Parcly TaxelMar 13 '18 at 11:49

• You should solve the equation $\lambda^2 - 2 \cos \theta \lambda + 1 = 0$ find $\lambda_1, \lambda_2$ and then your solution will be $D_n = C_1 \lambda_1^n + C_2 \lambda_2^n,$ $\ C_1, C_2$ you should find from initial conditions – D F Mar 13 '18 at 8:31
• @DF ... assuming $\cos\theta\ne1$. – user228113 Mar 13 '18 at 8:36
• @G.Sassatelli of course, if $\cos \theta = 1$ then $D_n = (C_1 + C_2 n)$ – D F Mar 13 '18 at 8:38