E inside a metal sphere = 0
dU = 0.5εE2*dV
where dU = small energy which is stored in a small volume dV
U = \int \frac{1}{2}\varepsilon _{o}E^{2}dV
E = \frac{1}{4\pi \varepsilon _{o}}\frac{Q}{r^2}\textup{ where Q = 4}\pi\varepsilon_{o}\textup{VR so E = }\frac{VR}{r^2}
dV = 4\pi r^2dr
(a) Energy from r = R to r = 2R
So, U = \int_{R}^{2R}{\frac{1}{2}\varepsilon_{o}\frac{V^{2}R^{2}}{r^{4}}*4\pi r^{2}dr}
(b) Energy stored outside r = 2R
U = \int_{2R}^{\infty }{\frac{1}{2}\varepsilon_{o}\frac{V^{2}R^{2}}{r^{4}}*4\pi r^{2}dr}