Is it valid to apply L'hopital rule to evaluate the limit? $$\lim_{x\to 0^+}\frac{2\tan x(1-\cos x)}{\sqrt{x^2+x+1}-1}$$
In the book I am reading, the limit evaluated in this way:
$$\lim_{x\to 0^+}\frac{2\tan x(1-\cos x)}{\sqrt{x^2+x+1}-1}\times \frac{\sqrt{x^2+x+1}+1}{\sqrt{x^2+x+1}+1}=\lim_{x\to 0^+}\frac{2\tan x(1-\cos x)}{x^2+x}\times\left(\sqrt{x^2+x+1}+1\right)$$
Then it used equivalence and wrote:
$$\lim_{x\to 0^+}\frac{2x\left(\frac12x^2\right)}{x^2+x}\times\left(\sqrt{x^2+x+1}\right)=\lim_{x\to 0^+}\frac{x^3}{x(x+1)}.\left(\sqrt{x^2+x+1}\right)=0$$
I wonder why we should do all these calculation? Is it possible to use L'hopital rule and get $\frac0{\tfrac12}=0$ ?
 A: Short answer:
$$\tan x\sim x$$
and
$$\sqrt{x^2+x+1}-1\sim\frac x2.$$
Hence the factor $1-\cos x$ makes the limit tend to zero.
A: Yes since the expression is in the form $\frac 0 0$ we are allowed to use l'Hospital to obtain
$$\lim_{x\to 0^+}\frac{2\tan x(1-\cos x)}{\sqrt{x^2+x+1}-1}=\lim_{x\to 0^+}\frac{2 \sec^2 x - 2 \cos x}{\frac{2 x + 1}{2 \sqrt{x^2 + x + 1}}}=\frac{0}{\frac12}=0$$

Note that often use l'Hospital's rule is esplicitely not allowed because when we use it blindly we can't really understand what it is going to determine the limit. For these reason is good to solve limits in more than one way, using standard limits when possible.
In this case as an alternative we can proceed as follows
$$\frac{2\tan x(1-\cos x)}{\sqrt{x^2+x+1}-1}=2\frac{\tan x}{x}\frac{1-\cos x}{x^2}\frac{x^3}{\sqrt{x^2+x+1}-1}\frac{\sqrt{x^2+x+1}+1}{\sqrt{x^2+x+1}+1}$$
which allows to conclude by standard limits.

I also exhort not expert users to do not proceed blindly by asymptotic equivalence since it can leads to wrong results if we use this way without the necessary attention. For example as $x \to 0$ for $\frac{1- \cos x}{x^2}$ we could wrongly state that limit is zero since $\cos x \sim 1$ or with $\frac{x- \sin x}{x^3}$ also since $\sin x \sim x$.
