MacLaurin Series
We have seen several cases in which a function can be written 
as a power series.  For example,

                     (1/(   1-x   ))   =       (∑_(n=0)^∞)(x^n)
and

                     (1/(  1+x))       =       (∑_(n=0)^∞)(((-1))^n)(x^n)

Using differentiation  and integration formulas we can show that

                           (e^x)   =   (∑_(n=0)^∞)((x^n)/(n!))

and

          ln(1+x)     =    (∑_(n=1)^∞)(((-1))^(n+1))((x^n)/n)

[integrate both sides of the summation above for 1/(1+x).]                          
In this last case you can use the formula for  ‘ln(1+x)’  to find the expansion for 

                      f(x)    =    1/(((1+x))^k)
                      
by repeated differentiation.

On the other hand consider the following case:  Suppose f(x) is a differentiable function  and 


                   f(x) =   (∑_(n=0)^∞)(Subscript[a, n])  (x^n)
                             
then
 
        f(0) = a[0],    (d/(  dx))f(x)(Subscript[|, x=0])  =  f’(0) = (Subscript[a, 1    ]), ....,       (((d/dx))^n)f(x)(Subscript[|, x=0]) = n!(Subscript[a, n])

        

Therefore, we have 

                   (Subscript[a, n])   =  (f^((n)))(0)/n! ,
                   
                   
and 

        f(x) = (∑_(n=0)^∞)(Subscript[a, n])(x^n)  =   (∑_(n=0)^∞)(f^((n)))(0)  ((x^n)/(n!)) 
        
        
We conclude that this formula applies for any function which has a power 
series expansion at a=0.

Consider

F1[x_]:=Exp[x]
F1[x]
F1p[x_,n_]=D[F1[x],{x,n}]
For[k=0,k<19,k++,A1[k_]:= F1p[x,k]/.x->0.0]
For[k=0,k<19,k++,Print[A1[k]]]

F1as[x_,k_]:=A1[0]+Sum[A1[i]*x^i/Factorial[i],{i,1,k}]
SF1[t_,k_]:= F1as[x,k]/.x ->t

We may plot a function with the following command. Note the set backets that pair functions and also pair the limits.

Animate[Plot[SF1[t,i],{t,-1.5,1.5}, PlotRange -> {-3,3},AspectRatio->Automatic],{i,0,19}]

F2[x_]:=1/(1+x)
F2[x]
F2p[x_,n_]=D[F2[x],{x,n}]
For[k=0,k<29,k++,A2[k_]:=(1/Factorial[k])* F2p[x,k]/.x->0.0]
For[k=0,k<19,k++,Print[A2[k]]]
F2as[x_,k_]:=A2[0]+Sum[A2[i]*x^i,{i,1,k}]
SF2[t_,k_]:= F2as[x,k]/.x ->t
Err2[t_,k_]:=(1/(1+t) )-SF2[t,k ]

Animate[Plot[{SF2[t,i],Err2[t,i]},{t,-0.999,1.0}, PlotRange -> {-0.5,2},AspectRatio->Automatic],{i,0,28}]

Now complete the animation for the Sin[x] function and the error function using the series approximations for i from 0 to 19 following the 
idea presented above.