# Knowing $x^2-x-1$ is a factor of $p(x)=ax^5 + bx^4 + 1$ , find a,b.

Since $$x^2-x-1$$ is factor then $$x^2-x-1=0$$ and so $$x^2=x+1$$ is a solution.

I’m using $$x^2$$ so I express $$p(x)$$ in terms of it:

$$p(x)=a{x^2}{x^2}{x}+b{x^2}{x^2}+1$$ $$a{(x+1)}{(x+1)}{(x+1)(x-1)}+b{(x+1)}{(x+1)}+1=0$$

But after this, I’m stuck. I don’t know if I can simplify anything here which will cause the X variable to get canceled and obtain a nice factorization.

• Why don't you simply replace every $x^2$ by $x+1$ until you don't have any $x^2$ left? Commented Dec 1, 2023 at 14:36
• Just compute $(x^2-x-1)f(x)$ with a cubic polynomial, and compare with $ax^5+bx^4+1$. The easy equations give $a=3$ and $b=-5$, and $f=3x^3 - 2x^2 + x - 1$. Commented Dec 1, 2023 at 14:42
• @Dominique I have already replaced every $x^2$, I don’t quite understand the advice. Commented Dec 1, 2023 at 14:59
• @DietrichBurde Compare in what sense? I don’t quite grasp the idea. Would you mind providing a more elaborated answer? Commented Dec 1, 2023 at 15:01
• @FabDust: you have done the replacement once, but then you got new $x^2$ instances: you need to repeat this process over and over until no $x^2$ (or even higher powers) are left. Commented Dec 4, 2023 at 7:26

A simple long division method yields

$$p(x)=ax^5+bx^4+1=(x^2-x-1)((ax^3)+(a+b)x^2+(2a+b)x+(3a+2b))+\ (5a+3b)x+(3a+2b+1)$$

as we know $$(x^2-x-1)$$ is factor of $$p(x)$$, The remainder $$(5a+3b)x+(3a+2b+1)$$ must be necessarily $$0$$ for $$\forall x$$, Hence

$$5a+3b=0$$ and $$3a+2b+1=0$$

solving for $$a$$ and $$b$$ yields $$a=3$$ and $$b=-5$$

Your method is on-target. You just need to reduce the quintic until both the equations are of same degree to compare coefficients. I will show an example with highest degree of $$2$$ (reduction to quadratic).

$$x^2 = x + 1 \implies x^3 = x^2 + x,\, x \neq 0 \\\therefore x^4 = 2x^2 + x \\ x^5 = 3x^2 + 2x \\\text{Hence, } x^2 - x - 1 \,\,\Big\vert\,\, a(3x^2 + 2x) + b(2x^2 + x) + 1 \\\iff x^2 - x - 1 \,\,\Big\vert\,\, (3a + 2b)\cdot x^2 + (2a + b)\cdot x + 1$$

However, note that the quadratics must have a gcd of $$1$$, thus they are the same quadratics. Now we compare and align coefficients to evaluate $$a, b$$.

$$-x^2 + x \color{red}{+ 1} = (3a + 2b)\cdot x^2 + (2a + b)\cdot x \color{red}{+ 1} \\\implies 3a + 2b = -1 =-2a - b \\\implies \{a, b\} = \{3 , -5\}$$

It is possible to achieve with reduction to linear equations. Do you understand how you would continue with $$x + 1$$?

• "However, note that the quadratics must have a gcd of 1, thus they are the same quadratics." I object to this sentence, the gcd of those two polynomials is not $1$. I think what was meant that for $x^2-x-1$ to divide $(3a+2b)x^2+(2a+b)x+1$, the polynomial $(3a+2b)x^2+(2a+b)x+1$ must be a scalar multiple of $x^2-x-1$ [and so gcd is $x^2-x-1$ up to scalar multiplication]. And so comparing the constant terms $-1$ and $1$ means that this scalar multiple must be $1/-1 = -1$. I upvoted +1
– Mike
Commented Dec 1, 2023 at 23:39

Notice that $$\frac{1\pm\sqrt{5}}{2}$$ are the roots of $$p(x)$$ as they are the roots of $$x^2-x-1$$. Hence, we would have two equations:

$$p\left(\frac{1+\sqrt{5}}{2}\right) = a\left(\frac{1+\sqrt{5}}{2}\right)^5+b\left(\frac{1+\sqrt{5}}{2}\right)^4+1=0$$ and $$p\left(\frac{1-\sqrt{5}}{2}\right) = a\left(\frac{1-\sqrt{5}}{2}\right)^5+b\left(\frac{1-\sqrt{5}}{2}\right)^4+1=0$$ Solving above two equations would yield: $$a=3$$ and $$b= -5$$.

• You could use the names $\phi$ and $\frac{1}{\phi}$ for these roots (golden ratio and the opposite of its inverse) Commented Dec 1, 2023 at 16:09
• Oh! Yes. Right. Commented Dec 1, 2023 at 16:11