# Thread: Calculate error using Lagrange formula

1. ## Calculate error using Lagrange formula

I'm sorry for posting so much but I have another question.
The problem says:

let f(x) = sin(x).
Use the Lagrange formula to find the smallest value of n so that the nth degree Taylor polynomial for f centered at x = 0 approximates f at x = 1 with an error of no more that 0.001.

2. Originally Posted by etha
I'm sorry for posting so much but I have another question.
The problem says:

let f(x) = sin(x).
Use the Lagrange formula to find the smallest value of n so that the nth degree Taylor polynomial for f centered at x = 0 approximates f at x = 1 with an error of no more that 0.001.
The Lagrange form for the remainder is:

$\displaystyle R_n=\frac{x-x_0}{(n+1)!}f^{(n+1)}(\xi),\ \ \xi\in [x_0,x],$

so in this case

$\displaystyle |R_n|=\frac{1}{(n+1)!}|f^{(n+1)}(\xi)|,\ \ \xi\in [0,1],$.,

where $\displaystyle |f^{(n+1}(\xi)|\le 1$ if $\displaystyle n$ is even and $\displaystyle |f^{(n+1}(\xi)|\le \sin(1)$ if $\displaystyle n$ is odd.

So now you have to find the smallest $\displaystyle n$ such that:

$\displaystyle |R_n|\le 0.001$

You should do this seperately for odd and even $\displaystyle n$, and then select the smallest
of the two.

RonL