The primary objective of cognitive radio is to maximize the spectrum utilization and the capacity of secondary users under standard parametric constraints. The radiometer, or energy detection, is one of the convenient methods of spectrum sensing under a cooperative communication framework. However, the selection of a suitable threshold is a major issue in order to optimize the secondary user capacity considering primary user on priority. In this article, we investigate a double threshold energy detection scheme and obtain an analytical model for optimum thresholding in diverse fading conditions under the constraint of the probability of detection. We use a meta-heuristic optimization algorithm, namely, the particle swarm optimization with an aging leader and challengers, to observe the effect of varying threshold levels in fusion region, signal to noise ratio (SNR) levels of primary user, and calculate the normalized achievable capacity of secondary user for various fading channels. The results show that, with increasing value of threshold within the decision region, the probability of detection decreases while the normalized secondary user capacity is enhanced. Conversely, the probability of detection increases and the normalized secondary user capacity decreases with increasing values of the SNR level. We also observe the effect of receiver diversity with maximal ratio combining for Nakagami-m fading channel coefficients. The result shows that the probability of detection and normalized capacity decrease with an increase of the number of receiver branches.