If $a$ and $b$ are integers such that $x^2 - x - 1$ is a factor of $ax^3 + bx^2 + 1$, then $b$ is

$ \textbf{(A)}\ -2\qquad\textbf{(B)}\ -1\qquad\textbf{(C)}\ 0\qquad\textbf{(D)}\ 1\qquad\textbf{(E)}\ 2 $
1. Let \( P(x) = ax^3 + bx^2 + 1 \). We are given that \( x^2 - x - 1 \) is a factor of \( P(x) \). This implies that \( P(x) \) can be written as \( P(x) = (x^2 - x - 1)Q(x) \) for some polynomial \( Q(x) \).

2. Since \( x^2 - x - 1 \) is a factor of \( P(x) \), the remainder when \( P(x) \) is divided by \( x^2 - x - 1 \) must be zero. We can use polynomial division or substitution to find the coefficients \( a \) and \( b \).

3. We know that \( x^2 \equiv x + 1 \) (mod \( x^2 - x - 1 \)). Therefore, we can substitute \( x^2 \) with \( x + 1 \) in \( P(x) \):
   \[
   P(x) = ax^3 + bx^2 + 1
   \]
   Substitute \( x^2 = x + 1 \):
   \[
   x^3 = x \cdot x^2 = x(x + 1) = x^2 + x = (x + 1) + x = 2x + 1
   \]
   Thus,
   \[
   P(x) = a(2x + 1) + b(x + 1) + 1
   \]
   Simplify:
   \[
   P(x) = 2ax + a + bx + b + 1
   \]
   Combine like terms:
   \[
   P(x) = (2a + b)x + (a + b + 1)
   \]

4. For \( x^2 - x - 1 \) to be a factor of \( P(x) \), the polynomial \( P(x) \) must be zero when evaluated at the roots of \( x^2 - x - 1 = 0 \). Therefore, the coefficients of \( x \) and the constant term must both be zero:
   \[
   2a + b = 0
   \]
   \[
   a + b + 1 = 0
   \]

5. Solve the system of equations:
   \[
   2a + b = 0 \quad \text{(1)}
   \]
   \[
   a + b + 1 = 0 \quad \text{(2)}
   \]

6. From equation (1), solve for \( b \):
   \[
   b = -2a
   \]

7. Substitute \( b = -2a \) into equation (2):
   \[
   a - 2a + 1 = 0
   \]
   \[
   -a + 1 = 0
   \]
   \[
   a = 1
   \]

8. Substitute \( a = 1 \) back into \( b = -2a \):
   \[
   b = -2(1) = -2
   \]

The final answer is \( \boxed{-2} \)