Proving Gauge invariance of Schrodinger Equation I am trying to proof explicitly that Schrodinger equation:
$$ i\hbar \partial_t \psi = \left[ -\frac{1}{2m}\left(\frac{\hbar}{i}\nabla-q\vec{A}\right)^2+qV \right]\psi$$
remains the same under the following gauge transformation:
$$ \psi \rightarrow e^{iq\Lambda/\hbar} \psi$$
$$ \vec{A} \rightarrow \vec{A} + \nabla \Lambda$$
$$ V \rightarrow V - \partial_t\Lambda$$
where $\partial_t$ stands for the time derivative operator.
However, I am having problems with the algebra, so I will show my procedure with the hopes that someone point to an error:
Left side of equation
$$ i\hbar \partial_t (e^{iq\Lambda/\hbar}\psi) = ih \left(e^{iq\Lambda/\hbar} \partial_t\psi+\frac{iq}{\hbar}e^{iq\Lambda/\hbar} \psi \partial_t\Lambda \right) = ihe^{iq\Lambda/\hbar} \partial_t\psi-qe^{iq\Lambda/\hbar} \psi \partial_t\Lambda  $$
Right side of equation
$$ \left[ \frac{1}{2m}\left(\frac{\hbar}{i}\nabla-q(\vec{A} + \nabla \Lambda)\right)^2+q(V - \partial_t\Lambda) \right]= $$
$$ \frac{1}{2m} \left[ -\hbar^2\nabla^2-\frac{q\hbar}{i}( \nabla \cdot\vec{A} + \nabla^2\Lambda+ \vec{A} \cdot \nabla + \nabla \Lambda \cdot \nabla)  + q^2[\vec{A}^2+2(\vec{A}\cdot \nabla \Lambda) + (\nabla \Lambda )^2]\right] e^{iq\Lambda/\hbar} \psi +qV e^{iq\Lambda/\hbar} \psi
 -qe^{iq\Lambda/\hbar} \psi \partial_t\Lambda $$
It is possible to observe that the last term in both (the right and left) sides cancel each other.
Then, using:
$\nabla ( e^{iq\Lambda/\hbar} \psi ) =  e^{iq\Lambda/\hbar}\nabla\psi + \frac{iq}{h} \psi \nabla \Lambda$
$ \nabla^2 ( e^{iq\Lambda/\hbar} \psi ) =e^{iq\Lambda/\hbar} \nabla^2\psi + \frac{2iq}{\hbar}e^{iq\Lambda/\hbar}(\nabla \Lambda)(\nabla \psi) + \psi \frac{iq}{\hbar} e^{iq\Lambda/\hbar} \nabla^2 \Lambda - \frac{q^2}{\hbar^2}\psi e^{iq\Lambda/\hbar}  (\nabla \Lambda)^2 $
we then obtain (by applying operators and canceling all the $e^{iq\Lambda/\hbar}$ ):
$$ i\hbar \partial_t \psi= \frac{1}{2m} \left[  -\hbar^2 \nabla^2 \psi - 2iqh(\nabla \Lambda)(\nabla \psi)-iq\hbar \psi \nabla^2\Lambda + q^2\psi(\nabla \Lambda)^2 + iq\hbar (\nabla \cdot \vec{A})\psi + iq\hbar\nabla^2\Lambda \psi +iq\hbar (\vec{A}\cdot \nabla\psi) - q^2 \psi (\vec{A}\cdot \nabla \Lambda )+iq\hbar (\nabla \Lambda)(\nabla \psi) - q^2\psi (\nabla\Lambda)^2+q^2\vec{A}^2+2q^2(\vec{A}\cdot \nabla \Lambda)\psi +q^2(\nabla \Lambda)^2 \psi  \right] + qV\psi$$
cancelling some terms, and rearranging:
$$ i\hbar \partial_t \psi= \frac{1}{2m} \left[  -\hbar^2 \nabla^2 \psi + iq\hbar (\nabla \cdot \vec{A})\psi +iq\hbar (\vec{A}\cdot \nabla\psi)+q^2\vec{A}^2 - 2iqh(\nabla \Lambda)(\nabla \psi) + q^2\psi(\nabla \Lambda)^2- q^2 \psi (\vec{A}\cdot \nabla \Lambda )+iq\hbar (\nabla \Lambda)(\nabla \psi)   +2q^2(\vec{A}\cdot \nabla \Lambda)\psi  \right] + qV\psi  $$
after more reordering:
$$ i\hbar \partial_t \psi=  \frac{1}{2m} \left[ \left(\frac{\hbar}{i}\nabla-q\vec{A}\right)^2 \right] +qV\psi + \frac{1}{2m} \left[  - iqh(\nabla \Lambda)(\nabla \psi) + q^2\psi(\nabla \Lambda)^2 + q^2(\vec{A}\cdot \nabla \Lambda)\psi  \right]$$
It is possible to observe that the original schrodinger equation is up there, but with an extra part in the right side, this extra part is:
$$ \frac{1}{2m} \left[  - iqh(\nabla \Lambda)(\nabla \psi) + q^2\psi(\nabla \Lambda)^2 + q^2(\vec{A}\cdot \nabla \Lambda)\psi  \right]$$
So am wondering, is this extra part some how 0, or am I making a mistake. Also I don't know how to make the algebra "nicer" to follow, if there is anything I can do please comment.
 A: Check this video  by the great Barton Zwiebach from MIT lectures.
