Fourier Series Solution 13.5.16

a=3
b=2
fone[x_]=x 
ftwo[x_]=a-x
g[y_]=y (b-y)

Aone[j_,x_]=Sin[j Pi x/a]
Btwo[j_,y_]= Sin[j Pi y/b]

ajone[j_]=(2/a)  (Integrate[ fone[x] Aone[j,x],{x,0,a/2}]+Integrate[ ftwo[x] Aone[j,x],{x,a/2,a}])/Sinh[j Pi b/a]

bjtwo[j_]=(2/b)  Integrate[g[y] Btwo[j,y],{y,0,b}]/Sinh[j Pi a/b]

Bone[j_,y_]=ajone[j] Sinh[ j Pi y/a]
Atwo[j_,x_]=bjtwo[j] Sinh[ j Pi x/b]

u[x_,y_,k_]:=Sum[Aone[j,x]  Bone[j,y],{j,1,k}] + Sum[Atwo[j,x]  Btwo[j,y],{j,1,k}]

Plot[{u[x,b,1],u[x,b,2]},{x,0,a}]

Plot[{u[x,b,2],u[x,b,4]},{x,0,a}]

Show[Plot[u[x,b,10],{x,0,a}],Plot[fone[x],{x,0,a/2}],Plot[ftwo[x],{x,a/2,a}],PlotRange->All]

Show[Plot[u[x,b,100],{x,0,a}],Plot[fone[x],{x,0,a/2}],Plot[ftwo[x],{x,a/2,a}],PlotRange->All]

Plot[{fone[x],ftwo[x],u[x,b,3]},{x,-2 a,2 a},PlotRange->{-fone[a/2],fone[a/2]}]

Plot[{g[y],u[a,y,1]},{y,0,b}]

Plot3D[u[x,y,10],{x,0,a},{y,0,b},PlotRange->All]

Plot3D[u[x,y,100],{x,0,a},{y,0,b},PlotRange->All]