provided x-a is small. In this case, a=0:
> phi := x -> x*(x-L)+c2*x^2*(x-L)^2;
For the particle in a box, . Therefore
is simply
> pKp:=-hbar^2/(2*m)*int(phi(x)*diff(phi(x),x$2),x=0..L);
> ip := int(phi(x)^2,x=0..L);
> Evar := pKp/ip;
> s1:=solve(diff(Evar,c2),c2);
> evalf(subs(c2=s1[1],Evar));
> evalf(subs(c2=s1[2],Evar));
> c2:=simplify(s1[2]);
> hbar:=h/(2*Pi);
> simplify(Evar);
> evalf(");
To normalize the wavefunction, replace by , where A is a
normalization factor. We want . This gives , but
we have already computed this inner product:
> A := simplify(1/sqrt(ip));