I am reading the Feynman books. In 8.1, we have shown that the energy of a charged sphere of radius $a$ is $$U = \frac{4\pi\rho^2a^5}{15\epsilon_0}.$$
I tried to get this result using the following formula $$U=\frac{\epsilon_0}{2}\iiint E^2\,dV.$$ Through Gauss theorem, we can write that for $r < a$, $$E=\frac{Q_{int}}{S\cdot\epsilon_0}=\frac{\rho r}{3 \epsilon_0}.$$ So I tried to integrate it to get the energy. First, we can say that $dV = 4\pi r^2\,dr$
Thus we got: $$U=\frac{\epsilon_0}{2}\int_0^a \left(\frac{\rho r}{3\epsilon_0}\right)^2 4\pi r^2\,dr $$ $$U=\frac{4\pi\rho^2a^5}{45 \epsilon_0}$$
I got a result 3 times too small and I don't understand why. If someone can explain to me where am I wrong :).
EDIT: Taking account of the comment of @mmesser314, I tried to integrate from infinity to a. Now, since $r>a$, $E=\frac{a^3\rho}{3\epsilon_0 r^2}.$
Integrating it from $\infty$ to $a$ gives me $$U=\frac{2\pi\rho^2a^5}{9 \epsilon_0}.$$