<s>[INST] Find $a$, $b$ such that $x^2 - x -1$ is a factor of $ax^9 + bx^8 + 1$ 
Find $a$, $b$ such that $x^2 - x -1$ is a factor of $ax^9 + bx^8 + 1$

The second polynomial can be rewritten as
$$ax^9 + bx^8 + 1 = f(x)(x^2 - x - 1)$$
The roots of this polynomial are $\frac{1 \pm \sqrt 5}{2}$. Substituting one of these roots in this equation gives us:
$$a\left( \frac{1 + \sqrt5}{2}\right)^9 + b\left( \frac{1 + \sqrt 5}{2}\right)^8 + 1 = 0$$
I was able to solve this far, but I gave up because the calculation past this point gets too tedious. The textbook has gone ahead and simplified this to
$$2^9 a + 2^8b(\sqrt 5 - 1) + (\sqrt5 - 1)^9 = 0$$
after which it simplifies to (divide by $2^8$ and solve the binomial expression)
$$2a + b(\sqrt 5 -1) = 76 - 34\sqrt5$$
Is there a more elegant way to solve this problem? Preferably one that does not include the magical use of a calculator or the evaluation of that ugly binomial expansion?
 [/INST] Consider
$P(x)= ax^9+bx^8+1$ and $\alpha$ one of the numbers$\frac{1 \pm \sqrt 5}{2}.$
We have equalities:
$\alpha^2$ = $\alpha$ + 1, $\alpha^4$ = 3$\alpha$ + 2,
$\alpha^8$ = 21$\alpha$ + 13, $\alpha^9$ = 34$\alpha$ + 21.
(The coefficients to the right of the equations are terms of the Fibonacci sequence)
From $P(\alpha) = 0$ results $a(34\alpha + 21) +b(21\alpha + 13) + 1 =0$ and then
$(34a + 21b)\alpha + 21a + 13b + 1 = 0$
If $a$ and $b$ are rational numbers then $$ a = 21, b = -34.$$
</s>