Calculate the limit $\lim_{x\to 0} \left(\frac 1{x^2}-\cot^2x\right)$

Here's a non-series solution.

$$\lim_{x \rightarrow 0} \left(\frac{1}{x^2} - \cot^2(x)\right) = \lim_{x \rightarrow 0} \frac{\sin^2(x) - x^2\cos^2(x)}{x^2\sin^2(x)}$$

Instead of directly doing l'Hospital, we can make our life easier using $\lim_{x \rightarrow 0}\frac{\sin(x)}{x} = 1$ Or rather, $\lim_{x \rightarrow 0}\frac{x}{\sin(x)} = 1$:

$$\lim_{x \rightarrow 0} \frac{\sin^2(x) - x^2\cos^2(x)}{x^2\sin^2(x)} = \lim_{x \rightarrow 0}\left(\frac{x}{\sin(x)}\right)^2\left(\frac{\sin^2(x) - x^2\cos^2(x)}{x^4}\right) = \lim_{x \rightarrow 0} \frac{\sin^2(x) - x^2\cos^2(x)}{x^4}$$

Now l'Hospital. Note that we can freely factor out constants, and also $\cos(x)$ (as it approaches 1 as $x \rightarrow 0$):

\begin{align*} \lim_{x \rightarrow 0} \frac{\sin^2(x) - x^2\cos^2(x)}{x^4} &= \lim_{x \rightarrow 0} \frac{2\sin(x)\cos(x) - 2x\cos^2(x) + 2x^2\sin(x)\cos(x)}{4x^3} \\ &= \frac{1}{2}\lim_{x \rightarrow 0}\frac{\sin(x) - x\cos(x) + x^2\sin(x)}{x^3} \\ &= \frac{1}{2}\lim_{x \rightarrow 0}\frac{\cos(x) - \cos(x) + x\sin(x) + 2x\sin(x) + x^2\cos(x)}{3x^2} \\ &= \frac{1}{6}\lim_{x \rightarrow 0}\frac{3x\sin(x) + x^2\cos(x)}{x^2} \\ &= \frac{1}{6}\left(\lim_{x \rightarrow 0}3\frac{\sin(x)}{x} + \lim_{x \rightarrow 0} \cos(x)\right) \\ &= \frac{1}{6}(3 + 1) = \frac{2}{3}\end{align*}


One may recall that, as $x \to 0$, we have $$ \cos x= 1-\frac{x^2}2+\frac{x^4}{24}+O(x^6) $$ $$ \sin x= x-\frac{x^3}6+\frac{x^5}{120}+O(x^6) $$ and using $$ \frac1{1-u}=1+u+u^2+O(u^3), \quad u \to 0, $$ it gives $$ \cot x = \frac{\cos x}{\sin x}=\frac{1}{x}-\frac{x}{3}+O(x^3) $$ and $$ \cot^2 x = \frac{1}{x^2}-\frac23+O(x^2) $$ Thus, as $x \to 0$,

$$ \frac{1}{x^2}-\cot^2 x=\color{blue}{\frac23}+O(x^2) $$

and the desired limit is $\color{blue}{\dfrac23}$.


We can proceed in the following manner \begin{align} L &= \lim_{x \to 0}\left(\frac{1}{x^{2}} - \cot^{2}x\right)\notag\\ &= \lim_{x \to 0}\left(\frac{1}{x^{2}} - \frac{\cos^{2}x}{\sin^{2}x}\right)\notag\\ &= \lim_{x \to 0}\frac{\sin^{2}x - x^{2}\cos^{2}x}{x^{2}\sin^{2}x}\notag\\ &= \lim_{x \to 0}\frac{\sin^{2}x - x^{2}\cos^{2}x}{x^{4}}\cdot\frac{x^{2}}{\sin^{2}x}\notag\\ &= \lim_{x \to 0}\frac{\sin^{2}x - x^{2}\cos^{2}x}{x^{4}}\cdot 1^{2}\notag\\ &= \lim_{x \to 0}\frac{\sin x - x\cos x}{x^{3}}\cdot\frac{\sin x + x\cos x}{x}\notag\\ &= \lim_{x \to 0}\frac{\sin x - x\cos x}{x^{3}}\cdot\left(\frac{\sin x}{x} + \cos x\right)\notag\\ &= 2\lim_{x \to 0}\frac{\sin x - x\cos x}{x^{3}}\notag\\ &= 2\lim_{x \to 0}\frac{\cos x - \cos x + x\sin x}{3x^{2}}\text{ (via LHR)}\notag\\ &= \frac{2}{3}\lim_{x \to 0}\frac{\sin x}{x}\notag\\ &= \frac{2}{3}\notag \end{align}

As I have told often on MSE, LHR is best used with a combination of standard limits and rules of "algebra of limits". When you have to differentiate too many times in applying LHR its a signal that you are going on a laborious path and perhaps there is a simpler route. The above solution looks a bit long because of detailed steps otherwise its very simple.