f[x_] = Sin[x];
funkcia = 
        Plot[f[x], {x, -2 Pi, 2 Pi}, 
          PlotStyle -> RGBColor[1, 0, 0], 
          DisplayFunction -> Identity];
x0 = 0;
taylor = 
      f[x0] + (D[f[x], {x, 1}] /. x -> x0)*(x - 
              x0)
rozvoj = 
        Plot[taylor, {x, -2 Pi, 2 Pi}, 
          PlotStyle -> RGBColor[0, 1, 0], 
          DisplayFunction -> Identity];
Show[funkcia, rozvoj, 
      DisplayFunction -> $DisplayFunction]

f[x_] = Sin[x];
funkcia = 
        Plot[f[x], {x, -2 Pi, 2 Pi}, 
          PlotStyle -> RGBColor[1, 0, 0], 
          DisplayFunction -> Identity];
x0 = 0;
taylor = 
      f[x0] + (D[f[x], {x, 1}] /. x -> x0)*(x - x0) + 
        1/2 (D[f[x], {x, 2}] /. x -> x0)*(x - x0)^2 + 
        1/3! (D[f[x], {x, 3}] /. 
              x -> x0)*(x - x0)^3
rozvoj = 
        Plot[taylor, {x, -2 Pi, 2 Pi}, 
          PlotStyle -> RGBColor[0, 1, 0], 
          DisplayFunction -> Identity];
Show[funkcia, rozvoj, 
      DisplayFunction -> $DisplayFunction]

f[x_] = Sin[x];
funkcia = 
        Plot[f[x], {x, -2 Pi, 2 Pi}, 
          PlotStyle -> RGBColor[1, 0, 0], 
          DisplayFunction -> Identity];
x0 = 0;
taylor = 
      f[x0] + (D[f[x], {x, 1}] /. x -> x0)*(x - x0) + 
        1/2 (D[f[x], {x, 2}] /. x -> x0)*(x - x0)^2 + 
        1/3! (D[f[x], {x, 3}] /. x -> x0)*(x - x0)^3 + 
        1/4! (D[f[x], {x, 4}] /. x -> x0)*(x - x0)^4 + 
        1/5! (D[f[x], {x, 5}] /. 
              x -> x0)*(x - x0)^5
rozvoj = 
        Plot[taylor, {x, -2 Pi, 2 Pi}, 
          PlotStyle -> RGBColor[0, 1, 0], 
          DisplayFunction -> Identity];
Show[funkcia, rozvoj, 
      DisplayFunction -> $DisplayFunction]

f[x_] = Sin[x];
funkcia = 
        Plot[f[x], {x, -2 Pi, 2 Pi}, 
          PlotStyle -> RGBColor[1, 0, 0], 
          DisplayFunction -> Identity];
x0 = 1;
taylor = 
      f[x0] + (D[f[x], {x, 1}] /. x -> x0)*(x - x0) + 
        1/2 (D[f[x], {x, 2}] /. x -> x0)*(x - x0)^2 + 
        1/3! (D[f[x], {x, 3}] /. x -> x0)*(x - x0)^3 + 
        1/4! (D[f[x], {x, 4}] /. x -> x0)*(x - x0)^4 + 
        1/5! (D[f[x], {x, 5}] /. 
              x -> x0)*(x - x0)^5
rozvoj = 
        Plot[taylor, {x, -2 Pi, 2 Pi}, 
          PlotStyle -> RGBColor[0, 1, 0], 
          DisplayFunction -> Identity];
Show[funkcia, rozvoj, 
      DisplayFunction -> $DisplayFunction]

f[x_] = Sin[x];
funkcia = 
        Plot[f[x], {x, -2 Pi, 2 Pi}, 
          PlotStyle -> RGBColor[1, 0, 0], 
          DisplayFunction -> Identity];
x0 = 0;
Series[f[x], {x, x0, 5}]

Normal[Series[f[x], {x, x0, 5}]]

f[x_] = Sin[x];
funkcia = 
        Plot[f[x], {x, -2 Pi, 2 Pi}, 
          PlotStyle -> RGBColor[1, 0, 0], 
          DisplayFunction -> Identity];
x0 = 1;
taylor = Normal[Series[f[x], {x, x0, 5}]]
rozvoj = 
        Plot[taylor, {x, -2 Pi, 2 Pi}, 
          PlotStyle -> RGBColor[0, 1, 0], 
          DisplayFunction -> Identity];
Show[funkcia, rozvoj, 
      DisplayFunction -> $DisplayFunction]

f[x_] = Sin[x];
funkcia = 
        Plot[f[x], {x, -2 Pi, 2 Pi}, 
          PlotStyle -> RGBColor[1, 0, 0], 
          DisplayFunction -> Identity];
x0 = 1;
taylor = Normal[Series[f[x], {x, x0, 15}]]
rozvoj = 
        Plot[taylor, {x, -2 Pi, 2 Pi}, 
          PlotStyle -> RGBColor[0, 1, 0], 
          DisplayFunction -> Identity];
Show[funkcia, rozvoj, 
      DisplayFunction -> $DisplayFunction]