# Upper bound for Taylor polynomial for $f(x) = e^x \cdot \cos(x)$ on $[0,1]$

Let $$f:[0,1] \to \mathbb{R}, f(x) = e^x \cdot \cos(x)$$. I want to find a sharp upper bound for the absolute value of the remainder term of the second order Taylor polynomial of $$f$$ around $$0$$, on the interval $$[0,1]$$.

It's pretty straightforward to see that the second order Taylor polynomial of $$f$$ is $$P_2(x) = 1 + x, \forall x \in [0,1].$$

Now, by the definition of the remainder (Lagrange remainder), for every $$x \in (0,1)$$ there is some $$c_x \in (0,x)$$ such that $$f(x) - P_2(x) = R_2(x) = \frac{f'''(c_x)}{3!} \cdot x^3 = -\frac{1}{3}e^{c_x}(\sin(c_x) + \cos(c_x)) \cdot x^3,$$ so $$|R_2(x)| = \frac{1}{3}e^{c_x} (\sin(c_x) + \cos(c_x)) \cdot x^3,$$ since $$\sin(t), \cos(t) \geq 0, \forall t \in [0,1]$$. Hence, we can deduce an upper bound for $$R_2$$: $$|R_2(x)| \leq \frac{1}{3}e(\sin(\pi/4) + \cos(\pi/4)) = \frac{\sqrt{2}}{3} e, \forall x \in [0,1],$$ since $$x^3 \leq 1, \forall x \in [0,1]$$, $$e^{c_x} \leq e, \forall x \in [0,1]$$ and $$\sin(c_x) + \cos(c_x) \leq \sin(\pi/4) + \cos(\pi/4), \forall x \in [0,1]$$. Can we make this sharper?

• Of course you can make it sharper. You want $\sup_{x \in [0,1]} |e^x\cos(x)-1-x|$. Just use a computer to test the values at $x=\frac{j}{N}$ for $j=0,1,\dots,N-1,N$ for a large $N$ and use a derivative bound to bound the values for the other values of $x$. – mathworker21 Sep 7 '19 at 9:07
• Simplify by taking advantage of $\ \sin\frac{\pi}4+\cos\frac{\pi}4\ =\ \sqrt 2.$ – Wlod AA Sep 7 '19 at 9:08
• Graphical evaluation of the quotient gives a line from about 0.04 at $x=0$ to 0.07 at $x=1$, which means that there is clearly room for improvement. // However, did you miss to transfer the denominator 3!=6? Then the range of the quotient is only from 0.26 to 0.42, which nearly does not justify further efforts. – Lutz Lehmann Sep 7 '19 at 9:12
• Oh yeah, I forgot about $3!$, I'll edit now. – Logan Sep 7 '19 at 9:16
• Confusion! The title says one thing ($\sup f$) but inside the question, you aim at something different (the remainder). Thus, could you state explicitely what is your question? e.g. you may start a new line with the word QUESTION: followed by the actual unique question. – Wlod AA Sep 7 '19 at 16:35

If you look at the $$e^c(\sin c+\cos c)$$ part, you can see that it's strictly increasing in the $$[0,1]$$ interval. Take the derivative with respect to $$c$$, you can see that it's always positive. That means that the maximum value is at $$c=1$$. And $$\sin 1+\cos 1\approx 1.38<\sqrt 2$$
You can always take the next higher degree Taylor polynomial and its remainder term to get a better remainder term in the original degree. With $$f(x)=Re(e^{(1+i)x})\implies f^{(n)}(x)=Re((1+i)^ne^{(1+i)x})$$ we get $$f'(x)=(\cos(x)-\sin(x))e^x\\ f''(x)=-2\sin(x)e^x\\ f'''(x)=-2(\cos(x)+\sin(x))e^x\\ f^{(4)}(x)=-4\cos(x)e^x$$ so that $$e^x\cos x=1+x-\frac{x^3}3-\frac{e^{c_x}\cos(c_x)x^4}6$$ $$e^c\cos(c)$$ has its maximum at $$c=\frac\pi4$$ with value $$1.5508...<1.6$$ so that $$|e^x\cos x-1-x|\le \frac{x^3}6(2+1.6x),$$ which is closer than the previous bound.