He does exactle what you are doing in a 20 min video, if the link stop working, it is Lecture L14.1 from the MIT course 8.06 Quantum Physics III, Spring 2018, which you will always find on Youtube or in the MIT lectures web.
A: Actually, Schroedinger equation
$$ -i\hbar \partial_t \psi+ \left[ -\frac{1}{2m}\left(\frac{\hbar}{i}\nabla-q\vec{A}\right)^2+qV \right]\psi=0\tag{0}$$
under the gauge transformations
$$ \psi \rightarrow \psi'= e^{iq\Lambda/\hbar} \psi$$
$$ \vec{A} \rightarrow \vec{A}' = \vec{A} + \nabla \Lambda$$
$$ V \rightarrow V'= V - \partial_t\Lambda$$
does not remain invariant, but the left-hand side of (0) gives rise to
$$  -i\hbar \partial_t \psi'+ \left[ -\frac{1}{2m}\left(\frac{\hbar}{i}\nabla-q\vec{A}'\right)^2+qV' \right]\psi'=
e^{iq\Lambda/\hbar}\left\{-i\hbar \partial_t \psi+ \left[ -\frac{1}{2m}\left(\frac{\hbar}{i}\nabla-q\vec{A}\right)^2+qV \right]\psi\right\}\:.$$
In summary, since $e^{iq\Lambda/\hbar}\neq 0$,
$\qquad\quad$ gauge transformed quantities  satisfy Schroedinger equation if untranformed quantities do.
To prove it, avoid brute force computations as yours which give rise to unavoidable mistakes almost certainly  and go on as follows.  First rewrite the initial equation as
$$ -\left[i\hbar \partial_t -qV \right]\psi  -\frac{1}{2m}\left(\frac{\hbar}{i}\nabla-q\vec{A}\right)^2\psi=0\tag{1}$$
Next notice that, under the transformations, we have
$$\left[i\hbar \partial_t -qV' \right]\psi' =
\left[i\hbar \partial_t -q(V - \partial_t\Lambda)\right]e^{iq\Lambda/\hbar}\psi  =
e^{iq\Lambda/\hbar}\left[i\hbar \partial_t -qV \right]\psi $$
and
$$\left(\frac{\hbar}{i}\nabla-q\vec{A}'\right)\psi'  = \left(\frac{\hbar}{i}\nabla-q(\vec{A} +\nabla \Lambda)\right)e^{iq\Lambda/\hbar}\psi =  e^{iq\Lambda/\hbar}\left(\frac{\hbar}{i}\nabla-q\vec{A}\right)\psi$$
so that, iterating the second result
$$\left(\frac{\hbar}{i}\nabla-q\vec{A}'\right)^2\psi'   =  e^{iq\Lambda/\hbar}\left(\frac{\hbar}{i}\nabla-q\vec{A}\right)^2\psi\:.$$
Putting  all together, under the action of gauge transformations, (1) becomes
$$ -\left[i\hbar \partial_t -qV' \right]\psi'  -\frac{1}{2m}\left(\frac{\hbar}{i}\nabla-q\vec{A}'\right)^2\psi' =
e^{iq\Lambda/\hbar}\left\{-\left[i\hbar \partial_t -qV \right]\psi -\frac{1}{2m}\left(\frac{\hbar}{i}\nabla-q\vec{A}\right)^2\psi\right\}=0$$
as wanted.
