# How to solve the limit $\lim\limits_{x\to \infty} (x \arctan x - \frac{x\pi}{2})$

Next week I have a math exam. While I was doing some exercises I came across this interesting limit:

$$\lim\limits_{x\to \infty} (x \arctan x - \frac{x\pi}{2})$$

After struggling a lot, I decided to calculate this limit using my calculator. The answer turns out to be $$-1$$. The problem is that I don't know how to calculate this limit without a calculator. I tried using L'Hôpital's rule after converting the expression to a fraction. My steps:

$$\lim\limits_{x\to \infty} (x \arctan x - \frac{x\pi}{2}) = \lim\limits_{x\to \infty} \frac{2x^2\arctan x - x^2\pi}{2x} \stackrel{(H)}{=} \lim\limits_{x\to \infty} \frac{4x\arctan x - \frac{2}{x^2+1}-2\pi x+2}{2} = \lim\limits_{x\to \infty} \frac{4x^2\arctan x - \frac{2x}{x^2+1}-2\pi x^2+2x}{2x} \stackrel{(H)}{=} \lim\limits_{x\to \infty} \frac{8x\arctan x - \frac{2x^2+6}{(x^2+1)^2}-4\pi x+6}{2} = \dots$$

This keeps going on without an end, I also don't see where I can simplify the expression when using L'Hôpital's rule. Am I missing a step or am I using the wrong method? What method can be used instead?

Observe \begin{align} \lim_{x\rightarrow \infty} x\arctan x-x\frac{\pi}{2}=\lim_{x\rightarrow\infty}\frac{\arctan x-\frac{\pi}{2}}{x^{-1}} = \lim_{x\rightarrow \infty} \frac{\frac{1}{1+x^2}}{-x^{-2}}=-1 \end{align}
If you know that $$\lim_{x\to+\infty}\arctan x = \pi/2$$, then factoring out $$x$$ in your original limit you would get a $$+\infty \cdot 0$$. You want to apply L'Hospital's Rule. Motivated by this, we do $$\lim_{x\to +\infty} \left(x\arctan x - \frac{x\pi}{2}\right) = \lim_{x\to +\infty} x\left(\arctan x - \frac{\pi}{2}\right) = \lim_{x \to \infty} \frac{\arctan x - (\pi/2)}{1/x}.$$Now apply L'Hospital to get $$\lim_{x \to +\infty}\left(x\arctan x - \frac{x\pi}{2}\right) = \lim_{x\to +\infty} \frac{1/(1+x^2)}{-1/x^2} = -\lim_{x \to +\infty}\frac{x^2}{1+x^2} = -1.$$
You can do the substitution $$x=1/t$$, recalling that, for $$t>0$$, $$\arctan\frac{1}{t}=\frac{\pi}{2}-\arctan t$$ Thus the limit becomes $$\lim_{t\to0^+}\left(\frac{1}{t}\frac{\pi}{2}-\frac{1}{t}\arctan t-\frac{1}{t}\frac{\pi}{2}\right)=\lim_{t\to0^+}-\frac{\arctan t}{t}$$ Alternatively, substitute $$u=\arctan x$$, so $$x=\tan u$$ and the limit becomes $$\lim_{u\to\pi/2^-}(u-\pi/2)\tan u=\lim_{u\to\pi/2^-}\frac{u-\pi/2}{\cot u}$$ This is the reciprocal of the derivative at $$\pi/2$$ of the cotangent.