Wave Equation

Zero Initial Velocity

f[x_]:=Exp[-x^2]
u[t_,x_]:=1/2*f[x-t]+1/2*f[x+t];

Plot[{u[0,x],u[1,x],u[2,x]},{x,-4,4},PlotStyle->Thick,AxesLabel->{"x","u(t,x)"},LabelStyle->Directive[Black, Large],PlotRange->{-1,2}]

DensityPlot[u[t,x],{x,-3,3},{t,0,3},ColorFunction->"TemperatureMap",PlotLegends->Automatic,PlotPoints->200]

Animate[Plot[u[t,x],{x,-5,5},PlotRange->{-1/2,1},PlotStyle->Thick,AxesLabel->{"x","u(t,x)"},LabelStyle->Directive[Black, Large]],{t,0,5},AnimationRunning->False]

Zero Initial Position

Integrate[Exp[-s^2],{s,x-t,x+t}]

u[t_,x_]:=(1/2) (Sqrt[π]) (Erf[t-x]+Erf[t+x]);

Plot[{u[0,x],u[1,x],u[2,x]},{x,-4,4},PlotStyle->Thick,AxesLabel->{"x","u(t,x)"},LabelStyle->Directive[Black, Large],PlotRange->{-1,2}]

DensityPlot[u[t,x],{x,-3,3},{t,0,3},ColorFunction->"TemperatureMap",PlotLegends->Automatic,PlotPoints->200]

Animate[Plot[u[t,x],{x,-5,5},PlotRange->{-1/2,3},PlotStyle->Thick,AxesLabel->{"x","u(t,x)"},LabelStyle->Directive[Black, Large]],{t,0,5},AnimationRunning->False]