CONTEXT: Uni question made up by lecturer
So I have found the Maclaurin series of $f(x)=x^2e^{x^2}$ to be $\sum_{n=0}^\infty \frac{x^{2n+2}}{n!}$ which can be rewritten as $\sum_{n=0}^\infty x^{n+2}\frac{x^n}{n!}$, which means $f^{(n)}(0)=x^{n+2}$.
From this, I've found $f^{(6)}(0)=x^{6+2}=x^{8}$, which I know to be incorrect as a calculator will tell you that $f^{(6)}(0)=360$.
Can someone please direct me as to where I went wrong? Thanks!
It is not correct to say that $\sum_{n=0}^\infty x^{n+2}\frac{x^n}{n!}$ means that $f^{(n)}(0)=x^{n+2}$. Note that $f^{(n)}(0)$ is supposed to be a number. On the other hand,$$\sum_{n=0}^\infty\frac{x^{2n+2}}{n!}=\sum_{n=1}^\infty\frac{x^{2n}}{(n-1)!}.$$So, $f^{(n)}(0)=0$ if $n$ is odd or if $n=0$. On the other hand, if $n$ is even and greater than $0$, then$$\frac{f^{(n)}(0)}{n!}=\frac1{\left(\frac n2-1\right)!}.$$In other words,$$f^{(n)}(0)=\frac{n!}{\left(\frac n2-1\right)!}.$$In particular,$$f^{(6)}(0)=\frac{6!}{2!}=\frac{720}2=360.$$