close all;
clear all;
L = 4;
x = linspace(0,4,1000);
for t=0:.1:6
    u = zeros(1,1000);

    for n=1:10
        b(n) = 2/L*(4/(3*n^2*pi^2)*(3*n*pi*cos(n*pi/4) + ...
            4*sin(n*pi/4)) - ...
            4/(n^2*pi^2)*(n*pi*cos(n*pi/4)-4*sin(n*pi/4)))
        u = u + b(n)*sin(n*pi*x/L)*cos(n*pi*t/4);
    end
    figure;
    plot(x,u);
    axis([0 4 -1 1])
end