# Why L'Hospital Rule cannot apply in calculating $\lim_{x\rightarrow \infty}{(\cos {\frac{1}{x}} + \sin {\frac{1}{x^2}})^{\frac{1}{x^2}}}$

Determine the limit of the following: $$\lim_{x\rightarrow \infty}{(\cos {\frac{1}{x}} + \sin {\frac{1}{x^2}})^{x^2}}$$ I use the logarithm of exponential function to evaluate the above: Let $$u=\frac 1 x$$, then $$\lim_{u\rightarrow 0}{(\cos {\frac{1}{x}} + \sin {\frac{1}{x^2}})^{x^2}}=\lim_{u\rightarrow 0}\exp(\frac{\ln(\cos u+\sin u^2) }{u^2})$$ Since the above expression is an indeterminate form of $$\frac 0 0$$, I use L'Hospital Rule to evaluate, and obtain the following result $$-\frac{1}{2u (\sin u^2+\cos u)(\sin u-2u\cdot \cos u^2)}\rightarrow \frac 10$$ which is not true. What is my error when using L'Hospital Rule? Or there are some way to obtain the result above without using L'Hospital rule?

• How did you get $u^2$ in the denominator in the first place? Raising to $1/x^2$ would be the same as raising to $u^2$ so you should have $\lim \exp(u^2\log(\cos u+\sin u^2))$ rather than a fraction. – Henning Makholm Dec 27 '18 at 13:27
• You can apply L'Hospital's Rule directly without changing to $u$. Also note the mistake pointed out by @HenningMakholm. – Paramanand Singh Dec 27 '18 at 13:29
• I apologised for mistyped the problem. Now I have made an edit to it. – weilam06 Dec 27 '18 at 14:00
• You missed another $1/x^2$. – TonyK Dec 27 '18 at 14:03

$$\lim_{u\to0}\dfrac{\ln(\cos u+\sin u^2)}{u^2}\rightarrow\lim_{u\to0}\dfrac{2u\cos u^2-\sin u}{2u(\cos u+\sin u^2)}$$
$$=\lim_{u\to0}\dfrac{2\cos u^2-\dfrac{\sin u}u}{2(\cos u+\sin u^2)}=\dfrac{2-1}{2(1+0)}$$
Using the rules of L'Hospital we get $$e^{\lim_{x \to \infty}1/2\,{\frac {\sin \left( {x}^{-1} \right) x-2\,\cos \left( {x}^{-2} \right) }{{x}^{4} \left( \cos \left( {x}^{-1} \right) +\sin \left( {x }^{-2} \right) \right) }}}=e^0=1$$
You want to evaluate $$\lim_{u\to0}\frac{\ln(\cos(u)+\sin(u^2))}{u^2}$$ The derivative of the numerator is $$\frac{-\sin(u)+2u\cos(u^2)}{\cos(u)+\sin(u^2)}$$ because the derivative of $$\ln(f(x))$$ is $$f'(x)/f(x)$$ and not $$1/(f'(x)f(x))$$ as you wrote instead.
It's easier with a Taylor expansion: $$\cos(u)+\sin(u^2)=1-\frac{u^2}{2}+u^2+o(u^2)=1+\frac{u^2}{2}+o(u^2)$$ and therefore $$\lim_{u\to0}\frac{\ln(\cos(u)+\sin(u^2))}{u^2}= \lim_{u\to0}\frac{\ln(1+u^2/2+o(u^2))}{u^2}= \lim_{u\to0}\frac{u^2/2+o(u^2)}{u^2}=\frac{1}{2}$$