Before we proceed into a formal derivation, we must try to understand what Deltax and Deltap actually mean.
They are infact the standard deviations in measurements of x and p respectively and may be defined as in probability theory as,
Delta x = sqrt( < (x - < x> )^2> )
Delta p = sqrt( < (p - < p> )^2>)
Now, for two complex valued functions f and g, there holds the following inequality,
int |f(x)|^2dx int |g(x)|^2dx >= 1/4 [int (dot fg + dot gf) dx]^2
where dot f and dot g are complex conjugates.
For simplicity, assume that < x> = 0 and < p> = 0
then for, f = hat ppsi = -ibarh (delpsi)/(delx) and g = ibar hpsi
we have, int dotffdx = bar h^2 int (deldotpsi)/(delx)(delpsi)/(delx)dx
implies int dotffdx = bar h^2 [-int dotpsi(del^2psi)/(delpsi)^2dx]
In the last step, integration by parts has been done and the first term is put equal to zero since wave functions go to zero when x does to infinity.
int dotffdx = int dotpsi (-ibarhdel/(delx))^2psidx
implies int dotffdx = < p^2> where hat p = -ibarhdel/(delx) is the one dimensional momentum operator.
Now, int dotggdx = int dotpsix^2psidx
implies int dotgg dx = < x^2>
and int (dotfg + dotgf)dx = -bar h int(deldotpsi)/(delx)xpsidx - barh int (delpsi)/(delx)xdotpsidx
implies int (dotfg + dotgf)dx = -barh int del/(delx)(dotpsixpsi)dx + bar h int dotpsipsi dx
Now, the first term when integrated shall go to zero because wavefunctions go to zero as x goes to infinity.
implies int (dotfg + dotgf)dx = barh
Therefore, using the inequality stated previously,
int |f(x)|^2dx int |g(x)|^2dx >= 1/4 [int (dot fg + dot gf) dx]^2
implies (Deltax)^2*(Deltap)^2 >= 1/4 (bar h^2)
Thus, Deltax*Deltap >= bar h/2
Which is the uncertainty principle.
This may also be derived for the more general case that < x> and < p> not zero by taking,
f = ( p - < p>)psi and g = (x - < x>)psi.
The evaluation of the result would be somewhat laborious so I skipped doing it myself.
References -
1) Quantum Mechanics : Theory and Applications by A Ghatak and S Lokanathan
2) Introduction to Quantum Mechanics by DJ Griffiths