Let f:=cos(x) I'm asked to find for which values of x we can be sure the 4th degree Taylor polynomial will give an error lesser than 1/(1000).

Madilyn Quinn

Madilyn Quinn

Answered question

2022-10-29

Approximating the cosine by Taylor polynomial
Let f := cos ( x ) I'm asked to find for which values of x we can be sure the 4th degree Taylor polynomial will give an error lesser than 1 1000 .
Now, cos ( x ) = 1 x 2 2 + x 4 24 + o ( x 4 )
Taylor's 4th degree remainder is then R = f ( 5 ) ( cos ( θ ) ) 5 ! x 5 = sin ( θ ) 5 ! x 5
Since I'm only asked about the error, I can get rid of the sign, and can do the following boundering:
| R | | 1 5 ! x 5 | 1 1000
Since that is strictly increasing, its easy to solve
that last inequation, by doing 1 120 x 5 = 1 1000 x = 120 1000 5 0.65
Which ends up giving | R | 1 1000 x : | x | 120 1000 5 ( 0.65 )
Now, I thought this was an already correct solution, but to my surprise, I checked plotted both the function and its Taylor polynomial, and the error bound that produces below 0.65 is not only lesser than 1 1000 , but actually lesser than 1 10000
e.g:
cos ( 0.65 ) = 0.796187...
t a y l o r ( c o s ( 0.65 ) ) = 0.796083...
Which means it is overly precise, what is going on here, I'm asuming it must be some arithmetic mistake I made somewhere, but I can't find it and its driving me crazy.

Answer & Explanation

faux0101d

faux0101d

Beginner2022-10-30Added 21 answers

Step 1
You made us of | sin θ | 1 in your derivation, which is a very conservative estimate and fine. Once you notice that in fact | sin θ | | θ | | x | , you can try to find the bounds for x from | x 6 5 ! | < 1 1000 , which will allow you to go up to 0.7023… instead of just 0.65.
Step 2
Still, the fact that Taylor guarantees you an error < 1 1000 does not exclude the possibility that the error is indeed much smaller "by chance".
Nathalie Case

Nathalie Case

Beginner2022-10-31Added 4 answers

Step 1
You have given an upper bound for the error, so you shouldn't be surprised that the actual error is below it. Further, you gave away more than you could have by assuming that sin ( θ ) gets as large as 1 in your interval, which it doesn't.
So that's to say that nothing is wrong, and the trivial upper bound is exactly that - trivial.
Step 2
On the other hand, there is a better trivial upper bound. The cosine expansion is alternating, the terms go to 0, are decreasing in size (which isn't immediately obvious, nor true for all ranges of x - but it is true here). So you can recognize that the error will be less than the first omitted term.
The first omitted term is x 6 / 6 !. At x = .65, this is about .0001, or 1/10000, as you've requested.
Since the terms of the cosine expansion quickly decay, this alternating series error should be pretty accurate very often.

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?