Why my calculations aren't right? (Maclaurin series) Good evening to everyone!
I tried to calculate $ \cos\left( x- \frac{x^3}{3} + o(x^4)\right) $ using the MacLaurin series but instead of getting the final result equal to $1 - \frac{x^2}{2}+\frac{3x^4}{8} + o(x^4)$ I got this:
$$
\cos\left( x- \frac{x^3}{3} + o(x^4)\right) = 1-\frac{\left(x-\frac{x^3}{3}+o\left(x^4\right)\right)^2}{4}+o\left(x^5\right) = 1-\frac{x^2+\frac{x^6}{9}+o\left(x^8\right)-\frac{2x^4}{3}+2xo\left(x^4\right)-\frac{2x^3o\left(x^4\right)}{3}}{4}+o\left(x^5\right) = 1-\frac{x^2}{4}+\frac{x^6}{36}-\frac{x^4}{6}+o\left(x^4\right)
$$
Where for expanding what's between the parenthesis I'm using the formula $(a-b+c)^2 = a^2+b^2+c^2-2ab+2ac-2bc $.
I would really want to know where I'm doing wrong. Thanks for any possible answers.

In the first line you should consider the third part of MacLaurin series of $cos(u)$ which is $+\frac{u^4}{4!}$. This way, you would get the right result. 
In fact, by now, your first line is not correct because there are some coefficient of $x^4$ in $\frac{(x-\frac{x^3}{3}+o(x^4))^4}{4!}$.
Moreover the second term of MacLaurin series of $cos(u)$ is $-\frac{x^2}{2!}$. You need to correct this as well.
