<s>[INST] Compute this limit $\lim_{x\to0}\frac{\sin(x^2+\frac{1}{x})-\sin\frac{1}{x}}{x}$ using L'Hôpital's rule I have asked this problem before, but I can't understand the explanation, I couldn't understand how the sin multiply for cos, and too multiply for A + and - B: $$\sin(A)-\sin(B)=2\sin\left(\frac{A-B}{2}\right)\cos\left(\frac{A+B}{2}\right)$$ and I don't understand in this step how/why the $A-B$ and $A+B$ was replaced by $\frac{x^2}{2}$ and $\frac{x^2}{2}+\frac{1}{x}$ :
$$\lim_{x\to0}\frac{\sin\left(x^2+\frac1x\right)-\sin\left(\frac1x\right)}{x}= \lim_{x\to0}\frac{2\sin\left(\frac{x^2}{2}\right)\cos\left(\frac{x^2}{2}+\frac1x\right)}{x}.$$
 [/INST] It's easier if you use the plain old addition formula:
$$\sin{\left(x^2+\frac{1}{x}\right)}  = \cos{x^2}\, \sin{\frac{1}{x}} +  \sin{x^2} \,\cos{\frac{1}{x}}$$
which behaves as
$$\left(1-\frac12 x^2\right) \sin{\frac{1}{x}} + x^2 \cos{\frac{1}{x}}$$
so that
$$\frac{\sin{\left(x^2+\frac{1}{x}\right)} - \sin{\frac{1}{x}}}{x} \sim \frac{x^2 \cos{\frac{1}{x}} - (1/2)x^2 \sin{\frac{1}{x}}}{x}$$
which goes to zero as $x \to 0$.
</s>