The volume of the cylinder is [tex] \pi r^2 h[/tex]. The volume of a sphere is [tex] \frac 4 3 \pi r^3 [/tex]. In our problem r is the same for both the cylinder and the sphere.
[tex] \pi r^2 h - \frac 4 3 \pi r^3 = \pi(2^2(3) - \frac 4 3 2^3) = \pi(12 - 32/3) = \frac 4 3 \pi \approx 4.19 \textrm{ cubic inches}[/tex]
Answer: 4.19 cubic inches