Let $\alpha,\beta$ be the solutions of $t^2=xt+1$.
Since
$$\alpha+\beta=x,\quad \alpha\beta=-1$$
we have
$$P(n+1)=(\alpha+\beta)P(n)-\alpha\beta P(n-1)$$
So, we get
$$P(n+1)-\alpha P(n)=\beta (P(n)-\alpha P(n-1))=\cdots =\beta^{n-1}(P(2)-\alpha P(1))$$
and
$$P(n+1)-\beta P(n)=\alpha (P(n)-\beta P(n-1))=\cdots =\alpha^{n-1}(P(2)-\beta P(1))$$
Subtracting the latter from the former gives
$$(\beta-\alpha)P(n)=\beta^{n-1}(x-\alpha)-\alpha^{n-1}(x-\beta),$$
i.e.
$$P(n)=\frac{\beta^{n-1}(x-\alpha)-\alpha^{n-1}(x-\beta)}{\beta-\alpha}$$
where
$$\alpha=\frac{x-\sqrt{x^2+4}}{2},\quad\beta=\frac{x+\sqrt{x^2+4}}{2}$$