# 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:

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

so in this case

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

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

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

$
|R_n|\le 0.001
$

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

RonL