4. As shown in the figure, points $A$, $B$, $C$, and $D$ lie on the same circle, and $BC = CD = 4$, $AE = 6$. The lengths of segments $BE$ and $DE$ are both positive integers. Then the length of $BD$ is $\qquad$
4. 7

Solution: Let $E C=x, B E=y$, $E D=z$, from $\triangle D C E \sim \triangle A C D$,

we get $\frac{C D}{C A}=\frac{E C}{D C}$, that is $\frac{4}{6+x}=\frac{x}{4}$.

Solving this, we get $x=2 \cdot(x=-8$ is not feasible)
Also, from $A E \cdot E C=B E \cdot E D$
we get $y z=6 \times 2=12$.

However, in $\triangle B C D$, we also have $y+z<4+4=8$.
Thus, the only integer solutions are
$\left\{\begin{array}{l}y=3 \\ z=4\end{array}\right.$ or $\quad\left\{\begin{array}{l}y=4 \\ z=3 .\end{array}\right.$
In both cases, we have $B D=y+z=7$.