8. Let $x \in \mathbf{R}$. Then the function
$$
f(x)=\sqrt{x^{2}+1}+\sqrt{(x-12)^{2}+16}
$$

has a minimum value of $\qquad$ .
8. 13 .

As shown in Figure 1, take $A$ as the origin of the number line, $A B=$ 12, and then construct the perpendicular lines $A C$ and $B D$ such that
$$
\begin{array}{l}
A C=1, \\
B D=4 .
\end{array}
$$

On the number line, take point $P$ such that $A P=x$. Then
$$
f(x)=|C P|+|D P| \text {. }
$$

When points $C$, $P$, and $D$ are collinear, the value of $f$ is minimized. At this time,
$$
f_{\min }=|C D|=|A E|=\sqrt{12^{2}+5^{2}}=13 .
$$