Volume of pyramid:

$V_P = \frac{1}{3} x^2 h$

From the figure:

$\sin \theta = \dfrac{h - a}{a}$

$h = a + a \sin \theta$

$h = a (1 + \sin \theta)$

$z = a \cos \theta$

$z^2 = (x/2)^2 + (x/2)^2 = x^2/2$

$(a \cos \theta)^2 = x^2/2$

$x^2 = 2a^2 \cos^2 \theta$

$V_P = \frac{1}{3}(2a^2 \cos^2 \theta)[\, a (1 + \sin \theta) \,]$

$V_P = \frac{2}{3}a^3 \cos^2 \theta (1 + \sin \theta)$

$\dfrac{dV_P}{d\theta} = \frac{2}{3}2a^3 [\, \cos^2 \theta (\cos \theta) + (1 + \sin \theta)(-2\cos \theta \sin \theta) \,] = 0$

$\cos^3 \theta - 2\cos \theta \sin \theta (1 + \sin \theta) = 0$

$\cos^2 \theta - 2 \sin \theta (1 + \sin \theta) = 0$

$(1 - \sin^2 \theta) - 2 \sin \theta - 2\sin^2 \theta = 0$

$1 - 2 \sin \theta - 3\sin^2 \theta = 0$

$(1 - 3 \sin \theta)(1 + \sin \theta) = 0$

for

$1 - 3 \sin \theta = 0$

$\sin \theta = 1/3$

for

$1 + \sin \theta = 0$

$\sin \theta = -1$ → (meaningless)

use

$\sin \theta = 1/3$

use $\sin \theta = 1/3$

$V_P = \frac{2}{3}a^3 \cos^2 \theta (1 + \sin \theta)$

$V_P = \frac{2}{3}a^3 (\frac{2\sqrt{2}}{3})^2 (1 + \frac{1}{3})$

$V_P = \frac{64}{81}a^3$

Volume of sphere:

$V_S = \frac{4}{3} \pi a^3$

$\text{Material saved } = \dfrac{V_P}{V_S} \times 100\%$

$\text{Material saved } = \dfrac{\frac{64}{81}a^3}{\frac{4}{3}\pi a^3} \times 100\%$

$\text{Material saved } = 18.86\%$ *answer*