# How to use Lagrange remainder formula?

I'm in the process of learning about the Lagrange error bound formula. I understand the theory behind it, but not the application of it. How would I use it to determine the smallest degree polynomial in order to approximate $e$ to within 0.02% of its actual value from $f(x)=e^x$ ?

• The question seems ill-posed. – Jacky Chong Apr 8 '17 at 20:04
• In this answer, I've worked through almost this very example. – user14972 Apr 8 '17 at 20:34

So, in practice, for $f(x)=e^x$ your remainder term would look like(after performing the n-th order Taylor expansion about $0$)

$R_n(x)=\frac{x^{n+1}e^c}{(n+1)!}$ for some $c\in(0,x)$.

If you're looking to approximate $e$, you'll want to set $x=1$ So that,

$R_n(1)=\frac{e^c}{(n+1)!}$ where $c\in(0,1)$.

We can take a crude bound on $e^c$, say for instance $e^c<3$ (since $c\in(0,1)$), so that

$R_n(1)<\frac{3}{(n+1)!}$

Now we see that getting the error to the desired size, we can just taylor expand to sufficiently large order.

For instance, if you have n=5, then $R_n(1)<\frac{3}{720}$ so that the error is less than $0.01$. This error only decreases as $n$ increases. So getting the desired accuracy is just a matter of choosing n to be large enough in this case.

• Just a quick question on this: why $xe^c$ rather than $x^(n+1)e^c$? – rb612 Apr 9 '17 at 1:03
• Sorry, I meant $x^{(n+1)}e^c$. – rb612 Apr 9 '17 at 6:06
• Apologies, you're absolutely right. Edited. Sorry for the typo. Good catch. – user433011 Apr 9 '17 at 6:31

I'm on my mobile phone which makes this tedious to type up, but the basic idea is that you can think of the error term as a function, $L(x,n)$. You have $x=1$ because you want to approximate $e^1$ and you know what to set the equation equal to, so then you just solve for $n$ and round to the next integer.