Computers and Technology

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.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 03:40, hussain34
Mary's manager told her she should insert a graphic into her documentwrite mary a brief note describing how to insert a graphicin a word processing document.
Answers: 1
image
Computers and Technology, 22.06.2019 22:30, kierafisher05
What is the most popular genre of video games?
Answers: 1
image
Computers and Technology, 23.06.2019 02:30, noah2o2o
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: 2
image
Computers and Technology, 23.06.2019 06:30, Zieken993
Martha is designing a single-player game. her manager suggests that she plan the design to incorporate future modifications. which principle of game design relates to planning for future modifications?
Answers: 1
Do you know the correct answer?
An approximation to the integral of a function f(x) over an interval [a, b] can be found by first ap...

Questions in other subjects:

Konu
Mathematics, 08.03.2021 21:10
Konu
Mathematics, 08.03.2021 21:10
Konu
Mathematics, 08.03.2021 21:10