4

Let $x \in (-\frac{1}{2},\frac{1}{2}), n \in \mathbb{N}$

How can I choose a $n$ that the the inequality is valid?

$$\left|e^x-\sum_{k=0}^n \frac{x^k}{k!}\right| \leq \frac{|e^x|}{10^{16}}$$

My ideas: Try some values for $n$ and verify the inequality for value greater than $-1/2$ and less than $1/2$ because of the monotony of the exponential function... But I could not find a $n$.

Marc
  • 285

2 Answers2

12

By Taylor's formula with integral remainder,

$$ \left|e^{x}-\sum_{k=0}^{n}\frac{x^k}{k!}\right| = \left|\frac{1}{n!}\int_{0}^{x} e^t(x-t)^n\,dt\right|\leq e^{|x|}\frac{|x|^{n+1}}{(n+1)!}\leq \frac{e^{|x|}}{2^{n+1}(n+1)!} $$ hence it is sufficient to pick some $n$ such that $2^{n+1}(n+1)!\geq 10^{16}$.
$ n = \color{red}{14}$ does the job.

Jack D'Aurizio
  • 353,855
10

$$e^x-\sum_{k=0}^n \frac{x^k}{k!}= \sum_{k=n+1}^\infty \frac{x^k}{k!}= \frac{x^{n+1}}{(n+1)!}+ \frac{x^{n+2}}{(n+2)!}+\cdots = x^{n+1} {\left[ \frac{1}{(n+1)!}+ \frac{x}{(n+2)!}+\frac{x^2}{(n+3)!}+\cdots\right]} $$

$$\left|x^{n+1} {\left[ \frac{1}{(n+1)!}+ \frac{x}{(n+2)!}+\frac{x^2}{(n+3)!+\cdots}\right]}+\cdots\right|\le |x|^{n+1} {\left[ \frac{1}{0!}+ \frac{x}{1!}+\frac{x^2}{2!}{+\cdots}\right]}= |x|^{n+1} e^x \le \frac{1}{2^{n+1}}e^x $$ Now choose $n$ so that $\frac{1}{2^{n+1}}\le 10^{-16}$.

Burrrrb
  • 1,528
  • $\frac{1}{2^{n+1}}\le 10^{-16}$ seems to suggest $n \ge 53$ which I suspect is too high – Henry Nov 23 '17 at 17:52
  • 1
    I was reckless with the first inequality, it could be drastically sharpened. – Burrrrb Nov 23 '17 at 17:56
  • 4
    $\left|x^{n+1} {\left[ \frac{1}{(n+1)!}+ \frac{x}{(n+2)!}+\frac{x^2}{(n+3)!}\right]}+...\right|\le \frac{|x|^{n+1}}{(n+1)!} {\left[ 1+ \frac{x}{(n+1)}+\frac{x^2}{(n+2)(n+3)}{+...}\right]}\le \frac{|x|^{n+1}}{(n+1)!} e^x \le \frac{2^{-n-1}}{(n+1)!}e^x$ – Burrrrb Nov 23 '17 at 18:01
  • 1
    @Henry: For this problem, its impossible for $n$ to be too high. –  Nov 24 '17 at 00:01
  • @Hurkyl: Henry was probably talking about $53$ ;) – Eric Duminil Nov 24 '17 at 07:39