The radius of the sphere that touches the planes of the lateral faces of a regular quadrilateral pyramid and the sphere circumscribed around the pyramid from the inside can be expressed using the dihedral angle between adjacent lateral faces and the edge of the pyramid's base.

Apply the result to the case where the lateral faces of the pyramid are equilateral triangles.
1. Let the center of the base square $ABCD$ of the regular quadrilateral pyramid $ABCDM$ be denoted by $N$, the length of the base edge $AD$ by $a$, the midpoint of $AD$ by $F$, and the centers and radii of the circumscribed sphere $G$ and the desired sphere $G_1$ by $O$, $R$, and $O_1$, $\varrho$, respectively. Furthermore, let the given dihedral angle be denoted by $\alpha$, the angle $FMO$ by $\varphi$, and the angle $DMO$ by $\delta$.

The pyramid is symmetric with respect to the plane $DMO=S$ and the plane $FMO=S_1$. The latter is perpendicular to the lateral face plane $ADM=L$. The reflection in $S_1$ maps the vertex pair $A$ and $D$ onto each other and the entire figure onto itself, so it also maps the points of tangency $M_1$ and $E$ of $G_1$ with $G$ and $L$ onto each other. Therefore, $E$ lies on the intersection of $L$ and $S_1$, the line $MF$, and $M_1$ is the point diametrically opposite to $M$ on $G$, and $O_1$ lies on $MO$.

In the right triangle $O_1EM$,

$$
\sin \varphi = \frac{O_1E}{MO_1} = \frac{O_1E}{MM_1 - O_1M_1} = \frac{\varrho}{2R - \varrho}
$$

from which

$$
\varrho = \frac{2R}{\frac{1}{\sin \varphi} + 1}
$$

1984-03-110-1.eps

Let the projection of $A$ onto the line $MD$ be $P$. By symmetry with respect to $S$, this is also the projection of $C$, so $\angle APC = \alpha$. From the isosceles triangle $APC$,

$$
\cot \frac{\alpha}{2} = \frac{PN}{AN} = \frac{PN}{DN} = \cos \angle NDP = \cos \delta.
$$

To find a relationship between $\varphi$ and $\delta$ for (1):

$$
\tan \varphi = \frac{FN}{MN} = \frac{DN}{\sqrt{2}MN} = \frac{1}{\sqrt{2}} \tan \delta
$$

Furthermore, for $2R$ and the known base edge $AD = a$ from the right triangle $DMM_1$:

$$
2R = \frac{DM}{\cos \delta} = \frac{DN}{\cos \delta \sin \delta} = \frac{a}{\sqrt{2} \cos \delta \sin \delta}
$$

So far, we have that with numerical data, $\alpha$ can be used to calculate $\delta$ from (2), $\varphi$ from (3), and $2R$ from (4) using the edge $a$, and then $\varrho$ can be calculated from (1).

In the following, we will express $\varrho$ directly in terms of $a$ and $\alpha$. On one hand,

$$
\sin \delta = \sqrt{1 - \cos^2 \delta} = \sqrt{1 - \cot^2 \frac{\alpha}{2}} = \sqrt{1 - \frac{1 + \cos \alpha}{1 - \cos \alpha}} = \sqrt{\frac{-2 \cos \alpha}{1 - \cos \alpha}}
$$

Thus, the denominator in (4) is

$$
\sqrt{\frac{2(1 + \cos \alpha)}{1 - \cos \alpha} \cdot \frac{-2 \cos \alpha}{1 - \cos \alpha}} = \frac{2 \sqrt{-\cos \alpha (1 + \cos \alpha)}}{1 - \cos \alpha}
$$

Furthermore, for the denominator in (1):

$$
\begin{aligned}
\frac{1}{\sin \varphi} = \sqrt{\frac{1 + \tan^2 \varphi}{\tan^2 \varphi}} & = \sqrt{\frac{2}{\tan^2 \delta} + 1} = \sqrt{\frac{2 \cos^2 \delta}{1 - \cos^2 \delta} + 1} = \sqrt{\frac{\cos^2 \delta + 1}{1 - \cos^2 \delta}} = \\
& = \sqrt{\frac{\cot^2 \frac{\alpha}{2} + 1}{1 - \cot^2 \frac{\alpha}{2}}} = \sqrt{\frac{1}{-\cos \alpha}}
\end{aligned}
$$

Therefore, from (1),

$$
\varrho = \frac{a(1 - \cos \alpha)}{2 \sqrt{1 + \cos \alpha}(1 + \sqrt{-\cos \alpha})}
$$

The given $\alpha$ is always an obtuse angle, so $-\cos \alpha > 0$. Indeed, for a fixed $R$, as $N$ approaches $M$, $\alpha$ approaches $180^\circ$. If $N$ approaches $M_1$, $\alpha$ approaches $90^\circ$.

2. In the special case, our pyramid is half of a regular octahedron, and $N$ coincides with $O$. Then the lateral faces form an angle $\alpha / 2$ with the base plane:

$$
\cos \frac{\alpha}{2} = \frac{a / 2}{a \sqrt{3} / 2} = \frac{1}{\sqrt{3}}, \quad \cos \alpha = 2 \cos^2 \frac{\alpha}{2} - 1 = -\frac{1}{3}
$$

and

$$
\varrho = \frac{a}{\sqrt{2}}(\sqrt{3} - 1) = R(\sqrt{3} - 1)
$$

3. We will also show that if $90^\circ < \alpha < 180^\circ$, then the sphere $G_1$ always exists, or rather, there is a suitable internal point $O_1$ on the segment $OM_1$. Consider the projection $H$ of $O$ onto the ray $MF$. Then $OH = R \sin \varphi < R = OM_1$, so the sphere centered at $O$ and tangent to the lateral faces of the pyramid does not touch $G$. As a point $O_1^*$ moves from $O$ to $M_1$, $O_1^*H^*$ increases monotonically and continuously, while $O_1^*M_1$ decreases continuously to $O$, so at some point the equality $O_1^*H^* = O_1^*M_1$ holds exactly once.