On The Question of A Squeeze-Derivative Definition Question: Find $g'(0)$ where $$g(x)=\left(x+1\right)^2 \left(1+\cos{\left(\sqrt{|\tan{(x+1)}|}\right)}\right)+\sqrt{x^4+4x+1}\left(1-\cos{\left(\sqrt{|\tan{(x+1)}|}\right)}\right).$$
The above question was asked by my professor as an exam question. When I was in the exam, I remember doing the following operations; I wanted to use some kind of linear approximation of $L(x)$ so around $a=0$; $\cos{x}\approx 1$ but somehow this operation is valid when the interior of the $\cos$ function approaches zero. I think I could use this: $$-1 \leq \cos{\left(\sqrt{|\tan{(x+1)}|}\right)} \leq 1,$$ $$0\leq 1-\cos{\left(\sqrt{|\tan{(x+1)}|}\right)}\leq 2,$$ $$0\leq \sqrt{x^4+4x+1}\left(1-\cos{\left(\sqrt{|\tan{(x+1)}|}\right)}\right) \leq 2\sqrt{x^4+4x+1},$$ and note that: $$0 \leq (x+1)^2\left(1+\cos{\left(\sqrt{|\tan{(x+1)}|}\right)}\right)\leq 2(x+1)^2;$$ so,
$$0 \leq g(x) \leq 2(x+1)^2+2\sqrt{x^4+4x+1}.$$
Now, I feel that I should use some kind of derivative definition here, as given in the hint in the exam, but I can't reach the conclusion.
 A: Let $\;g_1(x)=x^2+2x+1+\sqrt{x^4+4x+1}\;.$
Let $\;g_2(x)=\left[x^2\!+\!2x\!+\!1\!-\!\sqrt{x^4\!+\!4x\!+\!1}\right]\cos\left(\!\sqrt{|\tan(x+1)|}\right).$
It results that
$\dfrac{g(x)-g(0)}x=\dfrac{g_1(x)-g(0)}x+\dfrac{g_2(x)}x\;.$
$\dfrac{g_1(x)-g(0)}x=\dfrac{x^2+2x+1+\sqrt{x^4+4x+1}-2}x=$
$=\dfrac{x^2+2x}x+\dfrac{\sqrt{x^4+4x+1}-1}x=$
$=x+2+\dfrac{x^4+4x+1-1}{x\left(\sqrt{x^4+4x+1}+1\right)}=$
$=x+2+\dfrac{x^3+4}{\sqrt{x^4+4x+1}+1}\to2+\dfrac42=4\;\;$ as $\;\;x\to0\;.$
Moreover ,
$\dfrac{g_2(x)}x=\dfrac{\left[x^2\!+\!2x\!+\!1\!-\!\sqrt{x^4\!+\!4x\!+\!1}\right]\cos\left(\!\sqrt{|\tan(x+1)|}\right)}x=$
$=\dfrac{\left[\left(x^2+2x+1\right)^2-x^4-4x-1\right]\cos\left(\sqrt{|\tan(x+1)|}\right)}{x\left(x^2+2x+1+\sqrt{x^4+4x+1}\right)}=$
$=\dfrac{\left(4x^3+6x^2\right)\cos\left(\sqrt{|\tan(x+1)|}\right)}{x\left(x^2+2x+1+\sqrt{x^4+4x+1}\right)}=$
$=\dfrac{\left(4x^2+6x\right)\cos\left(\sqrt{|\tan(x+1)|}\right)}{x^2+2x+1+\sqrt{x^4+4x+1}}\;.$
Hence ,
$0\leqslant\left|\dfrac{g_2(x)}x\right|\leqslant\dfrac{\left|4x^2+6x\right|}{x^2\!+\!2x\!+\!1+\!\sqrt{x^4\!+\!4x\!+\!1}}\to0\;\;$ as $\;\;x\to0\,.$
Consequently ,
$\dfrac{g_2(x)}x\to0\;\;$ as $\;\;x\to0\;.$
Therefore ,
$\begin{align}g’(0)&=\lim_\limits{x\to0}\dfrac{g(x)-g(0)}x=\lim_\limits{x\to0}\left(\dfrac{g_1(x)-g(0)}x+\dfrac{g_2(x)}x\right)=\\
&=4+0=4\;.\end{align}$
