The optimal diffusion of a new technology when both demand and supply are nonstatic