$T(n)=Tleft(frac{n}{2}right)+n^2$ cost of each level of this tree?

I am confused about this. Can anyone do it with substitution method?

$T(n)=Tleft(frac{n}{2}right)+n^2$

$=Tleft(frac{n}{4}right)+left(frac{n}{2}right)^2+n^2$ (expand $T(left(frac{n}{2}right)$)

$=Tleft(frac{n}{8}right)+left(frac{n}{4}right)^2+left(frac{n}{2}right)^2+n^2$ (expand $Tleft(frac{n}{4}right)$)

$T(n)=n^2+left(frac{n}{2}right)^2+left(frac{n}{4}right)^2+left(frac{n}{8}right)^2+⋯+left(frac{n}{2^{log_2 n}}right)^2 $

$=n^2+frac{n^2}{4}+frac{n^2}{16}+frac{n^2}{64}+⋯$