Test 2 – MATH 471 solved

$35.00

Category: You will receive a download link of the .ZIP file upon Payment

Description

5/5 - (1 vote)

1. (50 pts.) Write a computer program that uses the derivative approximation
∆2(h) = (4D2(h) − D2(2h))/3
to approximate the first derivative at x = 1 for each of the following functions, using h
−1 = 4, 8, 16, 32.
(a) g(x) = − ln(cos x)
(b) f(x) = x
x
x
2. (50 pts.) For each integral below, write a program to compute the trapezoid rule using the sequence
of mesh sizes h = 1/2(b − a), 1/4(b − a), 1/8(b − a), …, 1/128(b − a) where b − a is the length of the
given interval.
(a) R 1
0
(e
x − e
−x
)/2 dx
(b) R 1
0

1 − x
4 dx
3. (50 pts.) For the function below, write a program that indicates the (minimum) number of iterations
required to estimate the root on the interval [1, 2], within an error tolerance of 10−5
. Make sure to
print your final conclusions to the console, or write them as a comment in your code. Do this for the
bisection method, the regula-falsi method, and Newton’s method with x0 = 1:
f(x) = x
x
x
− 3.