Let $f: \mathbb{R} \rightarrow \mathbb{R}, f(x):=\cos(x)e^x$.
Find a minimal $N \in \mathbb{N}$ such that $$|f(x)-T_Nf(x,0)| \le 10^{-6} \quad (x \in [-\frac{1}{10}, \frac{1}{10}]).$$
I've encountered this question here on Math SE before (here) but I would like to know how to solve it without using Lagrange.
After identifying all the derivatives up to $f^{(4)}$ (for instance), I got
$$\left|\,\cos(x)e^x-(-\frac16 x^4-\frac13x^3+1)\,\right| = \left|\,\cos(x)e^x+\frac16 x^4+\frac13x^3-1)\,\right| \le \\ \cos(\frac{1}{10})e^{1/10}+ \frac16 \cdot \frac{1}{10^4} + \frac13 \cdot \frac{1}{10^3} -1 \approx 0.11,$$
which isn't even close. So how to approach it?
Thanks in advance!
One easy way is to use complex numbers. You have $$ e^x\cos x=\operatorname{Re} e^x(\cos x+i\sin x)=\operatorname{Re} e^{(1+i)x}=\operatorname{Re} \sum_{k=0}^\infty\frac{(1+i)^kx^k}{k!}=\sum_{k=0}^\infty\frac{[(1+i)^k+(1-i)^k]x^k}{2k!}. $$ Then, for $|x|\leq 10^{-1}$, and using a fairly crude estimate at the end, \begin{align} \left|e^x\cos x-\sum_{k=0}^N\frac{[(1+i)^k+(1-i)^k]x^k}{2k!}\right| &=\left|\sum_{k=N+1}^\infty\frac{[(1+i)^k+(1-i)^k]x^k}{2k!}\right|\\ \ \\ &\leq \sum_{k=N+1}^\infty\frac{|1+i|^k10^{-k}}{k!}\\ \ \\ &= \sum_{k=N+1}^\infty\frac{(\sqrt2)^k10^{-k}}{k!}\\ \ \\ &\leq\frac1{(N+1)!}\sum_{k=N+1}^\infty (0.15)^k\\ \ \\ &=\frac{1}{(N+1)!}\frac{0.15^{N+1}}{1-0.15}\leq1.2\,\frac{0.15^N}{(N+1)!}. \end{align} The last expression has values $$ \begin{array} \text{N} &\hspace{1cm} 1.2\,\frac{0.15^N}{(N+1)!}\\ \hline1& \hspace{1cm} 0.09\\ 2&\hspace{1cm}0.0045\\ 3&\hspace{1cm}0.000169\\ 4&\hspace{1cm}5.06E-06\\ 5&\hspace{1cm}1.27E-07\\ \end{array} $$ So $N=5$ is enough. I don't think you can guarantee that it is minimal without "cheating" in some sense, i.e. having a priori a good estimate of $\cos 0.1\,e^{0.1}$.