Example 6. In square $A B C D$, $E$ is on $B C$. $B E=2, C E=1$,
$P$ is on $B D$, then what is the minimum value of the sum of the lengths of $P E$ and $P C$?
(Fifth Junior Mathematics Correspondence Competition)
Solve in $\triangle B C P$, $B E: C E=2$,
$$
\therefore P E^{2}=\frac{1}{3} P B^{2}+\frac{2}{3} P C^{2}-2 \text {. }
$$

In $\triangle B C D$, $B C=C D=3$,
$$
\begin{aligned}
B D= & \sqrt{2} B C=3 \sqrt{2}, \\
\therefore P C^{2} & =B C^{2}-B P \cdot P D \\
& =9-B P(3 \sqrt{2}-B P) \\
& =P B^{2}-3 \sqrt{2} P B+9,
\end{aligned}
$$
$$
\begin{aligned}
\therefore P E^{2} & =\frac{1}{3} P B^{2}+\frac{2}{3}\left(B P^{2}-3 \sqrt{2} B P\right. \\
& \quad+9)-2 \\
& =P B^{2}-2 \sqrt{2} P B+4, \\
\therefore P E & +P C=\sqrt{P B^{2}-2 \sqrt{2} P B+4} \\
& \left.+\sqrt{P} B^{2}-3 \sqrt{2} P B+1\right) \\
= & \sqrt{(\bar{P} B-\sqrt{2})^{2}+2} \\
& +\sqrt{\left(P B-\frac{3 \sqrt{2}}{2}\right)^{2}+\frac{9}{2}} \\
= & \sqrt{(P B-\sqrt{2})^{2}+(0-\sqrt{2})^{2}} \\
& +\sqrt{\left(P B-\frac{3 \sqrt{2}}{2}\right)^{2}+\left(0+\frac{3}{\sqrt{2}}\right)^{2}} .
\end{aligned}
$$

Let $P B=x$, then the above expression represents the sum of the distances from a moving point $Q(x, 0)$ on the $x$-axis to two fixed points $A(\sqrt{2}, \sqrt{2})$ and $B\left(\frac{3 \sqrt{2}}{2},-\frac{3}{\sqrt{2}}\right)$.

Obviously, when point $Q$ is on segment $A B$, the sum is minimized, i.e., point $Q$ is the intersection of segment $A B$ and the $x$-axis. It is easy to find that the coordinates of point $Q$ are $\left(\frac{6}{5} \sqrt{2}, 0\right)$, so when $P B=\frac{6}{5} \sqrt{2}$, $P E+P C$ reaches its minimum value of $\sqrt{13}$.