= Solution
The <characteristic equation of a linear recurrence> is
$$
r^2-2\cos\theta\,r+1=0,
\qquad r=e^{\pm i\theta}.
$$
For $0<\theta<\pi$, these <characteristic roots> are distinct. Two real solutions of the <second-order difference equation> are $\cos(n\theta)$ and $\sin(n\theta)$. Their values at $n=0,1$ form a <matrix> with <determinant> $\sin\theta\ne0$, proving <linear independence>. Consequently they span the two-dimensional <vector space> of recurrence solutions.
At $\theta=0$ the two roots coalesce at one. The <linear recurrence> becomes $X_{n+2}-X_{n+1}=X_{n+1}-X_n$, so its successive differences are constant. A <basis> is therefore \b[$1,n$], and every solution is $A+Bn$.
For the specified <initial conditions>, the zero-angle solution is $X_n(0)=n$. For nonzero angle, it is convenient to center the <basis> at $n=1$:
$$
\boxed{X_n(\theta)=\cos((n-1)\theta)
+\frac{2-\cos\theta}{\sin\theta}\sin((n-1)\theta),\qquad 0<\theta<\pi.}
$$
This gives $X_1=1$ and $X_2=\cos\theta+2-\cos\theta=2$, and each summand obeys the <linear recurrence>. For every fixed integer $n\geq1$, the elementary <limit> $\sin z/z\to1$ gives
$$
\frac{\sin((n-1)\theta)}{\sin\theta}\longrightarrow n-1,
\qquad \boxed{X_n(\theta)\longrightarrow1+(n-1)=n=X_n(0).}
$$
The convergence here is for fixed $n$; it does not assert uniform convergence over all indices.
Back to article page