%nhap dieu kien de bai a, b, h
a = 0;
b = 1;
h = 0.1;
n = (b-a)/h;
x = [a:h:b];
%tinh vector Y
y = zeros(n+1,1); %tao ma tran 0 y
y(1) = 0; %gan dieu kien bien dau
y(2:n) = 12*x(2:n).^2.*h^2;
y(n+1) = 0; %gan dieu kien bien cuoi
%tao ma tran A
A = zeros(n+1,n+1); %tao ma tran 0 A
for i = 2:n
    A(i,i-1) = 1; %tao 3 duong cheo
    A(i,i) = -2;
    A(i,i+1) = 1;
end
A(1,1) = 1; %chinh sua 2 dau
A(n+1,n+1) = 1;
%giai phuong trinh A*x = y
x = A\y
