4. (1984 Shanxi Province High School Competition Question) Given points $A(4,1), B(0,4)$, and line $l: 3 x-y-1=0$, find a point $P$ on $l$ such that $|P A|-|P B|$ is maximized, and determine the coordinates of point $P$.
4. Make the symmetric point $B_{1}\left(x_{1}, y_{1}\right)$ of $B$ with respect to $l$, then the midpoint $M\left(\frac{x_{1}}{2}, \frac{4+y_{1}}{2}\right)$ of segment $B B_{1}$ lies on $l$, so $3 \cdot \frac{x_{1}}{2}-$ $\frac{y_{1}+4}{2}-1=0$, which simplifies to $3 x_{1}-y_{1}-6=0$ (1). Also, $B B_{1} \perp l$ gives $\frac{y_{1}-4}{x_{1}}=-\frac{1}{3}$ (2). From (1) and (2), we get $B_{1}(3,3)$, thus the equation of $A B_{1}$ is $2 x+y-9=0$. Let $A B^{\prime}$ intersect $l$ at $P_{1}$, then it is easy to find $P_{1}(2,5)$, hence $|P A|-|P B|=|P A|-$ $\left|P B_{1}\right| \leqslant\left|A B_{1}\right|=\sqrt{(4-3)^{2}+(1-3)^{2}}=\sqrt{5}$, with equality if and only if $P$ coincides with $P_{1}$. Therefore, the maximum value of $|P A|-|P B|$ is $\sqrt{5}$, and the coordinates of the required point $P$ are $(2,5)$.