3. A right quadrilateral prism is given with a base edge of $2 a$ and height $a(1+\sqrt{3})$. A sphere passes through the four vertices of the lower base and touches the upper base. Determine the area of the part of the prism that is inside the sphere.
Solution. Let $A, B, C, D, A_{1}, B_{1}, C_{1}, D_{1}$ be the vertices of the given prism, where the base is the square $A B C D$ with side $2 a$, and $A A_{1}, B B_{1}, C C_{1}, D D_{1}$ are the edges of the prism with length $a(1+\sqrt{3})$. Furthermore, let $S$ be the intersection of the diagonals of the square $A B C D$, $S_{1}$ be the intersection of the diagonals of the square $A_{1} B_{1} C_{1} D_{1}$, $O$ and $R$ be the center and radius of the given sphere, respectively, and $x=O S$ (see the diagram on the right). Triangle $OSB$ is a right triangle with a right angle at vertex $S$, so

$$
\begin{aligned}
& S_{1} S-S_{1} O=x=\sqrt{O B^{2}-B S^{2}} \\
& ((1+\sqrt{3}) a-R)^{2}=R^{2}-2 a^{2} \\
& R=a \sqrt{3} \\
& x=a
\end{aligned}
$$

If $A_{2}, B_{2}, C_{2}, D_{2}$ are points on the edges $A A_{1}, B B_{1}, C C_{1}, D D_{1}$, respectively, such that $A A_{2}=B B_{2}=C C_{2}=D D_{2}=2 a$, then $A B C D A_{2} B_{2} C_{2} D_{2}$ is a cube, and the given sphere is circumscribed around this cube. The part of the area of the side $A B B_{1} A_{1}$ of the prism that lies inside the circle circumscribed around the square $A B B_{2} A_{2}$ is equal to

$$
(2 a)^{2}+\frac{1}{4}\left((a \sqrt{2})^{2} \pi-(2 a)^{2}\right)=\frac{a^{2} \pi}{2}+3 a^{2}
$$

The part of the area of the prism that lies inside the sphere is equal to

$$
4\left(\frac{a^{2} \pi}{2}+3 a^{2}\right)+4 a^{2}=2 a^{2}(8+\pi)
$$