<s>[INST] Let $a$ and $b$ be roots of $x^2-7x+2$. Find the value of $a^6 + b^6$. 
Let $a$ and $b$ be roots of $x^2-7x+2$. Find the value of $a^6 + b^6$.

Answer:
$a+b = 7, ab = 2$
$$\begin{align}
(a+b)^6 &= a^6 + 6a^5b+15a^4b^2+20a^3b^3+15a^2b^4+6ab^5+b^6 \\[4pt]
a^6 + b^6 &= (a+b)^6 -  (6a^5b+15a^4b^2+20a^3b^3+15a^2b^4+6ab^5) \\
&= (a+b)^6 - (6ab(a^4 + b^4) + 15a^2b^2 (a^2 + b^2) + 20(ab)^3)
\end{align}$$
now,
$$\begin{align}
a^4 + b^4 &= (a+b)^4 - (4a^3b + 6a^2b^2 + 4ab^3) \\
&= (a+b)^4 - (4ab(a^2 + b^2) + 6(ab)^2) \\
&= (a+b)^4 - (4ab((a + b)^2 - 2ab) + 6(ab)^2) \\
&= 7^4 - (4(2)(7^2 - 2(2)) + 6(2)^2) \\
&= 2017
\end{align}$$
so
$$\begin{align} 
&\phantom{=}\; (a+b)^6 - (6ab(a^4 + b^4) + 15a^2b^2 (a^2 + b^2) + 20(ab)^3)\\
&= 7^6 - (6\cdot2\cdot(2017) + 15(2)^2 (7^2 - 2(2)) + 20(2)^3) \\
&= 90585
\end{align}$$
correct?
 [/INST] For either root of the equation:

*

*$x^2 = 7x - 2$


*$x^4 = (7x - 2)^2 = 49 x^2 - 28 x + 4 = 49(7x-2) - 28 x + 4 = 315 x - 94$


*$x^6 = (7x - 2)(315 x - 94) = 2205 x^2 - 1288 x + 188 = 14147 x - 4222$
It follows that $\,a^6+b^6 = 14147 (a+b) - 2 \cdot 4222 = 14147 \cdot 7 - 8444 = 90585\,$.

[ EDIT ] $\;$ The underlying idea in the above is based on the Euclidean division:
$$
x^6 = (x^4 + 7 x^3 + 47 x^2 + 315 x + 2111) \cdot(x^2 - 7 x + 2) + (14147 x - 4222)
$$
Then substituting $x = a,b$ the product is zero, which leaves only the remainder to evaluate, and adding the two equalities gives the same result as in the last line of the answer.
The shortcut here was to derive the remainder directly, without doing the full long division and calculating the quotient, which is not needed in this case.
</s>