The Taylor series of f(x)=cosxf(x)=cosx at x=0x=0 is
f(x)=sum_{n=0}^infty (-1)^nx^{2n}/{(2n)!}f(x)=∞∑n=0(−1)nx2n(2n)!.
Let us look at some details.
The Taylor series for f(x)f(x) at x=ax=a in general can be found by
f(x)=sum_{n=0}^infty {f^{(n)}(a)}/{n!}(x-a)^nf(x)=∞∑n=0f(n)(a)n!(x−a)n
Let us find the Taylor series for f(x)=cosxf(x)=cosx at x=0x=0.
By taking the derivatives,
f(x)=cosx Rightarrow f(0)=cos(0)=1f(x)=cosx⇒f(0)=cos(0)=1
f'(x)=-sinx Rightarrow f'(0)=-sin(0)=0
f''(x)=-cosx Rightarrow f''(0)=-cos(0)=-1
f'''(x)=sinx Rightarrow f'''(0)=sin(0)=0
f^{(4)}(x)=cosx Rightarrow f^{(4)}(0)=cos(0)=1
Since f(x)=f^{(4)}(x), the cycle of {1,0,-1,0} repeats itself.
So, we have the series
f(x)=1-{x^2}/{2!}+x^4/{4!}-cdots=sum_{n=0}^infty(-1)^n x^{2n}/{(2n)!}