In: Advanced Math
If the sphere is in the first octant then the largest possible sphere must be tangent to the xy, yz or xz planes.
now equation of the sphere centered at (4,3,5) is
(x-4)2 + (y-3)2 + (z-5)2 = R2 where R is the radius of the sphere .
we need to find the maximum value of R such that the sphere can't go beyond the first octant. that is the radius of the sphere must be such that the surface of the sphere just touches one of the planes. Notice that being at centered at (4,3,5) , it is 4 units to the right of plane yz, 3 units from the xz plane and 4units over the plane xy.
Hence the radius must be up to 3 units as if it is greater than 3 units then it will go beyond to the first octant. So the maximum possible radius is 3 unit . that is largest possible sphere will be of radius 3. Therefore the equation of the required sphere is ,
(x-4)2+(y-3)2+(z-5)2 = 32 which implies
x2-8x+16+y2-6y+9+z2-10z+25=9 i.e x2+y2+z2-8x-6y-10z+41=0