I have troubles understanding the solution for the following exercise. It's about markov chain, but the part I don't understand is rather algebraic and about a recurrence system.

> 
> **Exercise**: Let $p \in ]0,1[$ and $(X\_n)\_{n\geq 0}$ be a Markov chain on $E=\{a,b,c\}$ with transition Matrix
>  $$Q:=\begin{pmatrix}1-p &p &0\\1/2&0&1/2\\0&0&1
> \end{pmatrix}$$
>  Compute the probabillity $P(X\_n=b\mid X\_0=a),\ n\in\mathbb{N}$ and find it's limit for $n\to \infty$
> 
> 
> **Solution**: The graph looks like this:
> 
> 
> [![enter image description here](https://i.stack.imgur.com/27nh4.png)](https://i.stack.imgur.com/27nh4.png)
> 
> 
> First notice $Q\_n=Q\cdot Q\_{n-1}\quad \forall n\geq 1$. In particular $a\_n:=P(X\_n=b\mid X\_0=a)$ and $b\_n:=P(X\_n=b\mid X\_0=b)$ then
>  $$\begin{cases}a\_n=(1-p)a\_{n-1}+pb\_{n-1}\\ b\_n=\frac{1}{2}a\_{n-1}\end{cases}$$
>  Thus $(a\_n)\_{n\geq 0}$ is
>  $$\begin{cases}a\_n-(1-p)a\_{n-1}-\frac{p}{2}a\_{n-2}=0,\quad n\geq 2,\\ a\_0=0,\ a\_1=p\end{cases}$$
> 
> 
> 

Here is the part I don't understand. I have no clue how to solve this recurrence system. I've never did this before.

> 
> **Solution**: Hence $$a\_n=p\frac{(1-p+\sqrt{1+p^2})^n-(1-p-\sqrt{1+p^2})^n}{2^n\sqrt{1+p^2}}$$
>  And find $a\_n\to 0$.
> 
> 
> 

How do I get to that result? I tried
$$a\_n-(1-p)a\_{n-1}-\frac{p}{2}a\_{n-2}=a\_n-(1-p)a\_{n-1}-\frac{p}{2}\left((1-p)a\_{n-2}-\frac{p}{2}a\_{n-3}\right)=0$$
But I fail miserably. (I also find the solution quite not so "probabilistic", is this the only possible way to compute this?)