Hard limit - integral with trigonometric function in the exponent yield $\pi$ The function:
$$ \frac{1}{x^{2 \cos (x)} + 1}$$
Looks like it is built out of these bricks, which keep on forever:

The "length" of each one of them is $\sim2 \pi$ meaning that each block sits on $[ 2d \pi , 2 (d+1) \pi]$ for all $d \in \mathbb{N}$
But because I am highly confident these bricks are not the same - because they depend on $x$ and for each value of $x$ the block will be more and more "fixed".
I tried to calculate using a program and found that:
$$ \int_{2 \pi}^{4\pi} \frac{1}{x^{2 \cos (x)} + 1} ~ dx \approx \pi$$
But not quite, it only goes to pi as we increase the bounds (but keep them $2 \pi$ from each other), and so I thought to declare it as:
$$ \lim_{a \to \infty} \int_{2 a \pi}^{2(a+1)\pi} \frac{1}{x^{2 \cos (x)} + 1} ~ dx = \pi$$
One thing to note: even by removing the $2$ from the exponent, keeps the answer close to $\pi$. Meaning that also:
$$ \int_{2 \pi}^{4\pi} \frac{1}{x^{\cos (x)} + 1} ~ dx \approx \pi$$

Is it written correct (mathematically) because I need $a$ to be a whole number, but how can I write it in this limit form?


Is there any way to prove this? a rigorous proof or any simplifications to do here? trigonometric exponents are pretty tricky and hard to deal with, and I've tried all the ways I could think of - $u$-sub, trig-sub, Feynman's method etc..

Renaming $\cos(x) \to t = \frac{t}{1} \\ - \sin(x) dx = dt \\ dx = \frac{1}{\sqrt{1-t^2}} dt$

$$ \int \frac{1}{x^{2 \cos (x)} + 1} ~ dx  = -\int \frac{1}{(x^{2t} +1)} \cdot \frac{1}{\sqrt{1-t^2}} ~ dt $$
The problem is that we are stuck with this $x$ and not $t$.. Any help would be appreciated!

*

*This is not for a specific class, no main "topic" other than integrals and calculus as far as I know.

*I unfortunately don't have a reference / contex.

 A: More instructive would be to consider the generalization
$$f(x,y) = (y^{2 \cos x} + 1)^{-1}, \quad x \in [0,2\pi), \quad y \ge 0.$$  In essence, we decouple the periodicity of the exponent and investigate the pointwise limiting behavior of $f$ with respect to increasing values of $y$.
As $y$ gets "large," what does $g_y(x) = y^{2 \cos x}$ look like?  If $\cos x = 0$, then $g_y = 1$ irrespective of $y$.  If $\cos x = -1$, then $\lim_{y \to \infty} g_y = 0$.  And if $\cos x = 1$, then $\lim_{y \to \infty} g_y = \infty$.  In general, we note that $$\lim_{y \to \infty} y^m = \begin{cases} 0, & m < 0 \\ 1, & m = 0 \\ \infty & m > 0 \end{cases}$$  so we can see that the pointwise behavior is $$\lim_{y \to \infty} g_y(x) = \begin{cases} 0, & \pi/2 < x < 3\pi/2 \\ 1, & x \in \{\pi/2, 3\pi/2\} \\ \infty, & 0 \le x < \pi/2 \cup 3\pi/2 < x < 2\pi. \end{cases}$$  Therefore we have for $f(x,y)$ $$\lim_{y \to \infty} f(x,y) = \begin{cases} 1, & \pi/2 < x < 3\pi/2 \\ 1/2, & x \in \{\pi/2, 3\pi/2\} \\ 0, & 0 \le x < \pi/2 \cup 3\pi/2 < x < 2\pi. \end{cases}$$  This suggests that for integers $a$, $$\lim_{a \to \infty} \int_{x=2\pi a}^{2\pi(a+1)} f(x,x) \, dx = (3\pi/2 - \pi/2) = \pi.$$
