function sol = proj2c(alpha, n)

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

sol = A \ b;
