Question: Im not understanding this python code s = 69704723 This question shows how to use the area of rectangles to estimate the definite integral of
Im not understanding this python code
s = 69704723

This question shows how to use the area of rectangles to estimate the definite integral of a function. Consider the definite integral, f(x) dz Divide the interval fron 1-a tol-b into n equal subintervals of length 1 each. Let ck be the midpoint in the k-th subinterval. For example, ci-a + ca-a + 1. . . . and c"-b-t Then the definite integral can be approximated by Recall that this is just the midpoint Riemann sum in Calculus1 Now take f(1)-12 and end points a 0, b-10. Approximate 10 using the above method. Requirement: define a function with name "Approxintegral" ### Solution to Question 2 def Approx.integral(n) Your codes The input n to the function is the number of subintervals used to approximated the definite integral. The function should return the above sum J(G). You should choose the number n such that E/(c.lar, r) da somi 0.001 Write the number n explicitly in the code. Note this implies that the error between the true value and the approximated value is tiny. The true value can be computed easily
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
