# Lagrange Error Bound Confusion

**URL:** <https://boards.straightdope.com/t/lagrange-error-bound-confusion/942588>\
**Category:** Factual Questions\
**Created:** [May 21, 2021, 1:59am UTC](https://boards.straightdope.com/t/lagrange-error-bound-confusion/942588 "2021-05-21T01:59:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Someonewastaken](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@Someonewastaken](https://boards.straightdope.com/u/Someonewastaken)\
**Post date:** [May 21, 2021, 1:59am UTC](https://boards.straightdope.com/t/lagrange-error-bound-confusion/942588/1 "2021-05-21T01:59:38Z")

</div>

If you have e^x and you want to make sure that the error between the Taylor series (centered at 0) and the actual function is less than 0.000001 when x=2, to what degree must the Taylor polynomial be?

I understand that the error bound uses the max value of the n+1 derivative, but how would you find the max value if e^x has a range of (0,inf). Would you use e^2 as the max value?

> **[Lagrange Error Bound Problem](https://www.desmos.com/calculator/lz7ljkyth3)**
>
> Lagrange Error Bound Problem

This is what I have been looking at.

P.S. I got my answer as the 14th degree polynomial and I am uncertain if it is correct.

---

<div class="post-metadata">

**Author:** ![Thudlow\_Boink](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/thudlow_boink/32/320_2.png) [@Thudlow\_Boink](https://boards.straightdope.com/u/Thudlow_Boink)\
**Post date:** [May 21, 2021, 3:30am UTC](https://boards.straightdope.com/t/lagrange-error-bound-confusion/942588/2 "2021-05-21T03:30:00Z")

</div>

> [@Someonewastaken](#):
>
> I understand that the error bound uses the max value of the n+1 derivative, but how would you find the max value if e^x has a range of (0,inf). Would you use e^2 as the max value?

e^x is an increasing function. Therefore we know that, if c is between 0 and 2, e^c is between e^0 and e^2, with a maximum value of e^2.

---

<div class="post-metadata">

**Author:** ![Someonewastaken](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@Someonewastaken](https://boards.straightdope.com/u/Someonewastaken)\
**Post date:** [May 21, 2021, 7:12am UTC](https://boards.straightdope.com/t/lagrange-error-bound-confusion/942588/3 "2021-05-21T07:12:17Z")

</div>

Oh, okay thank you. although little, that clarified a lot.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [May 21, 2021, 8:01am UTC](https://boards.straightdope.com/t/lagrange-error-bound-confusion/942588/4 "2021-05-21T08:01:26Z")

</div>

Your problem, such that it is, is that expanding exp(x) into a Taylor series at 0 is not going to result in a particularly good estimate of exp(2). That is why you have to take it to such a high degree.

If you allow yourself to use a different polynomial, you can approximate the function over your entire interval [0,2] using a polynomial of much lower degree. 7th degree ought to do it in your case.
