u_{tt}(x,t)=u_{xx}(x,t),   0<x<Pi, t>0,
u(x,0) = f(x), u_t(x,0)=0,  0<x<Pi,
u_x(0,t)=u_x(Pi,t)=0,  t>0
の解を
f(x) = Cos(x),  Cos(3x),  ... 
に対して作り表示する

u1[x_,t_]:=Cos[x]*Cos[t]

Plot[u1[x,0],{x,0,Pi},Frame->True,FrameTicks->{{{-1,0,1},None},{{0,Pi/2,Pi},None}}]

Plot3D[u1[x,t],{x,0,Pi},{t,0,2Pi},AxesLabel->Automatic]

Animate[Show[Graphics[Table[Point[{x,0.7*u1[x,t]}],{x,0,π,π/20}]]],{t,0,2Pi}]

Animate[Show[Graphics[Table[Point[{x-0.7*u1[x,t],0}],{x,0,2π,π/20}]]],{t,0,2Pi}]

u3[x_,t_]:=Cos[3x]*Cos[3t]

Plot[u3[x,0],{x,0,Pi},Frame->True,FrameTicks->{{{-1,0,1},None},{{0,Pi/2,Pi},None}}]

Plot3D[u3[x,t],{x,0,Pi},{t,0,2Pi},AxesLabel->Automatic]

Animate[GraphicsGrid[{{Show[Graphics[Table[Point[{x,0.7*u3[x,t]}],{x,0,π,π/20}]]]},{Show[Graphics[Table[Point[{x-0.5*u3[x,t],0}],{x,0,π,π/20}]]]}}],{t,0,2Pi}]

uk[x_,t_]:=Pi/2-4/Pi(Cos[x]*Cos[t]+(1/3^2)Cos[3x]*Cos[3t]+(1/5^2)Cos[5x]*Cos[5t])

Plot[{uk[x,0],x},{x,0,Pi},Frame->True,FrameTicks->{{{0,Pi/2},None},{{0,Pi/2,Pi},None}}]

Plot3D[uk[x,t],{x,0,Pi},{t,0,2Pi},AxesLabel->Automatic,BoxRatios->{Pi,2 Pi,Pi}]

Animate[GraphicsGrid[{{Show[Graphics[Table[Point[{x,0.7*uk[x,t]}],{x,0,π,π/20}]]]},{Show[Graphics[Table[Point[{x-0.5*uk[x,t],0}],{x,0,π,π/20}]]]}}],{t,0,2Pi}]

FourierCosCoefficient[Pi/2-Abs[x-Pi/2],x,n]

u[x_,t_]:=Pi/8-8/Pi(((Cos[((2π)/2)] ((Sin[((2 π)/4)])^2))/(2^2))Cos[2x]*Cos[2t]+(( Cos[((4π)/2)] ((Sin[((4π)/4)])^2))/(4^2))Cos[4x]*Cos[4t]+((Cos[((6 π)/2)] ((Sin[((6 π)/4)])^2))/((6^2) ))Cos[6x]*Cos[6t])

Plot3D[u[x,t],{x,0,Pi},{t,0,2Pi},AxesLabel->Automatic,BoxRatios->{Pi,2 Pi,Pi}]