First some preliminaries. Suppose you have hermitian operators $A$ and $B$ and some state $\left| \psi \right>$. Denote by $\left<X\right>$ the expectation of $X$ in the state $\psi$, i.e. $\left<\psi\right| X \left| \psi\right>$. Denote by $\bar A := A - \left< A \right>$ and $\bar B := B - \left< B \right>$ the part of of $A$, resp. $B$ with vanishing expectation.
So, let's compute $\left< \bar A \right>^2 \left<\bar B \right>^2$. According to Cauchy-Schwarz inequality that this is always greater or equal than
$\left|\left< \bar A \bar B \right>\right|^2$ (just plug in $\psi$ and interpret these expressions as scalar products). Now, we can express the product as sum of hermitian and antihermitian component
$$\left|\left< \bar A \bar B \right>\right|^2 = {1\over4}\left< [A,B]/i \right>^2 + {1\over 4}\left< \{\bar A, \bar B\} \right>^2$$
(here we used the fact that $[\bar A, \bar B] = [A,B]$).
If the commutator is just a number times identity operator then we can discard the expectations and after removing the anticommutator term (because it doesn't have any important interpretation and it doesn't spoil the inequality) we are left with HUP. But we're not interested in this application right now. Instead, we want to minimize the error term and that means we want equalities everywhere (it's not clear that it's possible to attain them, but let's assume this for a while). First, Cauchy-Schwarz inequality becomes equality if the vectors in the scalar product are colinear $$\bar B \left| \psi \right> = c \bar A \left| \psi \right>$$ Second, we want the expectation of anticommutator to vanish $$\left<\psi\right| \{\bar A, \bar B\} \left| \psi \right> = 0$$ So this gives us two equations for $\psi$. Let's see what we can get from them for $A = x$ and $B = p$. For simplicity let's assume that $\left<x\right> = \left<p\right> = 0$ (the general solution doesn't change anything much).
From first condition we obtain
$$(p - cx) \left | \psi \right> = 0$$ which is a differential equation
$$ (i \partial_x + cx) \psi(x) = 0$$
with a solution $\psi(x) = K \exp(-\alpha x^2)$ with ${\rm Re} \alpha > 0$ (so that this is indeed a vector from our Hilbert space) and $K$ being just a normalization constant. Finally from the anticommutator relation we get $\alpha = {1 \over 4(\Delta x)^2}$ and we're done.