Fourier Series

Representing a constant function

fk[x_,k_,a_]:=Sum[4 Sin[(2 j+1)  Pi x/a]/((2j+1) Pi),{j,0,k}]

fk[x,2,3]

Plot[fk[x,0,3],{x,0,3}]

Plot[{1,fk[x,0,3],fk[x,1,3]},{x,0,3}]

Plot[{1,fk[x,0,3],fk[x,20,3]},{x,0,3}]

b[x_,j_,a_]=Sin[(2 j+1) Pi x/a]

Plot[{b[x,0,3],b[x,1,3]},{x,0,3}]

Plot[{1,fk[x,100,3]},{x,0,3},PlotStyle->{{Red},{Thick,Black}},PlotRange->{0,1.3}]

13.2.11

A[x_,j_,a_]=b[x,j,a]
B[y_,j_,a_,b_]=Cosh[(2 j+1) Pi y/a]-Coth[(2 j+1) Pi b/a] Sinh[(2 j+1) Pi y/a]

u[x_,y_,k_,a_,b_]:= Sum[4 A[x,j,a] B[y,j,a,b]/((2j+1) Pi),{j,0,k}]

Plot3D[u[x,y,0,3,2],{x,0,3},{y,0,2}]

Plot3D[u[x,y,1,3,2],{x,0,3},{y,0,2}]

Plot3D[u[x,y,20,3,2],{x,0,3},{y,0,2},PlotRange->{0,1.3}]

Plot3D[u[x,y,100,3,2],{x,0,3},{y,0,2},PlotRange->{0,1.3}]

13.3.3

f[x_,k_,L_]:=Sum[4 Sin[j Pi/2] Cos[j Pi x/L]/(j Pi),{j,1,k}]

Plot[f[x,1,3],{x,0,3}]

Plot[f[x,3,3],{x,0,3}]

Plot[f[x,5,3],{x,0,3}]

Plot[f[x,7,3],{x,0,3}]

Plot[{f[x,7,3],f[x,9,3],f[x,11,3],f[x,13,3],f[x,15,3]},{x,0,3}]

Plot[f[x,105,3],{x,0,3}]

u[x_,t_,k_,L_]:= Sum[4 Sin[j Pi/2] Cos[j Pi x/L] E^(-j^2 Pi^2 t/L^2)/(j Pi),{j,1,k}]

Plot3D[u[x,t,3,3],{x,0,3},{t,0,1}]

Plot3D[u[x,t,5,3],{x,0,3},{t,0,2}]

Plot3D[u[x,t,105,3],{x,0,3},{t,0,2}]