Question

USE PYTHON TO SOLVE 3) Given f(x) = e^-x (a) Estimate the area under the graph...

USE PYTHON TO SOLVE

3) Given f(x) = e^-x

(a) Estimate the area under the graph between x = 0 and x = 2 with n = 10, 100, 1000 left endpoint rectangles.

(b) Compare your answers in part (a) to the exact area, 1 − (1 / e^2 ). What do you notice?

Homework Answers

Answer #1

Python Script:

import math

def func(x):
return math.exp(-x)

N = [10, 100, 1000]
Sum = [0, 0, 0]
for i in range(len(N)):
n = N[i]
x = 0
h = 2/n
for j in range(n):
Sum[i] += func(x)*h
x += h
print('Area (n = ' + str(n) + ') =', Sum[i])
print('Exact Area =', 1 - 1/math.exp(2))

Output:

Area (n = 10) = 0.9540114845132726
Area (n = 100) = 0.873340185896101
Area (n = 1000) = 0.8655296697017035
Exact Area = 0.8646647167633873

Note: Approximation approaches the exact value as we increase the number of intervals.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
f(x) = x^2+1 -Estimate area between graph f(x) & x-axis -interval : [1,3] - n=4 rectangles...
f(x) = x^2+1 -Estimate area between graph f(x) & x-axis -interval : [1,3] - n=4 rectangles - method: left-endpoint
(a) Estimate the area under the graph of f(x) = 4 cos(x) from x = 0...
(a) Estimate the area under the graph of f(x) = 4 cos(x) from x = 0 to x = π/2 using four approximating rectangles and right endpoints. (Round your answers to four decimal places.) R4 = 3.1631 Sketch the graph and the rectangles. Is your estimate an underestimate or an overestimate? underestimateoverestimate     (b) Repeat part (a) using left endpoints. L4 = 4.7339 Sketch the graph and the rectangles. Is your estimate an underestimate or an overestimate? underestimateoverestimate    
Use a finite approximation to estimate the area under the graph of the given function on...
Use a finite approximation to estimate the area under the graph of the given function on the stated interval as instructed. 1) f(x) = x 2 between x = 3 and x = 7 using a left sum with four rectangles of equal width.
Estimate the area under the graph of f ( x ) = 1 x + 1...
Estimate the area under the graph of f ( x ) = 1 x + 1 over the interval [ 3 , 5 ] using two hundred approximating rectangles and right endpoints R n = Repeat the approximation using left endpoints L n =
1) Use finite approximation to estimate the area under the graph of f(x) = x^2 and...
1) Use finite approximation to estimate the area under the graph of f(x) = x^2 and above the graph of f(x) = 0 from Xo = 0 to Xn= 2 using i) a lower sum with two rectangles of equal width ii) a lower sum with four rectangles of equal width iii) an upper sum with two rectangles of equal width iv) an upper sum with four rectangles if equal width 2) Use finite approximation to estimate the area under...
Estimate the area under the graph of f(x) = 4 cos(x) from x = 0 to...
Estimate the area under the graph of f(x) = 4 cos(x) from x = 0 to x = π/2 using four approximating rectangles and right endpoints. (Round your answers to four decimal places.) Repeat with left endpoints.
Estimate the area under graph f(x) = sin(x) from x = 0 to x = pi/2....
Estimate the area under graph f(x) = sin(x) from x = 0 to x = pi/2. Using 4 sub-intervals and the left endpoints. Sketch the graph and the rectangles.
Estimate to the hundredth the area from 0 to 2 under the graph of f(x) =...
Estimate to the hundredth the area from 0 to 2 under the graph of f(x) = e^x - 3 using 4 approximating rectangles and midpoints endpoints.
(a) Estimate the area under the graph of f(x) = 2/x from x = 1 to...
(a) Estimate the area under the graph of f(x) = 2/x from x = 1 to x = 2 using four approximating rectangles and right endpoints. (Round your answer to four decimal places.) (b) Repeat part (a) using left endpoints. (Round your answer to four decimal places.)
(1 bookmark) Use the midpoint rule to estimate the area under graph of f(x) =5/x and...
(1 bookmark) Use the midpoint rule to estimate the area under graph of f(x) =5/x and above the graph of f(x) = 0 from X0 = 1 to Xn =65 Using two rectangles equal width and four rectangles of equal width
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT