<s>[INST] Proof of the following approximation for $|x| \leqslant 1$ we have $1+x \leqslant e^x \leqslant1+x+x^2$ I was going through the text Introduction to Algorithms by Cormen et. Al. where I came across the following approximation...

for $|x| \leqslant 1$ we have $1+x \leqslant e^x \leqslant 1+x+x^2$

Now I could prove the left side of the inequality and it holds for all real $x$. I proved using Mean Value Theorem( Taylor Series).
Let $f(x)= e^x$
So by Mean Value Theorem we have,
$$f(x) = f(0) + x.f'(\vartheta x) = e^0 + x.e^{\vartheta x} , 0< \vartheta <1 $$
$$ 0< \vartheta < 1 $$
Case 1:
(if $x \geqslant 0$)
$$\begin{aligned}\implies &0 \leqslant \vartheta .x \leqslant x\\\implies& e^0 \leqslant e^{\vartheta .x} \leqslant e^x\\\implies &x.1 \leqslant x.e^{\vartheta .x} \leqslant x.e^x\\\implies& 1+x \leqslant 1+x.e^{\vartheta .x} \leqslant 1+x.e^x\end{aligned}$$
$$\implies 1+x \leqslant f(x) \leqslant 1+x.e^x \ldots\tag 1$$
Case 2:
(if $x \lt 0$)
$$\begin{aligned}\implies &0 \gt \vartheta .x \gt x\\\implies& e^0 \gt e^{\vartheta .x} \gt e^x\\\implies& x.1 \lt x.e^{\vartheta .x} \lt x.e^x\\\implies& 1+x \lt 1+x.e^{\vartheta .x} \lt 1+x.e^x\end{aligned} $$
$$\implies 1+x \lt f(x) \lt 1+x.e^x \ldots\tag 2$$
So from cases $(1)$ and $(2)$ we have that $e^x \geqslant 1+x\ \forall x\in\Bbb R$ and hence for $|x| \leqslant 1$ .
Now my attempt to prove the right inequality.
Here again I attempt using Taylor Series,
$$f(x) = f(0) + x.f'(0) + \frac{x^2}{2!}.f''(\theta .x) = e^0 + x.e^0+ \frac{x^2}{2!}.e^{\vartheta .x} , 0< \vartheta <1 $$
$$\implies f(x) = 1 + x + \frac{x^2}2.e^{\vartheta .x} $$
(if $0\leqslant x \leqslant 1$)
$$\begin{aligned}\implies& 0 \leqslant \theta .x \leqslant x\\\implies& e^0 \leqslant e^{\vartheta .x} \leqslant e^x\\\implies& \frac{x^2}2.1 \leqslant \frac{x^2}2.e^{\vartheta .x} \leqslant \frac{x^2}{2}.e^x\\\implies& 1+ x +\frac{x^2}{2} \leqslant 1+x+\frac{x^2}{2}.e^{\vartheta .x} \leqslant 1+x+\frac{x^2}2.e^x\end{aligned}$$
$$\implies 1+ x +\frac{x^2}2\leqslant f(x) \leqslant 1+x+\frac{x^2}2.e^x\ldots\tag 3$$
Now,
$$\begin{aligned}0\leqslant x \leqslant 1 \implies& 1 \leqslant e^x \leqslant e \implies \frac12 \leqslant \frac{e^x}2 \leqslant \frac{e}2(\approx 1.4)\\\implies &1+x+\frac12.x^2 \leqslant 1+x+\frac{e^x}2.x^2 \leqslant 1+x+\frac{e}2x^2 \lt 1+x+ 1.4 x^2\end{aligned}$$
How to show a more tighter bound for f(x)? I don't get it. Maybe I made some mistake.
(if $-1\leqslant x \lt 0$)
$$\begin{aligned}\implies 0 \gt \vartheta .x \gt x\\\implies& e^0 \gt e^{\vartheta .x} \gt e^x\\\implies&\frac{x^2}{2}.1 \gt \frac{x^2}2.e^{\vartheta .x} \gt \frac{x^2}2.e^x\\\implies &1+ x +\frac{x^2}{2} \gt 1+x+\frac{x^2}2.e^{\vartheta .x} \gt 1+x+\frac{x^2}2.e^x\\\implies &1+ x +\frac{x^2}{2} \gt f(x) \gt 1+x+\frac{x^2}2.e^x\end{aligned}$$
$$\implies 1+x+\frac{x^2}2.e^x \lt f(x) \lt 1+ x +\frac{x^2}2 \lt 1+ x +x^2 \ldots\tag 4$$
 [/INST] For $0\leq x\leq 1$, we have
\begin{align*}
e^x  - 1 - x - x^2  & =  - \frac{{x^2 }}{2} + \sum\limits_{n = 3}^\infty  {\frac{{x^n }}{{n!}}}  \le  - \frac{{x^2 }}{2} + \sum\limits_{n = 3}^\infty  {\frac{{x^2 }}{{n!}}} \\ & =  - \frac{{x^2 }}{2} + x^2 \left( {e - 1 - 1 - \frac{1}{2}} \right) = x^2 (e - 3) \leq 0.
\end{align*}
</s>