Difference between Gabor filter implementations
Both equations are related by Euler's formula: http://en.wikipedia.org/wiki/Euler%27s_formula
They are mathematically equivalent, it's well explained on the Wikipedia page.

In a practical point of view, $\cos(x)+i\sin(x)$ allows for easy separation of real and imaginary. On the other hand, $\exp(ix)$ makes it easier to deal with Gaussian since $\exp(x)\cdot\exp(y)=\exp(x+y)$.

Hope this helps!