Limit of $n(n\pi + \frac{\pi}{2} - x_n)$, where $x_n$ is the solution of $x = \tan(x)$ in the interval $(n \pi, n\pi + \frac{\pi}{2})$ Let $x_n$ denote the solution to $x = \tan(x)$ in the interval $(n \pi,n \pi +\frac{\pi}{2}).$ Find
$$ \lim_{n \to \infty}n \left(n\pi + \frac{\pi}{2} - x_n\right)$$
 A: Let $f(y)=\tan y.$ Then $f(0)=0$ and $f'(0)=1.$ So for $y\in (0,\pi/2)$ let  $y=yg(y)+\tan y$ where $\lim_{y\to 0}g(y)=0.$
Let $y_n=n\pi+\pi/2-x_n.$ Then $$0<y_n<\tan y_n=\frac {1}{\tan x_n}=\frac {1}{x_n}<\frac {1}{n\pi}.$$  So $0<\frac {y_n}{1/n\pi}<1.$ So  $g(y_n)\to 0$ as $n\to \infty.$ 
Now   $$ny_n=n \tan y_n+ny_ng(y_n)=$$ $$=\frac {n}{\tan x_n}+ \frac {y_n}{1/n\pi} \frac {g(y_n)}{\pi}=$$ $$=\frac {n}{x_n}+\frac {y_n}{1/n\pi} \frac {g(y_n)}{\pi}$$ and we have  $$\frac {1}{\pi (1+1/2n)}= \frac {n}{n\pi+\pi/2}<\frac {n}{x_n}<\frac {n}{n\pi}=\frac {1}{\pi}.$$
A: $x_n\in(n\pi,n\pi+\frac{\pi}{2})\implies n\pi+\frac{\pi}{2}-x_n\in(0,\frac{\pi}{2})$ and $\frac{1}{n\pi+\frac{\pi}{2}}<\frac{1}{x_n}<\frac{1}{n\pi}$.
\begin{align*}
\tan\left(n\pi+\frac{\pi}{2}-x_n\right)
&=\tan\left(\frac{\pi}{2} - x_n\right)\\
&=\frac{1}{\tan x_n}\\
&=\frac{1}{x_n}.
\end{align*}
So
$$n\pi+\frac{\pi}{2}-x_n=\arctan\frac{1}{x_n}\sim\frac{1}{x_n}\quad (n\to\infty).$$
$$\lim_{n\to\infty}n\left(n\pi+\frac{\pi}{2}-x_n\right)
=\lim_{n\to\infty}n\arctan\frac{1}{x_n}
=\lim_{n\to\infty}\frac{n}{x_n}=\frac{1}{\pi}.$$
A: http://blitiri.blogspot.com/2012/11/solving-tan-x-x.html
We say that $x_n = \frac{(2n+1)\pi}{2}-\epsilon_n$ with $\epsilon_n$ being an error term.
Thus our limit is actually $\lim_{n\to\infty}n\epsilon_n$.
You can find that $\frac{2}{(2n+1)\pi-2\epsilon_n}=\frac{1}{x_n} = \cot(x_n) = \tan(\epsilon_n) = \epsilon_n + O(\epsilon_n^3)$ by using trig identities.
Hence in our limit:
$\lim_{n\to \infty}n \epsilon_n = \lim \frac{2n}{(2n+1)\pi-2\epsilon_n} - nO(\epsilon_n^3)) = \lim \frac{2}{2\pi+\frac{\pi}{2n}-2 \epsilon_n/n}  -nO(\epsilon_n)^3 = \frac{1}{\pi}$
My argument for $\epsilon_n/n \to 0$ is that $\epsilon_n \to 0$ in any case. Furthermore you could do it rigiously, but since $\epsilon_n \sim \frac{2}{(2n+1)}\pi$, the third order limit is zero.
