Plot[
      x^3 - 2  x^2 - 5, {x, 1, 
        4}]

Plot[x^3 + 3  x^2 - 1, {x, -3, -2}]

Plot[x - Cos[x], {x, 0, Pi/2}]

Plot[x - 0.8 - 0.2  Sin[x], {x, 0, Pi/2}]

f[x_] :=  Sin[3  x]

g = D[f[x], {x, 1}]

g /. x -> Pi

T

Taypol[n_, 
        a_] := (
T = 
          0; 
x =. ; 
For[i = 0,  
          i ≤ n, 
          i = i + 1, 
dd = 
            D[f[x], {x, i}]; 
cc =  
            dd /.  x -> a; 
T = 
            T +  cc (x - a)^i/(i!)])

Taypol[1, 1]

T

Plot[{T, f[x]}, {x, 0, 
        2  Pi}]

For[k = 1, 
      k ≤ 10, k++, 
Print[
        N[3^k/(k!)]]]

Taypol[8, 1]

T

Plot[{f[x], T}, {x, 0, 2  Pi}]

Bernpol[n_, a_, 
        b_] := (
BB = 
          0; 
x =. ; 
z = (x - 
                a)/(b - a); 
For[k = 0, 
          k ≤ n, k++, 
BB  =  
            BB + Binomial[n, k]  z^k (1 - z)^(n - k) f[
                  a + (b - a) (k/n)]]; 
Plot[{f[x], 
            BB}, {x, a, b}])

Bernpol[3, 0,  Pi/4]

BB

f[x]

f[x_] :=  3  x^4 - 5  x^3 - 3  x + 2

Plot[f[x], {x, -3, 3}]

Bernpol[10, -1, 2]

Factor[BB]