Here is a domain description that describes an interval beginning at a, jumping by steps of dx, and ending at b - dx:
|
|
We will use it to compare four integral approximation methods that divide the area between a function and the x axis into a set of polygons:
|
|
Notice how efficiently the list comprehension expressions allow us to compare and contrast the methods.
And here are four corresponding functions that will create lists of the vertices of the polygons determined by each method:
|
|
Finally, here is an interactive cell that pulls all of the preceding together.
The initial default for f(x) is \sin(x), but you can easily change it in the input box that opens up.
Same for a, b, dx, and the approximation method used:
Click to the left again to hide and once more to show the dynamic interactive window |
Sage can find the exact value of an integral:
|
|
|
|
|
|
Experiment with different functions on your own.
Sage can also find derivatives:
|
|
|
|
|
|