$x^2-mx-1-m^2=0\ (1)$
$∆=m^2+4+4m^2=5m^2+4\ge4\forall m \in R$
$\Rightarrow$ phương trình (1) luôn có 2 nghiệm phân biệt với mọi giá trị của $m$
Theo Vi--et ta có
$\left\{\begin{matrix}x_1+x_2=m\\x_1x_2=-(m^2+1)\end{matrix}\right.$
$P=\dfrac{2(x_1+x_2)^2+1}{2(x_1+x_2)-x_1x_2}\\ =\dfrac{2m^2+1}{2m+m^2+1}$
Gọi $a$ là giá trị tùy biến của $P$
$\Rightarrow \dfrac{2m^2+1}{m^2+2m+1}=a\\ \Leftrightarrow 2m^2+1=a(m^2+2m+1)\\ \Leftrightarrow (2-a)m^2-2am+1-a=0\ (2)$
Nếu $a=2\Rightarrow-4m-1=0\Leftrightarrow m=\dfrac{-1}{4}$
Nếu $a\ne2$ thì để phương trình (2) có nghiệm thì $∆\ge0$
$\Leftrightarrow 4a^2-4(2-a)(1-a)\ge0\\ \Leftrightarrow 4a^2-4a^2+12a-8\ge0\\ \Leftrightarrow a\ge\dfrac{2}{3}$
Với $a=\dfrac{2}{3}\Rightarrow m=\dfrac{1}{2}$
Vậy $Min_P=\dfrac{2}{3}\ tại\ m=\dfrac{1}{2}$