determinant of the following matrix I have to find the determinant of the following $n\times n$ matrix in terms of $n$:
$\begin{bmatrix} 2&1&0&0&&&&\\ 1&2&1&0&&&& \\ 0&1&2&1&&&&\\ 0&0&1&2&&&& \\ &&&&\ddots \\&&&&&2&1\\&&&&&1&2\end{bmatrix}$
I found a recursion. Let $d_n$ be the determinant of the $n\times n$ matrix, then $d_{n+1}=2d_n-d_{n-1}$, this can be easily seen. From here I cannot find a explicit formula for the sequence. I need hints. Thanks
 A: If $d_{n+1}=2d_n−d_{n−1}$ then $d_{n+1}-d_n=d_n−d_{n−1}$ so you have an arithmetic progression.  So you just need to calculate the first two terms to know the rest.
$|2|=2$ and $\begin{vmatrix} 2&1\\ 1&2\end{vmatrix} =2^2-1^2=3$ which tell you the starting point and the rate of increase
A: Hint: for $n = 1,2,3,4$ the determinants are $2,3,4,5$.
A: It's nown how solve theses sequences. Wa can associate to them en equation : $t^2-2t+1=0$ hwo have a unique solution $r=1$ , then $d_n=(\alpha + \beta n)r^n $ for some constants $\alpha$ and $\beta$ 
The values of theses constants can be done using $d_1=2$  and $d_2=3$.

In general case let the sequence $(u_n)$ such that $u_{n+2}=au_{n+1} + b u_n$. The space $V$ of soultions is a vector space having dimension $2$. We need find a base for them. We consider a geometric sequence $r^n$ : it's in $V$ if only if : $$(E) \quad r^2-ar-b=0.$$ Let $\Delta=a^2+4b$ the above equation discriminent. 
If $\Delta > 0$ a basis of $V$ is $(r_1^n, r_2^n)$ where $r_1$ and $r_2$ are the real solutions of $(E)$. 
If $\Delta=0$ let $r=\frac a2$ the unique solution of $(E)$. A basis of $V$  is  $(r^n,nr^n$ (this correspond to the above case).
If $\Delta < 0$ let $z=ue^{iv}$  a complexe solution to $(E)$ the $(u^n \cos (nv) , u^n \sin (nv))$  is a basis of $V$
