Finding the big-$O$ estimate of the solutions to $\cot x = x$ So a problem for my class I am asked to find the big-$O$ estimate (up to 3 terms) of the solutions to $\cot x = x$. We label the solutions to this equation in increasing order $0<x_1<x_2<\cdots$ and we wish to find the expansion of $x_n$ as $n \rightarrow\infty$.
I've computed the expansion
$$\cot x = x^{-1} - \frac{1}{3}x - \frac{1}{45}x^3 + O(x^5)$$
I observe graphically that for integer $m\ge0$ there exists exactly one solution between $m\pi$ and $(m+1/2)\pi$ ($x_{m+1}$ by the previous labelling). So we know that the leading order of $x_n$ should be $(n-1)\pi$. I'm not sure where to proceed from here. I tried iterating $x$ in the series expansion, but the increasing powers of $x$ gives larger errors with each iteration.
 A: You already find the first term $n\pi$ for $x_n$ (with $0=x_0<x_1<...$). So, let's denote $x_n=n\pi+y_n$ with $y_n=\mathcal{o}(n)$ and $0<y_n<\frac{\pi}{2}$.
$$\begin{align}
&\Longrightarrow \cot(y_n)=n\pi+y_n  \xrightarrow{n\to+\infty}+\infty \\
&\Longrightarrow  y_n  \xrightarrow{n\to+\infty} 0
\end{align}$$
So $y_n=\mathcal{o}(1)$ and we can compute the series expansion of $\cot(y_n)$ when $y_n \to 0$, we have
$$\begin{align}
n\pi+y_n=\cot(y_n) = \frac{1}{y_n}+\mathcal{O}(y_n) &\Longleftrightarrow n\pi = \frac{1}{y_n}+\mathcal{O}(y_n)\\
&\Longleftrightarrow y_n = \frac{1}{n\pi + \mathcal{O}(y_n)}\\\
&\Longleftrightarrow y_n = \frac{1}{n\pi } \left(1 + \mathcal{O}(\frac{y_n}{n})  \right)\\\
&\Longleftrightarrow y_n = \frac{1}{\pi}\cdot\frac{1}{n}+\mathcal{o}\left(\frac{1}{n}  \right)\\
\end{align}$$
We obtain then the second term $\frac{1}{\pi}\cdot\frac{1}{n}$.
Let's denote $x_n=n\pi+ \frac{1}{\pi}\cdot\frac{1}{n}+z_n$ with $z_n=\mathcal{o}\left(\frac{1}{n}  \right)$. We have
$$\begin{align}
n\pi+\frac{1}{\pi}\cdot\frac{1}{n}+z_n &=\cot\left(\frac{1}{\pi}\cdot\frac{1}{n}+z_n  \right) \\&=\frac{1}{\frac{1}{\pi}\cdot\frac{1}{n}+z_n} -\frac{1}{3}\left( \frac{1}{\pi}\cdot\frac{1}{n}+z_n \right)+\mathcal{o}\left( \frac{1}{n} \right)\\
&=\pi n \left(1+ \pi n z_n  \right)^{-1}-\frac{1}{3}\left( \frac{1}{\pi}\cdot\frac{1}{n}+z_n \right)+\mathcal{o}\left( \frac{1}{n} \right)\\
&=\pi n \left(1- \pi n z_n +\mathcal{o}(n^2z_n^2) \right)-\frac{1}{3\pi}\cdot\frac{1}{n}+\mathcal{o}\left( \frac{1}{n} \right)\\
&=\pi n - \pi^2 n^2 z_n +\mathcal{o}(n^2z_n)-\frac{1}{3\pi}\cdot\frac{1}{n}+\mathcal{o}\left( \frac{1}{n} \right)\tag{1}\\
\end{align}$$
Then
$$\begin{align}
 (1) &\Longleftrightarrow \frac{4}{3\pi}\cdot\frac{1}{n} = -\pi^2 n^2 z_n++\mathcal{o}(n^2z_n)+\mathcal{o}\left( \frac{1}{n} \right)\\
&\Longleftrightarrow z_n = -\frac{4}{3\pi^3}\cdot\frac{1}{n^3} +\mathcal{o}\left( \frac{1}{n^3} \right)\\\
\end{align}$$
Conclusion:
$$x_n = n\pi+\frac{1}{\pi}\cdot\frac{1}{n}-\frac{4}{3\pi^3}\cdot\frac{1}{n^3} +\mathcal{o}\left( \frac{1}{n^3} \right)$$
A: It is better to consider that you look for the zeros of function
$$f(x)=\cos(x)-x\sin(x)$$ which shows that the solutions are closer and closer to $n\pi$.
Expanding as a series around $x=n \pi$ gives
$$f(x)=(-1)^n+(-1)^n \sum_{k=1}^\infty \frac{(k+1) \cos \left(\frac{\pi  k}{2}\right)-\pi  n \sin
   \left(\frac{\pi  k}{2}\right)}{k!} (x-n\pi)^k$$ Truncate to some order and use series reversion to obtain
$$x_n=n\pi+\frac{1}{\pi  n}-\frac{4}{3 \pi ^3 n^3}+\frac{53}{15 \pi ^5
   n^5}-\frac{1226}{105 \pi ^7 n^7}+O\left(\frac{1}{n^9}\right)$$
If you use the above truncated series
$$f(x_n)=(-1)^n \frac{13597}{315 \pi ^8 n^8}+O\left(\frac{1}{n^{10}}\right)$$ which is not much as soon as $n\geq 2$.
