ϕ[n_,x_]:=(Sqrt[(2/L)])Sin[((n π)/L)x]
(1/(Sqrt[b]))Integrate[ϕ[n,x]Exp[I p x],{x,a,a+b}]

c[n_]:=((Sqrt[2]) (E^(I a p)) (-n π Cos[((a n π)/L)]+I L p Sin[((a n π)/L)]+(E^(I b p)) (n π Cos[(((a+b) n π)/L)]-I L p Sin[(((a+b) n π)/L)])))/((Sqrt[b]) (Sqrt[(1/L)]) (L p-n π) (L p+n π));

c[1]

vals={L->10.0,a->3.0,b->1.0,m->1.0,p->10};
co=Table[c[n]/.vals,{n,1,800}];
En=Table[(1/(2 m))(((((π n)/L)))^2)/.vals,{n,1,800}];

co[[1]]
En[[1]]

ψ=Sum[co[[n]]ϕ[n,x]/.vals,{n,1,200}];

Plot[((Abs[ψ])^2),{x,0,10},PlotRange->All]

data=Table[{xi,((Abs[ψ/.{x->xi}])^2)},{xi,0,10,0.02}];

ListPlot[data,PlotRange->All,Filling->Axis,PlotRange->{-0.2,1.2}]

Ψ=Sum[co[[n]]ϕ[n,x]Exp[-I En[[n]]t]/.vals,{n,1,500}];

Plot3D[((Abs[Ψ])^2),{x,0,10},{t,0.0,0.5},PlotRange->All,PlotPoints->50]

Plot[((Abs[Ψ])^2)/.{t->0.1},{x,0,10},PlotRange->All]

data=Table[{xi,((Abs[Ψ/.{x->xi,t->ti}])^2)},{ti,0,1.5,0.01},{xi,0,10,0.02}];

Dimensions[data]

ListPlot[data[[1]],PlotRange->All,Filling->Axis,PlotRange->{-0.2,1.2}]

ListPlot[data[[10]],PlotRange->All,Filling->Axis,PlotRange->{-0.2,1.2}]

Manipulate[ListPlot[data[[Floor[l]]],PlotRange->All,Filling->Axis],{l,1,151}]