# Chi square kernel function: which version?

I was reading this paper about Kernenlized locality-sensitive hashing (LSH) and in section 6.4 the chi-square-kernel function to measure the distance between two histograms hi and hj as:

Anyway in this link is defined in section 20 as:

And then as:

Which one should I use for measuring the distance between two image histograms obtained from a Bag of Features?