5. $a$ and $b$ are rational numbers, and satisfy the equation
$$
a+b \sqrt{3}=\sqrt{6} \times \sqrt{1+\sqrt{4+2 \sqrt{3}}} \text {. }
$$

Then the value of $a+b$ is ( ).
(A) 2
(B) 4
(C) 6
(D) 8
5. B.

Since $\sqrt{6} \times \sqrt{1+\sqrt{4+2 \sqrt{3}}}=\sqrt{6} \times \sqrt{1+(1+\sqrt{3})}$ $=\sqrt{12+6 \sqrt{3}}=3+\sqrt{3}$,
thus, $a+b \sqrt{3}=3+\sqrt{3}$, which means $(a-3)+(b-1) \sqrt{3}=0$.
Since $a, b$ are rational numbers, then $a=3, b=1$, hence $a+b=4$.