For $p\in (0,1)$ and $q:=1-p$ find all the solutions $h=(h_i)_{i\in\mathbb{N}_0}$ of the recurrence relation $$ \begin{cases}h_0=1\\h_i=ph_{i+1}+qh_{i-1}, & \text{ for }i=1,2,...\end{cases} $$
First I assume that the solution is of the form $h_i=\lambda^i$. $$ -p\lambda^2+\lambda-q=0\Leftrightarrow\lambda^2-\frac{1}{p}\lambda+\frac{q}{p}=0 $$ This quadratic equation does have the two solutions $$ \alpha=\frac{1+\sqrt{1-4pq}}{2p},~~~\beta=\frac{1-\sqrt{1-4pq}}{2p}. $$
So $h_i=A\alpha^n+B\beta^n$ for constants $A,B$ is a solution.
By induction it can be shown that this is the general solution, right?
But my book says that for $p\neq q$ the general solution is $$ h_i=A+B\left(\frac{q}{p}\right)^i. $$ Do not see how getting this.
If you use that $q=1-p$ you get that $\sqrt{1-4pq}=\sqrt{4p^2-4p+1}=\sqrt{(2p-1)^2}=2p-1$. Inserting this into your expressions for $\alpha$ and $\beta$ gives $\alpha = 1$ and $\beta = \frac{2-2p}{2p}=\frac{1-p}{p}=\frac{q}{p}$.