function [vh,xh] = poiss1d_2P(f,N)
%
%  2nd order 1D Poisson solve with DST 
%  implemented by matrix multiply by P 
%
%  u'' = f,  u(0)=u(1)=0 
%

h = 1/N;          
xh = (0:N)'*h;               % discrete grid
fh = f(xh);
lam = -2*(1-cos(xh(2:N)*pi))/(h^2);  % evals 
P = createP(N); 

fh = fh(2:N);
f_hat = P*fh;       % f_hat, P_inv = P^T =P
v_hat = f_hat./lam; % soln in Fourier space
vh    = P*v_hat;    % soln in physical space
vh = [0; vh; 0];    % append BCs




