subject

An approximation to the integral of a function f(x) over an interval [a, b] can be found by first approximating f(x) by the straight line that goes through the end points (a, f(a)) and (b, f(b)), and then finding the area under the straight line, which is the area of the trapezoid. The resulting formula becomes:

lim(a→b) ∫ f(x)d(x) = (b-a)/2[f(a) + f(b)]

Write a function trapezint1( f, a,b) that returns this approximation to the integral. The argument f is a Python implementation f(x) of the mathematical function f(c). For instance, the result of trapezint1( math. sin,0,0.5* math. pi ) should be 0.7854 (with some numerical error). The result of trapezint1( abs, -1,1 ) should be 2.0.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 02:30
Assume a class window with accessor method getwidth that accepts no parameters and returns an integer. assume further an array of 3 window elements named winarr, has been declared and initialized. write a sequence of statements that prints out the width of the widest window in the array.
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
If you add the following to the query grid in an access query, what is it called? salestaxamt: [salestaxrate]*[totalsale] formula calculated field total calculation
Answers: 2
question
Computers and Technology, 24.06.2019 18:30
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 1
question
Computers and Technology, 25.06.2019 07:30
The can be used to paste text in any order.
Answers: 1
You know the right answer?
An approximation to the integral of a function f(x) over an interval [a, b] can be found by first ap...
Questions
question
Mathematics, 17.04.2020 20:45
question
Chemistry, 17.04.2020 20:46
Questions on the website: 13722362