% Memory allocation.
A = zeros(55, 55);

% For all values of degree n.
for n = 10:1:55
[x, y] = tau('ChebyshevT', [0 1], n);

% Define equation.
equation = ['cos(x)*diff(y, 2)-sin(x^3-x)*diff(y)+', ...
            'exp(0.5*x^2)*y-cosh(x)*volt(y, ''sin(x-4*t)'')+', ...
            'sinh(x)*fred(y, ''cos(t^2-x)'')=exp(sin(x^3-x)+x^2)'];

% Solve the problem.
a = tausolver(x, y, equation, {'y(0)=1';'y(1)=0'}, 'resid', 0, 'apsol', 0);

% Store the coefficients.
A(1:n, n) = a;

end

% Set and plot the results.
R = zeros(54,2); for n = 10:54, R(n,1)=norm(A(1:n+1,n)-A(1:n+1,n+1));
R(n,2)=max(verapproximation(x, equation, A(1:n+1,n), 0.01)); end
semilogy(11:55, R(10:54,1)), hold on, semilogy(11:55, R(10:54,2))