Problem: let $a \in \mathbb{R}$ and $f(a) = \int_0 ^{\frac{\pi}{2}} e^{-a \cos^2 t}\, dt$. Calculate $$\int_0 ^\infty e^{-a} f(a)\, da.$$
My attempt at solution: I tried to plug $f(a)$ into the second integral and I got this: $$\int_0 ^\infty e^{-a} \left( \int_0 ^{\frac{\pi}{2}} e^{-a \cos^2 t}\, dt\right)\, da = \int_0 ^\infty \left( \int_0 ^{\frac{\pi}{2}} e^{-a (\cos^2 t + 1)}\, dt\right)\, da.$$ Then I used Fubini to get $$\int_0 ^\frac{\pi}{2} \left( \int_0 ^\infty e^{-a (\cos^2 t + 1)}\, da\right)\, dt = \frac{\pi}{2} \int_0 ^\frac{\pi}{2} \frac{dt}{\sqrt {1 + \cos^2 t}}$$ and the last integral seems unsolvable. I am studying for an exam and I saw this problem on one of the old exams, so I would really appreciate any help.
You made a mistake in the last step $$\int_0 ^\frac{\pi}{2} \left( \int_0 ^\infty e^{-a (\cos^2 t + 1)}\, da\right)\, dt = \int_0 ^\frac{\pi}{2} \frac{dt}{1 + \cos^2 t}$$ There is no square root. I don't think there is a $\frac \pi 2$ factor either.