Lab 09
Lab 09
Lab 8
CALCULUS FOR IT 501031
1 Exercises
Exercise 1: Find the critical numbers (C.N) of f (x) for the following cases:
Exercise 2: Find the relative extrema using the second derivative test for the following cases:
Exercise 3: Given f (x) over a closed interval [a, b], find the absolute maximum and the absolute minimum
for the following cases:
(a) f (x) = x2 − 2x − 5, a = 0, b = 2 −π π
(j) f (x) = tan2 (x), a = ,b =
4 4
(b) f (x) = 3x + x3 + 5, a = −4, b = 4
(k) f (x) = ex sin(x), a = 0, b = π
(c) f (x) = sin(x) + 3x2 , a = −2, b = 2
(l) f (x) = x4 − 3x2 , a = −4, b = 0
x2
(d) f (x) = e + 3x, a = −1, b = 1
(m) f (x) = x4 − 3x2 , a = 0, b = 4
3
(e) f (x) = x − 3x, a = −3, b = 0
(n) f (x) = x5 − 5x3 , a = −4, b = 0
3
(f) f (x) = x − 3x, a = 0, b = 3
(o) f (x) = x6 − 5x2 , a = −1, b = 1
(g) f (x) = sin(x), a = 0, b = π
(p) f (x) = x3 − 9x, a = −3, b = 0
(h) f (x) = sin(2x), a = 0, b = 2
(q) f (x) = x3 − 9x, a = 0, b = 3
π 3π
(i) f (x) = cos(x), a = , b = (r) f (x) = x3 + 9x, a = −1, b = 1
2 2
Anh H. Vo - [email protected] 1
Ton Duc Thang University
Faculty of Information Technology
Exercise 5: Write a program to implement Golden Search and apply to determinate minimum value of
f (x) = x2 in [−2, 1], with a tolerate = 0.3, , and illustrate on the graph/ table for each iteration.
Exercise 6: Implement Fibonacci Search and apply to determinate minimum value of f (x) = x2 in
[−2, 1], with a tolerate = 0.3, and illustrate on the graph/ table for each iteration.
n = 2 while b − a ≥ do
d ←− b − a
Fn−1
x1 ←− b − d
Fn
Fn−1
x2 ←− a + d
Fn
if f (x1 ) ≤ f (x2 ) then
b ←− x2
else
a ←− x1
end if
n=n+1
Fn = Fn−1 + Fn−2 end while
Output: Reduced interval [a, b]
Anh H. Vo - [email protected] 2
Ton Duc Thang University
Faculty of Information Technology
1
(e) f (x) = x2 − x − 10, in [−10, 10], and = 5
1
(f) f (x) = −(x + 6)2 + 4, in [−10, 10], and = 8
1
(g) f (x) = −2x2 + 3x + 6, in [−3, 5], and = 8
(a) f (x1 , x2 ) = x21 + x22 − 4x1 − 4x2 in [0 1] (e) f (x1 , x2 ) = x21 ex1 + 51x2 + x42 + 3 in [0 1]
2 4 2
(b) f (x1 , x2 ) = 3x1 + 2x2 − x2 + x2 + 1 in [1 2] 2
2 (f) f (x1 , x2 ) = ex1 −3 + x22 − 3x2 in [1 2]
(c) f (x1 , x2 ) = ex1 + x22 − 3 + 2 ∗ x2 in [1 2]
(d) f (x1 , x2 ) = (x21 − 1)2 + x22 − 3x2 + 1 in [0 0] (g) f (x1 , x2 ) = x1 x32 + 2x21 + 2x42 − 5 in [-1 1]
Anh H. Vo - [email protected] 3