Inscribing a sphere in a pyramid Is it possible to inscribe a sphere inside a square pyramid whose edge lengths are all equal? My question is that in the $2$D case it is possible to inscribe a circle in any triangle, but if we have a $3$D pyramid does there exist only one such configuration to have a sphere be able to be inscribed in it?
Also, the definition of a square pyramid doesn't imply its edges have to be the same lengths. The faces do not need to all be isosceles or equilateral, right?
 A: SHORT ANSWER: It is possible to inscribe a sphere inside a square pyramid whose edge lengths are all equal. If the edge lengths are $1$ then the center of the inscribed sphere is above the center of the square at a distance of $\frac{1}{\sqrt 6+\sqrt 2}$ from that square, and the radius of the sphere is $\frac{1}{\sqrt 6+\sqrt 2}$. If the sphere is to be inside the pyramid this is the only configuration. If the edge lengths are not equal then a sphere inside the pyramid that is tangent to all five faces may not exist.
LONG ANSWER: The problem is equivalent to finding a point that is equidistant from all five faces of the square pyramid. Let's use 3D analytic geometry to see if such a point exists for a general pyramid with a square base. To be particular, let's place the square base $ABCD$ in the first quadrant of the $xy$-plane with corner $A$ at the origin, sides aligned with the axes. Let's say the apex of the pyramid is at point $E(f,g,h)$. Here is a diagram looking at the pyramid from above.

We want to find the distance of point $P(x,y,z)$ to each of the side faces of the pyramid, labelled $F_1$ through $F_4$. The distance from $P$ to the square base is obviously $z$, but how do we find the distances to the faces defined by their vertices?
Here is one way. Consider face $ABE$. If we take the cross-product of two vectors defined by two sides of the triangular base, $\overrightarrow{AE}\times\overrightarrow{AB}$ we get a vector perpendicular to the face. Taking the right order of those vectors guarantees that the vector points from the face to the interior of the pyramid. Normalize that vector to one $\mathbf{F_1}$ in the same direction but with unit length. Then the distance of point $P$ to face $ABE$ is
$$(\mathbf{P}-\mathbf{A})\cdot\mathbf{F_1}$$
which uses the dot product.
For face $F_1$ we use $\overrightarrow{AE}\times\overrightarrow{AB}$ normalized to get the row vector
$$\mathbf{F_1}=\left[0,\ \frac{h}{\sqrt{g^2+h^2}},\ -\frac{g}{\sqrt{g^2+h^2}} \right]$$
For face $F_2$ we use $\overrightarrow{AD}\times\overrightarrow{AE}$ normalized to get the row vector
$$\mathbf{F_2}=\left[\frac{h}{\sqrt{f^2+h^2}},\ 0,\ -\frac{f}{\sqrt{f^2+h^2}} \right]$$
For face $F_3$ we use $\overrightarrow{DC}\times\overrightarrow{DE}$ normalized to get the row vector
$$\mathbf{F_3}=\left[0,\ -\frac{h}{\sqrt{(1-g)^2+h^2}},\ -\frac{1-g}{\sqrt{(1-g)^2+h^2}} \right]$$
For face $F_4$ we use $\overrightarrow{BE}\times\overrightarrow{BC}$ normalized to get the row vector
$$\mathbf{F_4}=\left[-\frac{h}{\sqrt{(1-f)^2+h^2}},\ 0,\ -\frac{1-f}{\sqrt{(1-f)^2+h^2}} \right]$$
Since the distance from $P(x,y,z)$ to face $F_1$ must equal $z$, we get the equation
$$(\mathbf{P}-\mathbf{A})\cdot\mathbf{F_1}=z$$
This can be written out and put into standard linear form. Doing this for all four faces we get these simultaneous linear equations.
$$\begin{array}{rrrr}
0\,x \ + &\frac{h}{\sqrt{g^2+h^2}}\,y \ + &\left(-1-\frac{g}{\sqrt{g^2+h^2}}\right)z= &0 \\
\frac{h}{\sqrt{f^2+h^2}}\,x \ + &0\,y \ + &\left(-1-\frac{f}{\sqrt{f^2+h^2}}\right)z= &0 \\\
0\,x \ + &\frac{-h}{\sqrt{(1-g)^2+h^2}}\,y \ + &\left(-1-\frac{1-g}{\sqrt{(1-g)^2+h^2}}\right)z= &\frac{-h}{\sqrt{(1-g)^2+h^2}} \\
\frac{-h}{\sqrt{(1-f)^2+h^2}}\,x \ + &0\,y \ + &\left(-1-\frac{1-f}{\sqrt{(1-f)^2+h^2}}\right)z= &\frac{-h}{\sqrt{(1-f)^2+h^2}} \\
\end{array}$$
If we use $f=g=\frac 12$, $h=\frac 1{\sqrt 2}$ we get the square pyramid with all edge lengths equal to $1$. Using those values in those four linear equations in three variables does give us a unique solution, namely
$$\left(\frac 12,\ \frac 12,\ \frac 1{\sqrt 6+\sqrt 2}\right)$$
That gives the first part of my short answer. However, if we use the apex point $f=\frac 12$, $g=h=1$ we get four inconsistent equations with no solution. We can find a sphere to be tangent to any three of the side faces as well as the square base, but none that fits all four side faces and the base. That is the last part of my short answer.
