
clc, clear

syms x
T0 = 1;
T1 = x;
fprintf('T0=%d, T1=%s\n',T0,T1);

xx=-1:0.01:1;

hold on
plot(xx,subs(T0,xx),'Linewidth',2)
plot(xx,subs(T1,xx),'Linewidth',2)

for n=1:4
    
    T = 2*x*T1-T0;
    T0 = T1;
    T1 = T;
    plot(xx,subs(T1,xx),'Linewidth',2);
    fprintf('T%d=%s\n',n+1,simplify(T));
    
end

legend('T0','T1','T2','T3','T4','T5','Location','southeast')