Spivak, Ch. 20, Problem 15: Prove that if $x\leq 0$, then the remainder term $R_{n,0}$ for $e^x$ satisfies $|R_{n,0}|\leq \frac{|x|^{n+1}}{(n+1)!}$. The following is a problem from Chapter 20 of Spivak's Calculus



*Prove that if $x\leq 0$, then the remainder term $R_{n,0}$ for $e^x$ satisfies

$$|R_{n,0}|\leq \frac{|x|^{n+1}}{(n+1)!}$$

My question is about the solution in the solution manual, which I show below.
First let me show my own attempt at solving this problem. If $x=0$, both sides are $0$. Assume $x\lt0$.
$$e^x=\sum\limits_{i=0}^n \frac{x^i}{i!}+\frac{e^t}{(n+1)!}x^{n+1}, \quad t\in (x,0)$$
We know that for $t<0$ we have $0<e^t<1$.
Thus,
$$|R_{n,0,e^x}(x)|=\frac{e^t}{(n+1)!}|x|^{n+1}<\frac{|x|^{n+1}}{(n+1)!}$$
Is my attempt correct?

When I looked at the solution manual, however, I was slightly bewildered. Here is what it has
$$\left | \int_0^x \frac{e^t}{n!}(x-t)^n dt \right |= \int_x^0 \frac{e^t}{n!} |x-t|^n dt $$
$$\leq \int_x^0 \frac{|x-t|^n}{n!} dt, \text{since } e^x\leq 1 \text{ for } x\leq 0$$
$$=\frac{|x|^{n+1}}{(n+1)!}$$
Why is the solution manual using an integral, and what is the expression $\frac{e^t}{n!}(x-t)^n$? It looks like a remainder, but I don't understand the $t$ in the $x-t$ factor that is the same as the exponent in $e^t$.
 A: Yes, your attempt is correct.
