8. If the equation with respect to $x$
$$
x^{2}+a x+b-3=0(a, b \in \mathbf{R})
$$

has real roots in the interval $[1,2]$, then the minimum value of $a^{2}+(b-4)^{2}$ is $\qquad$.
8. 2 .

From the problem, we know that $b=-x^{2}-a x+3$.
Then $a^{2}+(b-4)^{2}$
\[
\begin{array}{l}
=a^{2}+\left(-x^{2}-a x-1\right)^{2} \\
=x^{2}(x+a)^{2}+2\left(x^{2}+a x\right)+a^{2}+1 \\
=\left(x^{2}+1\right)(x+a)^{2}+x^{2}+1 .
\end{array}
\]

Also, $x \in[1,2]$, so,
\[
a^{2}+(b-4)^{2} \geqslant x^{2}+1 \geqslant 2 \text {, }
\]

When $x=1, a=-1, b=3$, $a^{2}+(b-4)^{2}$ achieves its minimum value of 2.