Higher-order nonlocal approach to classical and quantum mechanics through non-standard Lagrangians: The case of quantum wells and the quantum states of neutron in earth’s gravitational field | Synapse