Fourier Series Solution 13.2.11

f[y_]=1

a[j_,M_]=(2/M)Integrate[ f[y] Cos[(2 j+1) Pi y/(2 M)],{y,0,M}]

fk[y_,k_,M_]:=Sum[a[j,M] Cos[(2 j+1) Pi y/(2 M)],{j,0,k}]

Plot[{f[y],fk[y,1,2],fk[y,2,2]},{y,0,2}]

Plot[{f[y],fk[y,20,2]},{y,0,2},PlotRange->All,AxesOrigin->{0,0}]

Plot[{f[y],fk[y,20,2]},{y,-4,4},PlotRange->All,AxesOrigin->{0,0}]

b[j_,L_,M_]=a[j,M]/Cosh[(2 j+1) Pi L/(2 M)]

B[y_,j_,M_]=Cos[(2 j+1) Pi y/(2 M)]

Here was the error:  The frequency for the A = A(x) solution is determined by and is the same as that of the B = B(y) solution.  Thus, were I had previously divided by (2L), I should really divide 
by (2M).

A[x_,j_,M_]= Cosh[(2 j+1) Pi x/(2 M)]

u[x_,y_,k_,L_,M_]:=Sum[b[j,L,M] A[x,j,M] B[y,j,M],{j,0,k}]

Plot3D[u[x,y,10,4,2],{x,0,4},{y,0,2}]