function [A, b] = poisson2(n)

h = 1 / (n + 1);
A = full(gallery('poisson', n));

Y = h * meshgrid(1 : n);
X = Y';

B = 5 * pi^2 * h^2 * sin(2 * pi * X) .* sin(pi * Y);
b = reshape(B, n^2, 1);

