The objective of this problem is to find a method that can evaluate() = cos
, for 0 ≤
≤ 2, with an error of no more than 10−6. In doing this, the interpolation points are restricted to those
i
’s for which the exact value of cos
i
is known. It is useful to know that, by considering the angles in a polygon, it is possible to determine the exact values of cos
and sin
for
=
/10,
/12,
/15, etc. (these are given on the Wikipedia page Exact trigonometric constants).
(a) Show that if the values of cos
and sin are known for
=
, then they are known at
=
, for
= 2, 3, 4, ··· .
(b) For a given value of
, let
=
and suppose that the interpolation points are
i
= ( − 1), for
= 1, 2, ··· ,
+ 1. Find
in terms of
.
(c) According to Theorem 5.4, how small must
be so the error using piecewise linear interpolation with
() = cos
is no more than 10−6? What is the smallest value of
so that
≤
?
(d) According to Theorem 5.6, how small must
be so the error using a clamped cubic spline with
() = cos
is no more than 10−6? What is the smallest value of
so that
≤
?
(e) For a given value of
, describe a procedure that uses the exact values of cos
and/or sin
to evaluate
() = cos
, for 0 ≤
≤ 2, with an error of less than 10−6.
(f) Write a MATLAB program that implements your algorithm in part (e) and compares the computed values with MATLAB’s built in cosine function, for
= 1, 2, 5.