<s>[INST] Failure of L’Hospital’s rule to $\lim_{x\rightarrow\infty} x\left(\arctan\left(\frac{x+1}{x+2}\right)-\frac\pi 4\right)$? I rewrote the limit
$$\lim_{x\rightarrow\infty} x\left(\arctan\left(\frac{x+1}{x+2}\right)-\frac\pi 4\right) =\lim_{x\rightarrow\infty} \frac{\left(\arctan\left(\frac{x+1}{x+2}\right)-\frac\pi 4\right)}{\frac 1x},$$
noting that both the numerator and denominator tend to zero as $x\rightarrow \infty$ so that the conditions for L’Hospital’s rule are fulfilled. However, differentiating top and bottom then yields:
$$\lim_{x\rightarrow\infty} \frac{\left(\arctan\left(\frac{x+1}{x+2}\right)-\frac\pi 4\right)}{\frac 1x}=\lim_{x\rightarrow\infty} \frac{\frac{1}{1+\left(\frac{x+1}{x+2}\right)^2}}{-\frac 1{x^2}}=\lim_{x\rightarrow\infty} \frac{-x^2(x+2)^2}{(x+2)^2+(x+1)^2}=\infty,$$
which is incorrect. What went wrong?
 [/INST] Alternatively, with the trigonometric identity,
$$ \tan^{-1} (a) - \tan^{-1}( b) = \tan^{-1} \left( \dfrac{ a - b}{1 + ab} \right) $$
Set $a = \frac{x+1}{x+2} $ and $ b = 1 , $
$$ \tan^{-1} \left( \dfrac{x+1}{x+2} \right)  - \dfrac \pi4 = \tan^{-1} \left( \dfrac1{-2x-3} \right) $$
So the limit is $$ L :=\lim_{x\to\infty} x \cdot \tan^{-1} \left( \dfrac1{-2x-3} \right) = \lim_{x\to\infty}-x \cdot \tan^{-1} \left( \dfrac1{2x+3} \right) $$
Can you finish it off from here?
</s>