Partial Differential Equations (PDEs)
y=y(x,t)

Definition

pde=D[y[x,t],{x,2}]-v^2 D[y[x,t],{t,2}]==0

Analytic Solution

sol=DSolve[pde,y,{x,t}]

yy=y[x,t]/.sol[[1]] //PowerExpand

Initial value problem - analytic solution

IVP={pde,y[x,0]==Exp[-x^2], Derivative[0,1][y][x,0]==0, y[-6,t]==y[6,t]}
sol=DSolve[IVP,y,{x,t}]

Numerical Solution

nsol=NDSolve[IVP/.v->1,y,{x,-6,6},{t,0,8}]

yyy[x_,t_]=y[x,t]/.nsol[[1]]

Plot[yyy[x,0],{x,-6,6}, PlotRange->{0,1}]
Plot[yyy[x,1],{x,-6,6}, PlotRange->{0,1}]

Plot3D[yyy[x,t],{x,-6,6},{t,0,8}, PlotPoints->40]

Example 2

pde=D[y[x,t],{x,2}]-2 D[y[x,t],{t,2}]==2  Sin[3 t] 
IVP={pde,y[x,0]==Exp[-x^2], Derivative[0,1][y][x,0]==0, y[-6,t]==y[6,t]};
nsol=NDSolve[IVP,y,{x,-6,6},{t,0,5}];
yyy[x_,t_]=y[x,t]/.nsol[[1]]
Plot3D[yyy[x,t],{x,-6,6},{t,0,5}, PlotPoints->40]