0

I'm working on what seem to be very easy problems, but my answers aren't matching my textbook's.

1) Find the second Taylor polynomial of $f(x) = e^x\cos x$ about $x_0 = 0$.

$P_2(x) = 1+x$. (correct)

2) Use $P_2(.5)$ to approximate $f(.5)$. Find an upper bound for the error $|f(.5)-P_2(.5)|$ and compare it to the actual answer.

The error can be no greater than $R_2(.5) = \frac{e^.5(\sin(.5)+\cos(.5))}{24}=.0932$, the actual error is $.0531$. (correct)

Here is where my trouble starts:

3) Find a bound for the error $|f(x)-P_2(x)|$ in using $P_2(x)$ to approximate $f(x)$ on the interval $[0,1]$.

I've tried integrating the error function, which for this problem is $R_2(x) = \dfrac{-2e^\xi(\sin(\xi)+\cos(\xi)x^3}{6}$, from $0$ to $1$. I used the fact that the maximum value of $\sin(\xi)+\cos(\xi)=\sqrt{2}$, with $\xi = \pi/4$, but this gave me an incorrect answer.

Any help appreciated.

Bernard
  • 175,478
mXdX
  • 571
  • 3
  • 14

2 Answers2

1

hint

$$f(x)=P_2(x)+\frac{x^3}{6}f'''(\xi)$$

with

$$f'''(\xi)=-2(\cos(\xi)+\sin(\xi))e^{\xi}$$

$$=-2\sqrt{2}\cos(\xi-\frac{\pi}{4})e^\xi$$ thus

$$|f(x)-P_2(x)|\le \frac{\sqrt{2}}{3}e$$

0

I've tried integrating the error function

This isn't helpful. What we're looking for is an upper bound for the error - a largest possible value, not an integral. I would use that maximum for $\sin+\cos$; multiply it by the maximum for the exponential, and we have an upper bound for the relavant derivative. But then, we're not going to integrate anything.

jmerry
  • 19,403
  • When I do this, I get ~1.281, but my textbook gives an answer of ~1.252. I'm not sure if I did something wrong or if it's a typo. – mXdX Jan 13 '19 at 19:12
  • 1
    The problem says to find a bound. It does not say to find the best possible bound. You don't need to exactly match the answer to be right. – jmerry Jan 13 '19 at 19:15
  • 1
    In more detail on that last comment: the $\sin+\cos$ has a maximum inside the interval, while the exponential keeps increasing to the end. Because they don't line up in the same place, the maximum of the product appears somewhere between, with a value less than the product of the maximums. We could find it exactly, but it's a lot of effort for not much gain. – jmerry Jan 13 '19 at 19:33
  • I see. So we're taking the maximum of the exponential and the maximum of sinx+cosx at the the same time, even though their maximums don't occur at the same time. However, it still gives us some bound, even though there are smaller upper bounds. Right? – mXdX Jan 13 '19 at 19:52
  • 1
    Yes, that's it. – jmerry Jan 13 '19 at 19:57