Quiz 01 - Questions & Solutions
Quiz 01 - Questions & Solutions
Quiz 01 - Questions & Solutions
Quiz #1
Student Name: Student ID:
1.
(a) Evaluate the polynomial
y = x3 − 7x2 + 8x − 0.35
at x=1.37. Use 3-digit arithmetic with chopping. Evaluate the percent relative
error.
(b) Repeat (a) but express y as
y = ((x − 7)x + 8)x − 0.35
Evaluate the error and compare with part (a).
a) True value:
𝑦 = 𝑥 3 − 7𝑥 2 + 8𝑥 − 0.35 = 1.373 − 7(1.37)2 + 8(1.37) − 0.35 = 0.043053
Value chopped to 3 significant figures: 0.0430
True error: 𝐸𝑡 = 0.043053 − 0.0430 = 0.000053
0.000053
Percent relative true error: 𝜀𝑡 = 0.043053 . 100% ≃ 0.123%
b) True value:
𝑦 = ((𝑥 − 7)𝑥 + 8)𝑥 − 0.35 = ((1.37 − 7)1.37 + 8)1.37 − 0.35 = 0.043053
Value chopped to 3 significant figures: 0.0430
True error: 𝐸𝑡 = 0.043053 − 0.0430 = 0.000053
0.000053
Percent relative true error: 𝜀𝑡 = . 100% ≈ 0.123%
0.043053
Two expressions of y produces the same results.
HVUS 1
2. Use of Taylor series expansions to approximate the following functions with
x0=0
(a) 𝑓(𝑥) = √𝑥 2 + 1 − 𝑥
We have:
𝑓(x0 ) = 1
𝑥
𝑓 ′ (𝑥) = − 1 ⇒ 𝑓 ′ (x0 ) = −1
√𝑥 2 + 1
1
𝑓 ′′ (𝑥) = 2 ⇒ 𝑓 ′′ (x0 ) = 1
(𝑥 + 1)3/2
−3𝑥
𝑓 (3) (𝑥) = 2 ⇒ 𝑓 (3) (x0 ) = 0
(𝑥 + 1)5/2
(4) 3(4𝑥 2 − 1)
𝑓 (𝑥) = 2
(𝑥 + 1)7/2
sin 𝑥
(b) 𝑓(𝑥) = 1+cos 𝑥
We have:
𝑓(x0 ) = 0
1 1
𝑓 ′ (𝑥) = ⇒ 𝑓 ′ (x0 ) =
1 + cos 𝑥 2
sin 𝑥
𝑓 ′′ (𝑥) = ⇒ 𝑓 ′′ (x0 ) = 0
(1 + cos 𝑥)2
2 − cos 𝑥 1
𝑓 (3) (𝑥) = 2
⇒ 𝑓 (3) (x0 ) =
(1 + cos 𝑥) 4
sin 𝑥(5 − cos 𝑥)
𝑓 (4) (𝑥) =
(1 + cos 𝑥)3
HVUS 2
3. The following infinite series can be used to approximate ex :
𝑥2 𝑥3 𝑥𝑛
𝑒𝑥 = 1 + 𝑥 + + + ⋯ +
2 3! 𝑛!
(a) Prove that this Maclaurin series expansion is a special case of the
Taylor series expansion with xi = 0 and h = x.
(b) Use the Taylor series to estimate f (x) = e−x at xi+1=1 for xi=0.2. Employ the
zero-, first-, second-, and third-order versions and compute the |εt| for each
case.
𝑓 ′ (𝑥) = −𝑒 −𝑥
𝑓 ′′ (𝑥) = 𝑒 −𝑥
𝑓 (3) (𝑥) = −𝑒 −𝑥
Zero-order approximation:
First-order approximation:
Second-order approximation:
𝑓 ′′ (𝑥𝑖 ) 2 𝑒 −0.2
𝑓(𝑥𝑖+1 ) ≈ 𝑓(𝑥𝑖 ) + 𝑓 ′ (𝑥𝑖 )ℎ + ℎ = 𝑒 −0.2 − 𝑒 −0.2 (0.8) + 0.82 ≈ 0.4257
2! 2
0.3679 − 0.4257
|𝜀𝑡 | = | | . 100% ≈ 15.71%
0.3679
Third-order approximation:
HVUS 3
𝑓 ′′ (𝑥𝑖 ) 2 𝑓 (3) (𝑥𝑖 ) 3
𝑓(𝑥𝑖+1 ) ≈ 𝑓(𝑥𝑖 ) + 𝑓 ′ (𝑥𝑖 )ℎ + ℎ + ℎ
2! 3!
𝑒 −0.2 𝑒 −0.2
= 𝑒 −0.2 − 𝑒 −0.2 (0.8) + 0.82 − 0.83 ≈ 0.3559
2 6
0.3679 − 0.3559
|𝜀𝑡 | = | | . 100% ≈ 3.26%
0.3679
HVUS 4