Given: The points $A (3, 4, 5)$ and $B (-1, 3, -7)$
$\Rightarrow x_1 = 3, y_1 = 4, z_1 = 5; x_2 = -1, y_2 = 3, z_2 = -7;$
$PA^2 + PB^2 = k^2 …(i)$
Let the point be $P (x, y, z).$
Now, by Distance Formula, we know that the distance between two points $P (x_1, y_1, z_1)$ and $Q (x_2, y_2, z_2)$ is given by $\mathrm{PQ}=\sqrt{\left(\mathrm{x}_{2}-\mathrm{x}_{1}\right)^{2}+\left(\mathrm{y}_{2}-\mathrm{y}_{1}\right)^{2}+\left(\mathrm{z}_{2}-\mathrm{z}_{1}\right)^{2}}$.
So, $PA =\sqrt{(3-\mathrm{x})^{2}+(4-\mathrm{y})^{2}+(5-\mathrm{z})^{2}}$
And $PB =\sqrt{(-1-\mathrm{x})^{2}+(3-\mathrm{y})^{2}+(-7-\mathrm{z})^{2}}$
Now, substituting these values in (i), we have
$[(3 - x)^2 + (4 - y)^2 + (5 - z)^2] + [(-1 - x)^2 + (3 - y)^2 + (-7 - z)^2] = k^2$
$\Rightarrow [(9 + x^2 – 6x) + (16 + y^2 – 8y) + (25 + z^2 – 10z)] + [(1 + x^2 + 2x) + (9 + y^2 – 6y) + (49 + z^2 + 14z)] = k^2$
$\Rightarrow 9 + x^2 – 6x + 16 + y^2 – 8y + 25 + z^2 – 10z + 1 + x^2 + 2x + 9 + y^2 – 6y + 49 + z^2 + 14z = k^2$
$\Rightarrow 2x^2 + 2y^2 + 2z^2 - 4x - 14y + 4z + 109 = k^2$
$\Rightarrow 2x^2 + 2y^2 + 2z^2 - 4x - 14y + 4z = k^2 – 109$
$\Rightarrow 2 (x^2 + y^2 + z^2 – 2x – 7y + 2z) = k^2 – 109$
$\Rightarrow x^2 + y^2 + z^2 - 2x - 7y + 2z =\frac{k^{2}-109}{2}$

