This is one of the most beautiful results in all of physics, and I find it astonishing that at no point in my decade as a student was it presented or even mentioned.
Typically, a formal introduction to the wavefunction and the Schrödinger equation is encountered at a senior undergraduate level. The fact that an arbitrary phase factor can be applied to the wavefunction is one of the more obvious features of these denizens of Hilbert space. It is not difficult to grasp, as there can be no effect from multiplying both sides of the differential equation by the same constant term. Moreover, since it is only the squared magnitude of the wavefunction that corresponds to anything measurable, including a constant phase term makes no difference.
What is not mentioned, at least in my experience, is the astonishing idea of introducing a phase term that varies over space and time in any arbitrary way you might wish. It isn’t clear at first why one would even consider doing this, and an initial attempt to do so will wreck the Schrödinger equation. For it to work, the equation must modified with some new terms that make it robust against the phase changing over space and time. This modification turns out to be nothing more than the scalar and vector potentials that describe the electromagnetic field, potentials that a senior undergraduate will be familiar with.
It is literally astonishing to see electricity and magnetism emerge in this way. It also makes it intuitively clear what is meant by the U(1) symmetry of the Standard Model, an idea which often framed in a way that is difficult to penetrate.
The attached PDF derives this lovely result step by step.
