With four arguments, plotarea represents a numeric approximation
of the area below a curve, according to a quadrature method from the
following list:
trapezoid,rectangle_left,rectangle_right,middle_point.
For example plotarea(f(x),x=a..b,n,trapezoid)
draws the area of n trapezes : the
third argument is an integer n, and the fourth argument is the name of the
numeric method of integration when [a, b] is cut into n equal parts.
Input :
plotarea((x^
2,x=0..1,5,trapezoid)
If you want to display the graph of the curve in contrast
(e.g. in bold red), input :
plotarea(x^
2,x=0..1,5,trapezoid);
plot(x^
2,x=0..1,display=red+line_width_3)
Output :
the 5 trapezes used in the trapezoid method to approach the integral
Input :
plotarea((x^
2,x=0..1,5,middle_point)
Or with the graph of the curve in bold red, input :
plotarea(x^
2,x=0..1,5,middle_point); plot(x^
2,x=0..1,display=red+line_width_3)
Output :
the 5 rectangles used in the middle_point method
to approach the integral