3. The slant height of a cone is $l$, and the angle it forms with the base is $\theta$. The edge length of the inscribed cube in this cone is $\qquad$ (the cube has 4 vertices on the base of the cone and 4 vertices on the lateral surface of the cone).
$3 \cdot \frac{2 l \sin \theta}{2+\sqrt{2} \tan \theta}$.
As shown in Figure 7, consider the axial section, we have
$$
\begin{array}{l}
S A=l, \\
\angle S A B=\theta, \\
A O=l \cos \theta .
\end{array}
$$

Let the edge length of the cube be $x$, then $D O=\frac{\sqrt{2}}{2} x, A D=$ $l \cos \theta-\frac{\sqrt{2}}{2} x$. By the definition of the tangent function, we have
$$
\tan \theta=\frac{C D}{A D}=\frac{x}{l \cos \theta-\frac{\sqrt{2}}{2} x},
$$

which gives $x=\frac{2 / \sin \theta}{2+\sqrt{2} \tan \theta}$.