Compute the limit $ \lim_{x\to \infty}\frac{1}{x}\int_0^x\frac{1}{2+\cos t}dt$ Compute the following limit: 
$$ \lim_{x\to \infty}\frac{1}{x}\int_0^x\frac{1}{2+\cos t}dt$$
We have that $0\leq\frac{1}{2+\cos t}\leq1, \forall t\in \mathbb{R}$ which means that $0\leq\int_0^x\frac{1}{2+\cos t}dt\leq x$, so $0\leq\frac{1}{x}\int_0^x\frac{1}{2+\cos t}dt\leq 1$. The given limit is in $[0,1]$, but I don't think it helps evaluating it.
 A: Hint
The function:
$$f(t)=\frac{1}{2+\cos(t)}$$
as $2 \pi$ as a period.
With $n$ such that $2n \pi \leq x < 2(n+1) \pi$ (i.e $n=\left\lfloor\frac{x}{2\pi} \right\rfloor$)
you have:
$$\int_0^x f(x) dx=\int_0^{2n \pi} f(t) dt +\int_{2 n \pi}^x f(t)dt$$
but with linear change of variables and using periodicity:
$$\int_0^{2n \pi} f(t) dt = \sum_{k=0}^{n-1} \int_{2k \pi}^{2(k+1) \pi} f(t) dt=\sum_{k=0}^{n-1} \int_{0}^{2( \pi} f(t) dt$$
so:
$$\frac{1}{x} \int_0^x f(x) dx=\frac{\left\lfloor\frac{x}{2\pi} \right\rfloor}{x} \int_0^{2 \pi} f(t) dt+\frac{1}{x} \int_{\left\lfloor\frac{x}{2\pi} \right\rfloor}^x f(t) dt$$
it remains to prove that:
$$\lim_{x \to \infty} \frac{\left\lfloor\frac{x}{2\pi} \right\rfloor}{x} =\frac{1}{2 \pi}$$
$$\lim_{x \to \infty} \frac{1}{x} \int_{\left\lfloor\frac{x}{2\pi} \right\rfloor}^x f(t) dt=0$$
to prove that the limit is:
$$\frac{1}{2 \pi} \int_0^{2 \pi} f(t) dt$$
A: For large $x$, the integral is a sum of whole periods and a residue. When averaging, only a single period remains:
$$\frac1{nT+\alpha T}\int_0^{nT+\alpha T}=\frac{nI+\beta I}{nT+\alpha T}\to \frac IT$$ where $I$ is the integral over a period, and $\alpha,\beta$ are less than one.
Using WA, the average over a period is $\dfrac1{\sqrt 3}$.
A: Hint: For the integral one can solve using $u\mapsto \tan\left(\frac{t}{2}\right)$, which gives
$$\begin{align*} \int \frac{2du}{(u^2+1)((1-u^2)(u^2+1)^{-1} + 2)} &= 2 \int \frac{du}{u^2+3} \\
&= \frac{2\tan^{-1}\left(\frac{u}{\sqrt3}\right)}{\sqrt3} + c \\
&= \frac{2}{\sqrt3} \tan^{-1}\left( \frac{\tan(t/2)}{\sqrt3} \right) + c
\end{align*}
$$
Evaluate this from $0$ to $x$ and use in the limit.
