5. Let $E$ be a moving point inside square $ABCD$. It is known that the minimum value of the sum of the distances from $E$ to points $A$, $B$, and $C$ is $\sqrt{2}+\sqrt{6}$. Try to find the side length of this square.
5. For a point $P$ inside a square, consider $P A+P B+P C$. Rotate $\triangle A P C$ by $60^{\circ}$ to $\triangle A^{\prime} P^{\prime} C$, then $\triangle A A^{\prime} C$ and $\triangle P P^{\prime} C$ are both equilateral triangles. Thus, $P C=P P^{\prime}$, and $A^{\prime}$ is a fixed point. By the invariance of rotation, $A P=A^{\prime} P^{\prime}$, so $P A+P B+P C=A^{\prime} P^{\prime}+P^{\prime} P+P B \geqslant A^{\prime} B$. When $\angle A P B=\angle B P C=\angle C P A=120^{\circ}$, $B, P, P^{\prime}, A^{\prime}$ are collinear, and the equality holds, thus $(P A+P B+P C)_{\text {min }}=A^{\prime} B$. It is easy to calculate that $A^{\prime} B=\left(\frac{\sqrt{2}}{2}+\frac{\sqrt{6}}{2}\right) B C$, so when $A^{\prime} B=\sqrt{2}+\sqrt{6}$, the side length of the square $B C=2$.