Struggling to find upper bound on Lagrange error

223 Views Asked by At

The Question: "Let $f(x) = e^x$. Find the upper bound on the error in the approximation $f(x) \approx P_n(x)$, where $P_n(x)$ is the order 'n' Taylor polynomial of $f(x)$ about a = 0, valid for every $|x|\le$ 1. (The bound is going to the depend on n)."

I know $P_n(x)$ of $f(x)$ is equal to $\sum_{n=0}^\infty \frac{x^n}{n!}$ and $|E_n(x)| \le \frac{f^{n+1}(z) |x-a|^{n+1}}{(n+1)!}$, which equals to $\frac{e^z |x|^{n+1}}{(n+1)!}$ in this question.

I thought x = 1 because z has to be between a (which is 0) and x. I figured that no matter what the absolute value of x has to be between 0 and 1 (or $[0, 1]$).

Once I set z equal to 1 (which would give the maximum error) and started plugging in numbers for n, I got $E_2(x) = 0.453046$, which is obviously less than 1. So I figured that was the answer, but I ended up getting it wrong.

So my question is, how do you solve this question and how do you generally find the upper bound of Lagrange error without a known 'x'?

Edit: After asking my professor for help, I finally got it. I was right to set z = 1 (although I should have tested it at both -1 and 1). My professor said that x should equal the maximum value on |x| $\le$ 1. So $E_n(x) = \frac{e |1|^{n+1}}{{n+1}!}$.

The reason I kept getting it wrong was because you don't have to solve for n. I just had to show what $E_n(x)$ was.