I'm self studying contour integration and I found a problem I can't solve. Prove for a real number $k$ that
$$\int_{0}^{\pi} e^{k \cos(\theta)} \cos(k \sin(\theta))d \theta = \pi$$
I tried doing the change of variable $x = \cos \theta$ which gets me the integal
$$ \int_{-1}^{1} e^{kx} \frac{cos(k\sqrt{1-x^2})}{\sqrt{1-x^2}}dx $$ but to no avail. I was thinking to use a half circle contour but I haven't found an appropiate function. Any help will be appreciated.