Example 3. If $a$ is a root of $x^{2}-3 x+1=0$, try to find the value of $\frac{2 a^{5}-5 a^{4}+2 a^{3}-8 a^{2}}{a^{2}+1}$.
From the definition of the root, we know that $a^{2}-3 a+1=0$.
Thus, $a^{2}+1=3 a$ or $a^{2}-3 a=-1$ or
$$
\begin{array}{l}
a^{3}=3 a^{2}-a \\
\therefore \text { the original expression }=\frac{a\left[2 a^{2}\left(a^{2}+1\right)-5 a^{3}-8 a\right]}{3 a} \\
=\frac{1}{3}\left(a^{3}-8 a\right)=\frac{1}{3}\left(3 a^{2}-9 a\right) \\
=a^{2}-3 a=-1 .
\end{array}
$$