ok so where did I go wrong..$\displaystyle \int{cos(mx^2)^2dx}$...

so I first did this $\displaystyle \int{cos(mx^2)^2dx}=\int{\frac{1+cos(2mx^2)}{2}dx}$...so then I seperated it to get

$\displaystyle \int{\bigg[\frac{1}{2}+\frac{cos(2mx^2)}{2}dx\bigg]}$$\displaystyle \Rightarrow{\int{\frac{1}{2}dx}+\int{\frac{cos(2mx ^2)}{2}dx}\Rightarrow{\frac{x}{2}+\int{\frac{cos(2 mx^2)}{2}dx}}}$

Then using substitution by power series I got

$\displaystyle \frac{x}{2}+\int\frac{\sum_{n=0}^{\infty}\frac{(-1)^n\cdot(2mx^2)^{2n}}{(2n)!}}{2}dx\Rightarrow\fra c{x}{2}+\int\sum_{n=0}^{\infty}\frac{(-1)^{n}\cdot{m^{2n}}\cdot{2^{2n-1}}\cdot{x^{4n}}}{(2n)!}dx$

...then I went

$\displaystyle \frac{x}{2}+\sum_{n=0}^{\infty}\frac{(-1)^{n}\cdot{m^{2n}}\cdot{2^{2n-1}}\cdot{x^{4n+1}}}{(4n+1)(2n)!}$

...could someone point out my mistake...thanks