Taylor Series

Goal is to see how well Taylor Series approximate functions

For definiteness, will do Cos[x]

coeff[x0_,n_] := If[Mod[n,4] == 0, Cos[x0],
If[Mod[n,4] == 1, - Sin[x0],
If[Mod[n,4] == 2, - Cos[x0], Sin[x0]]
]];
approx[x_,x0_,n_] := Sum[coeff[x0, nn](x-x0)^nn/nn!,{nn,0,n}]

Manipulate[Plot[{Cos[x], approx[x,x0,n]}, {x,x0 - 2 Pi c, x0 + 2 Pi c}, Epilog -> {PointSize[.025], Point[{x0,Cos[x0]}]}], {x0,0, 20 Pi/2}, {n,1,40}, {c,4,.01}]