Problem: for a given function plot some of its Taylor
polynomials. This is interesting to see how Taylor
polynomials approximate the given function. Here we will
use the function y=sin(x).
taylorPol := proc(expr, var, n)
local u, i, newexpr;
begin
u := taylor(expr,var,n);
newexpr := 0;
for i from 0 to n-1 do
newexpr := newexpr + coeff(u,i)*x^i
end;
return(newexpr)
end: