<s>[INST] Obtain the equation of the sphere which passes through the points $(1,0,0),(0,1,0),(0,0,1)$ and has its radius as small as possible. Obtain the equation of the sphere which passes through the points $(1,0,0),(0,1,0),(0,0,1)$ and has its radius as small as possible.

Let  the sphere passes through $(x_1,y_1,z_1)$
Then i obtained the equation of sphere as $(x^2+y^2+z^2)(x_1+y_1+z_1)-(x_1^2+y_1^2+z_1^2-1)(x+y+z)+x_1^2+y_1^2+z_1^2-x_1-y_1-z_1=0$
I am stuck here.I do not know how to minimize the radius.The answer given in my book is $3(x^2+y^2+z^2)-2(x+y+z)-1=0$
 [/INST] Write the equation of a candidate sphere as
$$ (x - x_0)^2 + (y - y_0)^2 + (z - z_0)^2 = r^2. $$
Plugging in the points, we get
$$ (1 - x_0)^2 + y_0^2 + z_0^2 = r^2, \\
   x_0^2 + (1 - y_0)^2 + z_0^2 = r^2, \\
   x_0^2 + y_0^2 + (1 - z_0)^2 = r^2.
$$
Comparing the first two equations, we get
$$ (1 - x_0)^2 + y_0^2 = x_0^2 + (1 - y_0)^2 \implies 1 - 2x_0 + x_0^2 + y_0^2 = x_0^2 + 1 - 2y_0 + y_0^2 \implies x_0 = y_0. $$
Similarly we see that $x_0 = y_0 = z_0$ and so the center of the sphere must lie on the line $x = y = z$. Denoting the center by $(t,t,t)$ and returning to the first equation, we obtain
$$ 1 - 2t + 3t^2 = r^2 $$
so to minimize $r$ (or $r^2$), we need to minimize the quadratic $1 - 2t + 3t^2$. The minimum $\frac{2}{3}$ is attained at the vertex $t = \frac{1}{3}$ and so the equation is
$$ \left( x - \frac{1}{3} \right)^2 + \left( y - \frac{1}{3} \right)^2 + \left( z - \frac{1}{3} \right)^2 = \frac{2}{3} \iff \\
x^2 + y^2 + z^2 - \frac{2}{3}(x + y + z) + \frac{1}{3} = \frac{2}{3} \iff \\
3(x^2 + y^2 + z^2) - 2(x + y + z) - 1 = 0.$$
</s>