Example 3. Find a point $P$ on the line segment $A B$ such that $A P \cdot P B$ is maximized.
Solve As shown in Figure 3, take the midpoint $M$ of $\mathrm{AB}$, then we have
$$
\begin{aligned}
\mathrm{AP} \cdot \mathbf{P B} & =(\mathbf{A M}+\mathrm{MP})(\mathrm{BM}-\mathrm{MP}) \\
& =(\mathbf{A M}+\mathrm{MP})(\mathbf{A M}-\mathrm{MP}) \\
& =\mathbf{A M}^{2}-\mathrm{MP}^{2} .
\end{aligned}
$$

To maximize $A P \cdot P B$, it is sufficient that $M P^{2}=0$, which means $M P=0$, i.e., point $P$ coincides with point $M$ when $M P=0$.
Therefore, when $P$ is the midpoint of segment $A B$, $A P \cdot P B$ is maximized.