The solution manual uses the Taylor series with remainder in integral form
$\newcommand{\d}{\,\mathrm{d}}$
While you are using the Taylor series of $e^x$ at $x=0$ with the remainder in Lagrange form,
$$e^x=\sum\limits_{i=0}^n \frac{x^i}{i!}+\frac{e^t}{(n+1)!}x^{n+1}, \quad \text{for some }t\text{ between } 0\text{ and } x$$
the solution manual is using the Taylor series of $e^x$ at $x=0$ with the remainder in integral form
$$e^x=\sum\limits_{i=0}^n \frac{x^i}{i!}+\int_0^x \frac{f^{(n+1)}(t)}{n!}(x-t)^n \d t, $$
where $f(x)=e^x$ and $f^{(n+1)}(t)$ is $\left.f^{(n+1)}(x)\right|_{x=t}$, the $n{+}1$-th derivative of $f(x)$ at $x=t$.
We know the magical, wonderful and confusing fact that $f^{(m)}(x)=e^x$ for any positive integer $m$. Hence, the $n$-th remainder term for $e^x$ at $x=0$
$$R_{n,0}(e^x)=e^x-\sum\limits_{i=0}^n \frac{x^i}{i!}=\int_0^x \frac{e^t}{n!}(x-t)^n \d t.$$
Yes, the variable $t$ in the $x-t$ factor is the same as the exponent $t$ in $e^t$ in the integration above, of course. It has nothing to do with the $t$ in the numerator $e^t$ in the remainder in Lagrange form, though.
The former $t$ is a dummy variable that has nothing to do with $x$ and $n$. We can rewrite
$\int_0^x \frac{e^t}{n!}(x-t)^n \d t$ as $\int_0^x \frac{e^y}{n!}(x-y)^n \d y$ or $\int_0^x \frac{e^a}{n!}(x-a)^n \d a$ or replacing $t$ with any letter of your choice except $x$.
However, the latter $t$ depends on $x$ and $n$. In fact, we can express that $t$ in terms of $x$ and $n$:
$$t=\log\left(\frac{(n+1)!}{x^{n+1}}\left(e^x-\sum\limits_{i=0}^n \frac{x^i}{i!}\right)\right)\quad\text{ for all }x.$$
The Tayler series you used just says that $t$ as defined/computed above is well-defined and between $0$ and $x$.
A proof for the Taylor series with remainder in integral form
Let us prove some more general cases.
For any $f(x)$ such that $f^{(n+1)}(x)$ is continuous from $a$ to $x$ inclusive, we have for all $0\le k\le n$,
$$\begin{equation}\tag{*}\label{*}
f(x)=f(a)+{\frac {f'(a)}{1!}}(x-a)+\cdots +{\frac {f^{(k)}(a)}{k!}}(x-a)^{k}+\int _{a}^{x}{\frac {f^{(k+1)}(t)}{k!}}(x-t)^{k}\d t\end{equation}$$
Proof: The fundamental theorem of calculus states that
$$f(x)=f(a)+\int _{a}^{x}\,f'(t)\d t,$$
which is the case of $k=0$. (Note that $0!=1$, $(x-t)^0=1$).
Integrating the last term of $\eqref{*}$ by parts we arrive at
$$\begin{aligned}\int _{a}^{x}{\frac {f^{(k+1)}(t)}{k!}}(x-t)^{k}\,dt=&-\left[{\frac {f^{(k+1)}(t)}{k!}}\frac{(x-t)^{k+1}}{k+1}\right]_{t=a}^{x}+\int _{a}^{x}{\frac {f^{(k+2)}(t)}{k!}}\frac{(x-t)^{k+1}}{k+1}\d t\\
=&\ {\frac {f^{(k+1)}(a)}{(k+1)!}}(x-a)^{k+1}+\int _{a}^{x}{\frac {f^{(k+2)}(t)}{(k+1)!}}(x-t)^{k+1}\d t.\end{aligned}$$
Substituting this into the formula in $\eqref{*}$ shows that if it holds for the value $k$, it must also hold for the value $k + 1$, as long as $k\lt n$. Since it holds for $k = 0$, it must hold for every integer $0\le k\le n$.
The proof is from wikipedia, slightly adapted.
A: After reading this text, we can prove we can rewrite a general remainder term $R_{n,a}(x)$ in an integral form:
$$f\left(x\right)-\sum_{j=0}^{n}\frac{f^{\left(j\right)}\left(a\right)}{j!}\left(x-a\right)^{j}=\frac{1}{n!}\int_{a}^{x}f^{\left(n+1\right)}\left(t\right)\left(x-t\right)^{n}dt.$$
Translating that over to our situation, suppose $x \leq 0$ and $f(x) = e^x$. Assuming you meant $R_{n,0} = R_{n,0}(x)$, we get that remainder term to be
$$
\eqalign{
\left|e^{x}-\sum_{i=0}^{n}\frac{1}{i!}\left[\frac{d^{i}}{dx^{i}}e^{x}\right]_{x=0}\left(x-0\right)^{i}\right| &= \left|\frac{1}{n!}\int_{0}^{x}\left[\frac{d^{n}}{dx^{n+1}}e^{x}\right]_{x=t}\left(x-t\right)^{n}dt\right| \cr
&= \left|\int_{0}^{x}\frac{e^{t}}{n!}\left(x-t\right)^{n}dt\right| \cr
&= \int_{x}^{0}\frac{e^{t}}{n!}\left|x-t\right|^{n}dt. \cr
}
$$
Since $t \in [x,0]$, we have $e^t \in [e^x,1]$. Thus,
$$
\eqalign{
\int_{x}^{0}\frac{e^{t}}{n!}\left|x-t\right|^{n}dt &\leq \int_{x}^{0}\frac{1}{n!}\left|x-t\right|^{n}dt \cr
&= \frac{1}{n!}\int_{x}^{0}\frac{x-t}{\left|x-t\right|}\left(x-t\right)^{n}dt \cr
&= \frac{1}{n!}\int_{0}^{x}\left(x-t\right)^{n}dt \cr
&= \frac{x^{n+1}}{\left(n+1\right)!} \cr
&= \frac{\left|x\right|^{n+1}}{\left(n+1\right)!}. \cr
}
$$

In addition, is my attempt correct?

Yes.

Why is the solution manual using an integral?

(Opinion) As someone who doesn't own a Spivak textbook, I'm not sure why the author chose an integral approach. There's an easier way to prove the problem, but maybe the author considered my proof trivial. I expanded on the solution manual because it seemed like you were confused about it as a whole.
Hopefully, this post sheds some light.
