Quantum well shape optimization by variational calculus: maximizing the Stark effect and quantum interference derived electro-optic susceptibility