Finding the limit as $x$ approaches $0$ 
I was shown the above problem in my calculus class today.  It seems that one can solve the limit in white by realizing that it mirrors the limit in yellow.
However, I don't understand what the exact relationship between those two limits is. My TA went over it rather quickly. Can someone explain what point he was trying to make?
 A: $f'(x_0)=\lim_{x \to x_0} \frac{f(x)-f(x_0)}{x-x_0}$
Take $x_0=0$ and $f(x)=\cos{(1+\ln{(x^2+1)})}$
We have that $f(0)=\cos{1}$
We can see that $f$ is differentiable on all $\mathbb{R}$ as a composition of differentiable functions.
So your limit  is the derivative of $f$ at $x_0=0$ namely $f'(0)$
Thus $f'(x)=\frac{d(\cos{(1+\ln{(x^2+1)})})}{dx}=-\sin{(1+\ln{(x^2+1)})})(\frac{2x}{x^2+1})$ and $f'(0)=0$
Thus the limit is $0$
A: Hint: Three applications of the formula in yellow give
$$
\begin{align}
&\lim_{x\to0}\frac{\cos\left(1+\ln\left(1+x^2\right)\right)-\cos(1)}{x}\\
&=\underbrace{\lim_{x\to0}\frac{\cos\left(1+\ln\left(1+x^2\right)\right)-\cos(1)}{\ln\left(1+x^2\right)-0}}_{\substack{h(u)=\cos(1+u)\\u=\ln\left(1+x^2\right)}}\,\underbrace{\lim_{x\to0}\frac{\ln\left(1+x^2\right)-0}{x^2-0\vphantom{\left(x^2\right)}}}_{\substack{h(u)=\ln\left(1+u\right)\\u=x^2}}\,\underbrace{\lim_{x\to0}\frac{x^2-0}{x-0\vphantom{\left(x^2\right)}}}_{\substack{h(u)=u^2\\u=x}}
\end{align}
$$
A: This should be considered as a comment which is too long to fit in comment box.

The technique given in your question is about observing that the limit is of the form $$\lim_{x\to a} \frac{f(x) - f(a)} {x-a} $$ for a suitable $f$ and $a$ and then you can simply evaluate it as $f'(a) $. The technique is quite common (can be seen in some answers on this website also) but there are certain fine points to note when using this technique:


*

*It takes some amount of experience to figure out the function $f$ but this part of the technique is not difficult.

*It works only when the function $f$ is elementary or is such that the formula for derivative $f'(x) $ can be given easily by using rules of differentiation. 

*And finally the above mentioned formula for $f'(x) $ also works for $x=a$. This is the key assumption which amouts to continuity of the derivative $f'$ at $a$.


Unless one is aware of the above limitations it is best to avoid this technique. You may have a look at this answer to a related question for some more discussion on this.
