# 008-001-schrodinger-equation-a-simple-derivation.ipynb

In [1]:
from sympy import *
from sympy.physics.quantum.constants import hbar
from xv.util import listAttr

In [2]:
E, KE, PE, v, p, psi, x, t = symbols('E, KE, PE, v, p, psi, x, t')
m, u, k, omega, lamda, h, f = symbols('m, u, k, omega, lamda, h, f', constant = True)

In [3]:
valOfE = Eq(E, KE + PE)
display(valOfE)

$\displaystyle E = KE + PE$
In [4]:
valOfE = Eq(E, m*v**2/2 + u)
display(valOfE)

$\displaystyle E = \frac{m v^{2}}{2} + u$
In [5]:
valOfP = Eq(p, m*v)
display(valOfP)

$\displaystyle p = m v$
In [6]:
valOfKE = Eq(m*v**2/2, p**2/(2*m))
display(valOfKE)

$\displaystyle \frac{m v^{2}}{2} = \frac{p^{2}}{2 m}$
In [7]:
valOfE = Eq(E, p**2/(2*m) + u)
display(valOfE)

$\displaystyle E = u + \frac{p^{2}}{2 m}$
In [8]:
valOfPsi = Eq(psi, exp(I*(k*x - omega*t)))
display(valOfPsi)

$\displaystyle \psi = e^{i \left(k x - \omega t\right)}$
In [9]:
Eq(exp(I*(k*x - omega*t)), cos(k*x - omega*t) + I*sin(k*x - omega*t))

Out[9]:
$\displaystyle e^{i \left(k x - \omega t\right)} = i \sin{\left(k x - \omega t \right)} + \cos{\left(k x - \omega t \right)}$
In [10]:
diffOfPsi_WRO_X = Eq(Eq(Derivative(psi, x), Derivative(exp(I*(k*x - omega*t)), x).doit()), I*k*psi, evaluate = False)
display(diffOfPsi_WRO_X)

$\displaystyle \frac{d}{d x} \psi = i k e^{i \left(k x - \omega t\right)} = i k \psi$
In [11]:
diff2OfPsi_WRO_X = Eq(Eq(Derivative(psi, x, 2), Derivative(exp(I*(k*x - omega*t)), x, 2).doit()), (I*k)**2*psi, evaluate = False)
display(diff2OfPsi_WRO_X)

$\displaystyle \frac{d^{2}}{d x^{2}} \psi = - k^{2} e^{i \left(k x - \omega t\right)} = - k^{2} \psi$
In [12]:
valOfK = Eq(k, p/hbar)
display(valOfK)

$\displaystyle k = \frac{p}{\hbar}$
In [13]:
valOfK = Eq(k, 2*pi/lamda)
display(valOfK)

$\displaystyle k = \frac{2 \pi}{\lambda}$
In [14]:
valOfP = Eq(p, h/lamda)
display(valOfP)

$\displaystyle p = \frac{h}{\lambda}$
In [15]:
valOfP = Eq(p, h/(2*pi)*k)
display(valOfP)

$\displaystyle p = \frac{h k}{2 \pi}$
In [16]:
diff2OfPsi_WRO_X = Eq(Derivative(psi, x, 2), (I*p/hbar)**2*psi)
display(diff2OfPsi_WRO_X)

$\displaystyle \frac{d^{2}}{d x^{2}} \psi = - \frac{p^{2} \psi}{\hbar^{2}}$
In [17]:
valOfP2_Psi = Eq(-hbar**2 * Derivative(psi, x, 2), p**2*psi)
display(valOfP2_Psi)

$\displaystyle - \hbar^{2} \frac{d^{2}}{d x^{2}} \psi = p^{2} \psi$
In [18]:
valOfE_Psi = Eq(E*psi, p**2/(2*m)*psi + u*psi)
display(valOfE_Psi)

$\displaystyle E \psi = \psi u + \frac{p^{2} \psi}{2 m}$
In [19]:
timeIndependentSchrodingerEquation = Eq(E*psi, -hbar**2 * Derivative(psi, x, 2)/(2*m) + u*psi)
display(timeIndependentSchrodingerEquation)

$\displaystyle E \psi = \psi u - \frac{\hbar^{2} \frac{d^{2}}{d x^{2}} \psi}{2 m}$
In [20]:
valOfE = Eq(Eq(E, hbar*omega), h*f, evaluate = False)
display(valOfE)

$\displaystyle E = \hbar \omega = f h$
In [21]:
valOfPsi = Eq(psi, exp(I*(k*x - omega*t)))
display(valOfPsi)

$\displaystyle \psi = e^{i \left(k x - \omega t\right)}$
In [22]:
diffOfPsi_WRO_T = Eq(Eq(Derivative(psi, t), Derivative(exp(I*(k*x - omega*t)), t).doit()), -I*omega*psi, evaluate = False)
display(diffOfPsi_WRO_T)

$\displaystyle \frac{d}{d t} \psi = - i \omega e^{i \left(k x - \omega t\right)} = - i \omega \psi$
In [23]:
valOfE = Eq(E, hbar*omega)
display(valOfE)

$\displaystyle E = \hbar \omega$
In [24]:
valOfE_Psi = Eq(E*psi, hbar*omega*psi)
display(valOfE_Psi)

$\displaystyle E \psi = \hbar \omega \psi$
In [25]:
valOfE_Psi = Eq(Eq(-I*E*psi/hbar, -I*omega*psi), Derivative(psi, t), evaluate = False)
display(valOfE_Psi)

$\displaystyle - \frac{i E \psi}{\hbar} = - i \omega \psi = \frac{d}{d t} \psi$
In [26]:
valOfE_Psi = Eq(E*psi, I*hbar*Derivative(psi, t), evaluate = False)
display(valOfE_Psi)

$\displaystyle E \psi = \hbar i \frac{d}{d t} \psi$
In [27]:
timeDependentSchrodingerEquation = Eq(I*hbar*Derivative(psi, t), -hbar**2 * Derivative(psi, x, 2)/(2*m) + u*psi)
display(timeDependentSchrodingerEquation)

$\displaystyle \hbar i \frac{d}{d t} \psi = \psi u - \frac{\hbar^{2} \frac{d^{2}}{d x^{2}} \psi}{2 m}$
In [28]:
display(timeDependentSchrodingerEquation, timeIndependentSchrodingerEquation)

$\displaystyle \hbar i \frac{d}{d t} \psi = \psi u - \frac{\hbar^{2} \frac{d^{2}}{d x^{2}} \psi}{2 m}$
$\displaystyle E \psi = \psi u - \frac{\hbar^{2} \frac{d^{2}}{d x^{2}} \psi}{2 m}$
In [ ]: