Answer
$V=3a(a+b)(a-b)$
Work Step by Step
The larger rectangular prism has volume=(base area)$\times$height,
$V_{1}=a^{2}(3a)=4a^{3}$
The inner rectangular prism has volume
$V_{2}=b^{2}(3a)=3ab^{2}$
The volume we are after is
$V=V_{1}-V_{2}=3a^{3}-3ab^{2}$
$=3a(a^{2}-b^{2})\qquad$... a difference of squares,
$V=3a(a+b)(a-b)$