4. As shown in Figure 1, in quadrilateral $A B C D$, it is known that $\triangle A B C$ is an equilateral triangle, $\angle A D C=$ $30^{\circ}, A D=3, B D=5$. Then the length of side $C D$ is ( ).
(A) $3 \sqrt{2}$
(B) 4
(C) $2 \sqrt{5}$
(D) 4.5
4. B.

As shown in Figure 4, with
$C D$ as a side, construct
an equilateral $\triangle C D E$ outside
quadrilateral $A B C D$,
and connect $A E$.
$$
\begin{array}{l}
\text { Given } A C \doteq \\
B C, C D=C E, \\
\angle B C D=\angle B C A+\angle A C D \\
=\angle D C E+\angle A C D=\angle A C E \\
\Rightarrow \triangle B C D \cong \triangle A C E \Rightarrow B D=A E . \\
\text { Also, } \angle A D C=30^{\circ} \\
\Rightarrow \angle A D E=\angle A D C+\angle C D E=90^{\circ} \\
\Rightarrow A D^{2}+D E^{2}=A E^{2} \Rightarrow A D^{2}+C D^{2}=B D^{2} \\
\Rightarrow C D=\sqrt{B D^{2}-A D^{2}}=4 .
\end{array}
$$