Periodic BC: Convergence

Consider the periodic problem (Subscript[u, xx])=f on the interval 0<x<2π with n internal points.

Δx=((2π)/(n+1))
(Subscript[x, i])=0+i*Δx
Equations are:
	(Subscript[u, 0])=(Subscript[u, n+1])
	(Subscript[u, i-1])-2(Subscript[u, i])+(Subscript[u, i+1])=((Δx)^2)(Subscript[f, i])  for interior points
	
Eliminate (Subscript[u, n+1])  for periodic we need the equation at 0.  The equation at i=0 aka i=n+1
is
	(Subscript[u, n])-2(Subscript[u, 0])+(Subscript[u, 1])=((Δx)^2)(Subscript[f, 0])
	
We wind up with an (n+1) by (n+1)  matrix.  Here is the matrix AP and the RHS fP for the periodic boundary conditions.

fP[n_,f_]:=Module[
{Δx,i},
Δx=((2.0π)/(n+1));
((Δx)^2)Table[f[i*Δx],{i, 0,n}]
]
AP[n_]:=SparseArray[
{
Band[{1,1}]->-2.0,
Band[{1,2}]->1.0,
Band[{2,1}]->1.0,
{1,n+1}->1.0,
{n+1,1}->1.0
},
{n+1,n+1}
];

Clear[f,x,uExact]
n=10;
f[x_]=4Sin[3 x] + 2Sin[2x];
uExact[x_]= ((-4)/(3^2))Sin[3 x] - (2/(2^2))Sin[2x];
x=LinearSolve[AP[n],fP[n,f]];
x=x-Mean[x];
Show[
Plot[uExact[x],{x,0,2π},
PlotStyle->Red],
 ListPlot[x,
Joined->True,
Mesh->All,
DataRange->{0,2π (1-(1/(n+1)))}],
PlotRange->All
]
Norm[x-Table[uExact[i* ((2.0π)/(n+1))],{i,0,n}]]

I want to know how much better it gets if I do more work.

DHG/DFG BC: Convergence

Consider the problem (Subscript[u, xx])=f on the interval 0<x<2π with n internal points and
Neumann Condition (Subscript[u, x])(0)=0 
and 
Dirichlet Condition u(1)=0 .

As always for n internal points
	Δx=((2π)/(n+1))
	(Subscript[x, i])=0+i*Δx
Equations are:
	(Subscript[u, 0])-(Subscript[u, 1])=0  			discretization of (Subscript[u, x])(0)=0.
	(Subscript[u, i-1])-2(Subscript[u, i])+(Subscript[u, i+1])=((Δx)^2)(Subscript[f, i])  	discretization of (Subscript[u, xx])((Subscript[x, i]))=f((Subscript[x, i]))
	(Subscript[u, n+1])=0			discretization of u(1)=0
We can either eliminate (Subscript[u, n+1])  and solve an n+1 dimensional system or leave it in there and solve an n+2 dimensional system.  Six of one half a dozen of the other.
I am going to do the n+2 dimensional version.  Here is the matrix AND and the RHS fND for these ND boundary conditions.

fND[n_,f_]:=Module[
{Δx,i,Temp},
Δx=((2.0π)/(n+1));
Temp=((Δx)^2)Table[f[i*Δx],{i, 0,n+1}];
Temp[[1]]=0;  (* Setting the RHS for the Homogeneous Neumann Condition*) 
Temp[[-1]]=0;(* Setting the RHS for the Homogeneous Dirichlet Condition*)
Temp
]
AND[n_]:=SparseArray[
{
Band[{2,2},{n+1,n+1}]->-2.0,
Band[{1,2},{n+1,n+1}]->1.0,
Band[{2,1},{n+1,n+1}]->1.0,
{1,1}->1.0, {1,2}->-1.0,
{n+2,n+2}->1.0
},
{n+2,n+2}
];

Clear[f,x,uExact]
uExact[x_]= (x^2)(x-2π)  (* Cos[4 x]Sin[(E^(0.8x))] *)
f[x_]=D[uExact[x],{x,2}]
n=123;
x=LinearSolve[AND[n],fND[n,f]];
Show[
Plot[uExact[x],{x,0,2π},
PlotStyle->Red],
 ListPlot[x,
Joined->True,
Mesh->All,
DataRange->{0,2π }],
PlotRange->All
]
Error=x-Table[uExact[i* ((2.0π)/(n+1))],{i,0,n+1}];
Norm[Error,2]
Norm[Error,∞]

I want to know how much better it gets if I do more work.