Within the region bounded by the contour, the integrand has exactly one singularity. More precisely, it has an essential singularity at \( z=0 \). Thus, by Cauchy’s residue theorem, the value of the integral is equal to \( 2\pi i \) times the integrand’s residue at \( z=0 \).

Let \( f(z) = z^{-1} \exp{(z + z^{-1})} \). To find the residue of \( f \) at \( 0 \), we consider the Laurent series for \( f \) centered at \( 0 \). (A simple approach here is to write \( \exp{(z + z^{-1})} = \exp{(z)} \exp{(z^{-1})} \), but we shall take a more roundabout path. The reader is invited to attempt the direct route.) Using the standard series for the exponential, we obtain

The residue of \( f \) at \( z = 0 \) is defined as the coefficient of the \( z^{-1} \) term in the Laurent series for \( f \) centered at \( 0 \). From the above expansion, we see that in order to determine this coefficient, it suffices to determine the coefficient of \( z^0 \) within the infinite sum.

Fix a nonnegative integer \( n \) and consider the binomial \( (z + z^{-1})^n \). We wish to determine the coefficient of \( z^0 \) in the expansion of this binomial. In order to obtain a \( z^0 \) term in the first place, we see that the terms \( z \) and \( z^{-1} \) must multiply together in pairs. Hence, if \( n \) is odd, the coefficient of \( z^0 \) is \( 0 \). Thus, we may focus our attention on the nonnegative even integers.

Consider the binomial \( (z + z^{-1})^{2n} \). What is the coefficient of \( z^0 \) in its expansion? If we imagine \( 2n \) copies of the expression \( (z + z^{-1}) \) being multiplied together, the only way we obtain a nonzero \( z^0 \) term is when we choose the \( z \) and \( z^{-1} \) terms in pairs. There will be a total of \( n \) pairs. Of the \( 2n \) copies of \( z \), we can choose any \( n \) of them, and then the remaining \( n \) choices will have to be \( z^{-1} \) terms. Hence, the coefficient of \( z^0 \) is \( {{2n}\choose{n}}\).

It turns out that the original integral is not entirely unmotivated, as it can also be written as \( 2\pi I_{0}(2) \), where \( I_{n}(z) \) denotes the modified Bessel function of the first kind. This result can be seen from the integral formulas for these functions.