29. Let $a$ and $b$ be two integers. Suppose $x^{2}-x-1$ is a factor of the polynomial $a x^{5}+b x^{4}+1$. Find the value of $a$.
29. Ans: 3
Let $p$ and $q$ be the roots of $x^{2}-x-1=0$. Then $p+q=1$ and $p q=-1$. On the other hand, $p$ and $q$ are also roots of $a x^{5}+b x^{4}+1=0$. Thus $a p^{5}+b p^{4}+1=0$ and $a q^{5}+b q^{4}+1=0$. From these two equations and $p q=-1$, we have $a p+b=-q^{4}$ and $a q+b=-p^{4}$. Therefore
$$
\begin{aligned}
a=\frac{p^{4}-q^{4}}{p-q} & =\left(p^{2}+q^{2}\right)(p+q) \\
& =\left((p+q)^{2}-2 p q\right)(p+q) \\
& =\left(1^{2}-2(-1)\right) \times 1 \\
& =3 .
\end{aligned}
$$

Alternative solution: Since $x^{2}-x-1$ is a factor of $a x^{5}+b x+1$, we may write
$$
a x^{5}+b x^{4}+1 \equiv\left(x^{2}-x-1\right)\left(a x^{3}+c x^{2}+d x-1\right)
$$
for some real numbers $c$ and $d$. By comparing the coefficients, we have
$$
\begin{aligned}
x: & 0=1-d \Longrightarrow d=1 . \\
x^{2}: & 0=-1-d-c \Longrightarrow c=-2 \\
x^{3}: & 0=-a-c+d \Longrightarrow a=-c+d=2+1=3 .
\end{aligned}
$$