Rapidly decaying solutions of an ordinary differential equation with applications to semilinear elliptic and parabolic partial differential equations