Fourier Series Solution 13.2.11

Coefficients to represent the even extension

f[y_]=1

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

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

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

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

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

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

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

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

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

solution

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

Plot3D[u[x,y,10,2,4],{x,0,4},{y,0,2},PlotRange->All]

Plot3D[u[x,y,20,2,4],{x,0,4},{y,0,2},PlotRange->All]

Plot3D[u[x,y,40,2,4],{x,0,4},{y,0,2},PlotRange->All]

Plot3D[u[x,y,60,2,2],{x,0,2},{y,0,2},PlotRange->All]