function OrtogonalitaCebysevovychPolynomu()

syms x
w = 1/sqrt(1-x^2);

figure
N = 5;
for k=0:N
    if k==0
        T{1} = 1;
    elseif k==1
        T{2} = x;
    else
        T{k+1} = 2*x*T{k}-T{k-1};
    end
    for j=0:k
        log = sprintf('(T_%d,T_%d)=%g',j,k,eval(int(w*T{j+1}*T{k+1},x,-1,1)));
        disp(log);
    end
    hold on;
    xx = -1:0.1:1; yy = eval(subs(T{k+1},xx));
    plot(xx,yy)
    pause
end

