% Ex 2.14 Scheme 1
function sol = s1(f, n)

h = 1 / (n + 1);
A = diag([2*ones(1, n) 1]) - diag(ones(1, n), 1) - diag(ones(1, n), -1);
b = [h*h * f(1:n) h];

sol = A \ b';
