Example 3 In the Cartesian coordinate system $x O y$, given two points $M(-1,2)$ and $N(1,4)$, point $P$ moves on the $x$-axis. When $\angle M P N$ takes the maximum value, find the x-coordinate of point $P$.

 untranslated text remains unchanged.
Solution 1: Let $P\left(x_{0}, 0\right)$, and let $\theta$ be the angle from line $N P$ to line $M P$,
then when $x_{0} \neq \pm 1$, $k_{P M}=\frac{2}{-1-x_{0}}, k_{P \mathrm{~V}}=\frac{4}{1-x_{0}}$,

Thus,
$$
\tan \theta=\frac{\frac{2}{-1-x_{0}}-\frac{4}{1-x_{0}}}{1+\frac{8}{x_{0}^{2}-1}}=\frac{2 x_{0}+6}{x_{0}^{2}+7} .
$$

By the discriminant method, it is easy to find that $-\frac{1}{7} \leqslant \tan \theta \leqslant 1$. The equality $\tan \theta=1$ is achieved when $x_{0}=1$, i.e., when $x_{0} \neq \pm 1$, the maximum value of $\angle M P N$ is $\frac{\pi}{4}$.
Furthermore, when $x_{0}=1$, $\angle M P N=\frac{\pi}{4}$; when $x_{0}=-1$, $\angle M P N=\arctan \frac{1}{2}\angle M P^{\prime} N$, hence the point $P(1,0)$ is the solution, so the x-coordinate of point $P$ is 1.