Condition for three points to lie on a Sphere? If A and B are the points (3,4,5) and (-1,3,-7) respectively then the set of the points P such that $PA^2+PB^2 = K^2$ where K is a constant lie on a proper sphere if K = 1 or K^2 <>= 161/2?
The correct answer is K^2 > 161/2. How?
I know that three non - collinear points always lie on one and only one circle but I don't know similar thing about a sphere. Probably we have to use pythagoras theorem but I'm not sure. Can someone help?
 A: Note first that the distance between $A$ and $B$ is $\sqrt{161}$. Let $C(1,\frac{7}{2},-1)$ be the midpoint of $AB$ and let $r=\frac{1}{2}\sqrt{2K^2-161}$. Take any point $P(x,y,z)$.
We have $PA^2+PB^2=(x-3)^2+(y-4)^2+(z-5)^2+(x+1)^2+(y-3)^2+(z+7)^2=2x^2+2y^2+2z^2-4x-14y+4z+109=2(x-1)^2+2(y-\frac{7}{2})^2+2(z+1)^2+\frac{161}{2}=2\cdot PC^2+\frac{161}{2}$.
So $PA^2+PB^2=K^2$ iff $K^2=2\cdot PC^2+\frac{161}{2}$ or $PC^2=\frac{1}{2}\sqrt{2K^2-161}=r^2$. In other words, the locus of $P$ is the sphere centre $C$ radius $r$.
A: If the locus of the points with $|PA|^2+|PB|^2=K^2$ is a sphere, then by symmetry this sphere needs to be centered around the point midway between $A$ and $B$. Therefore it makes sense to switch to a coordinate system where this point is the origin -- that will make it much easier to recognize the equation for a sphere.
Since we're changing the coordinate system anyway, we might as well choose one where $A$ and $B$ have nice coordinates, so let's align our new $z$-axis such that it passes through $A$ and $B$.
In the new coordinate system our points are $A(0,0,\frac12\sqrt{161})$ and $B(0,0,-\frac12\sqrt{161})$, and then the equation $|PA|^2+|PB|^2=K^2$ unfolds to
$$ x^2+y^2+\Bigl(z-\tfrac{\sqrt{161}}2\Bigr)^2 + x^2+y^2+\Bigl(z+\tfrac{\sqrt{161}}2\Bigr)^2 = K^2 $$
Rearrange this and then figure out which condition on $K$ makes this look like the equation for a proper sphere.
