% hw034.m
% John Burkardt
% Plot the first five Chebyshev polynomials of the second kind.
%
n = 101;
xlist = linspace ( -1.0, +1.0, n );
u0 = ones ( 1, n );
u1 =  2.0 * xlist;
u2 =  4.0 * xlist .^2 -  1.0;
u3 =  8.0 * xlist .^3 -  4.0 * xlist;
u4 = 16.0 * xlist .^4 - 12.0 * xlist .^2 + 1.0;

%clf
hold on
plot ( xlist, u0, 'LineWidth', 3 );
plot ( xlist, u1, 'LineWidth', 3 );
plot ( xlist, u2, 'LineWidth', 3 );
plot ( xlist, u3, 'LineWidth', 3 );
plot ( xlist, u4, 'LineWidth', 3 );
hold off

grid on
xlabel ( '<-- X -->' );
ylabel ( '<-- U(X) -->' );
title ( 'Chebyshev Polynomials of Kind 2' );
print ( '-djpeg', 'hw034.jpg' );
