5. If real numbers $x, y, a, b$ satisfy $x^{2}+y^{2}=1$, $a^{2}+b^{2}=25$, then the maximum value of $a x+b y$ is ( ).
(A) 3
(B) 4
(C) 5
(D) 6
5. C.

Notice that
$$
\begin{array}{l}
0 \leqslant(a-5 x)^{2}+(b-5 y)^{2} \\
=\left(a^{2}+b^{2}\right)+25\left(x^{2}+y^{2}\right)-10(a x+b y) \\
=50-10(a x+b y) .
\end{array}
$$

Then $a x+b y \leqslant 5$.
When $a x+b y=5$, $a=5 x, b=5 y(x, y$ are any real numbers).
Therefore, the maximum value of $a x+b y$ is 5.