TITLE: Proof for and Intuition behind Taylor's Theorem
QUESTION [7 upvotes]: I notice that multiple versions of a theorem are called Taylor (univariate/multivariate, approximate/exact). But I do not find it trivial to infer proof of one version from the rest. So looking for a reference or note that gives some intuition about why it is true and also proves the specific version I am writing below.

Taylor's Theorem Suppose that $f: \mathbb{R}^n \to \mathbb{R}$ is continuously differentiable and that $p \in \mathbb{R}^n$, then we
  have that 
$$f(x+p) =f(x) + \nabla f(x+tp)^Tp$$
for some $t \in (0,1)$.
Moreover if $f$ is twice continuously differentiable, we have that 
  $$\nabla f(x+p)= \nabla f(x)  + \int_{0}^1 \nabla^2 f(x+tp)pdt,$$
and that $$f(x+p)  =f(x) +\nabla f(x)^Tp + \frac{1}{2} p^T\nabla^2
> f(x+tp)p,$$ for some $t \in (0,1)$.

It is supposed to be available in any calculus textbook.

REPLY [6 votes]: For intuition, you can discover the single variable Taylor approximations by starting with
\begin{align*}
f(x) &= f(x_0) + \int_{x_0}^x f'(s) \, ds \\
&\approx f(x_0) + \int_{x_0}^x \underbrace{f'(x_0) + f''(x_0)(s - x_0)}_{\text{first-order approximation to $f'(s)$}} \, ds \\
&= f(x_0) + f'(x_0)(x - x_0) + \frac{f''(x_0)}{2}(x - x_0)^2.
\end{align*}
Using a higher order approximation to $f'(s)$, such as
\begin{equation*}
f'(s) \approx f'(x_0) + f''(x_0) (s - x_0) + \frac{f'''(x_0)}{2}(s - x_0)^2
\end{equation*}
yields higher order Taylor approximations to $f(x)$.
Multivariable Taylor theorems can be deduced from the single variable case as follows.  If $f:\mathbb R^n \to \mathbb R$, introduce the function 
\begin{equation*}
g(t) = f(x_0 + t(x - x_0)).
\end{equation*}
Note that $g(0) = f(x_0)$ and $g(1) = f(x)$.
Then you can use the approximation
\begin{equation*}
g(1) \approx g(0) + g'(0)(1 - 0) + \frac{g''(0)}{2}(1 - 0)^2
\end{equation*}
to obtain
\begin{equation*}
f(x) \approx f(x_0) + \langle \nabla f(x_0), x - x_0 \rangle + \frac12 \langle x - x_0, Hf(x_0)(x - x_0) \rangle
\end{equation*}
where $Hf(x_0)$ is the Hessian of $f$ at $x_0$.
You can get a rigorous multivariable Taylor's theorem by keeping track of the remainder.  The remainder term for $g$ gives you a remainder term for $f$.
To get a rigorous Taylor's theorem in the single variable case, I like the following approach.  Suppose that $f:[x_0,x] \to \mathbb R$ is continuous on $[x_0,x]$
and differentiable on $(x_0,x)$. Let
\begin{equation*}
\tag{$\spadesuit$} h(s) = f(s) - f(x_0) - f'(x_0)(s - x_0) -\frac{M}{2}(s - x_0)^2
\end{equation*}
where $M$ is chosen so that $h(x) = 0$.  Note that $h(x_0) = 0$ and 
$h'(x_0) = 0$ automatically.
By Rolle's theorem, there exists $z_1 \in (x_0,x)$ such that $h'(z_1) = 0$.
Using Rolle's theorem again, there exists
$z_2 \in (x_0,z_1)$ such that $h''(z_2) = 0$.
But this implies (using $(\spadesuit$)) that
\begin{equation*}
M = f''(z_2).
\end{equation*}
Letting $s = x$ in $(\spadesuit)$ we conclude that
\begin{equation*}
f(x) = f(x_0) + f'(x_0)(x - x_0) + \frac{f''(z_2)}{2}(x - x_0)^2
\end{equation*}
for some $z_2 \in (x_0,x)$.
This argument can be extended easily to yield higher order Taylor theorems with remainder terms.