Chapter 6: Techniques of Integration
Section 6.7: Numeric Methods
|
Example 6.7.8
|
|
Sketch a derivation of the Trapezoid rule.
|
|
|
|
Solution
|
|
|
Mathematical Solution
|
|
>
|
use plots,plottools,Student:-VectorCalculus in
module()
local p1,p2,p3,p4,p5,p6,p7,g,v1,v2,v3,v4;
g:=x->x*(1-x^2);
p1:=plot(g,-.02..1,color=black,tickmarks=[0,0],axis[2]=[color=white]):
p2:=polygon([[.248,0],[.248,g(.248)],[.5,g(.5)],[.5,0]],transparency=.7,color=red);
p3:=polygon([[.502,0],[.502,g(.502)],[.75,g(.75)],[.75,0]],transparency=.7, color=green);
p4:=textplot({[.25,-.01,typeset(x[k])],[.5,-.01,typeset(x[k+1])],[.75,-.01,x[k+2]]});
p5:=textplot({[.18,g(.25),typeset(``(x[k],f[k]))],[.35,g(.5),typeset(``(x[k+1],f[k+1]))],[.88,g(.75),typeset(``(x[x+2],f[k+2]))]});
p6:=textplot([.375,.05,typeset(h)]);
v1:=RootedVector(root=[.35,.05],<-.1,0>);
v2:=RootedVector(root=[.4,.05],<.1,0>);
p7:=PlotVector([v1,v2],color=black);
print(display(p1,p2,p3,p4,p5,p6,p7));
end module:
end use:
|
|
Figure 6.7.7(a) Two contiguous trapezoids
|
|
|
|
>
|
use plots,plottools,Student:-VectorCalculus in
module()
local p1,p2;
p1:=polygon([[0,0],[3,0],[2,1],[0,1]],color=red,transparency=.7);
p2:=textplot({[1,1.1,typeset(f[k])],[1.25,-.12,typeset(f[k+1])],[.1,.5,typeset(h)]});
print(display(p1,p2,scaling=constrained,tickmarks=[0,0],axes=None));
end module:
end use:
|
|
Figure 6.7.7(b) A single trapezoid
|
|
|
|
|
|
•
|
Figure 6.7.7(a) shows two contiguous trapezoids under the graph of . The red trapezoid lies between the nodes and ; the green, between and .
|
•
|
Figure 6.7.7(b) shows the red trapezoid from Figure 6.7.7(a) rotated so that the two parallel sides (the bases) are horizontal, and the height corresponds to the "width" in an array of trapezoids on the interval .
|
•
|
The area of the generic trapezoid is , the average of the bases times the height.
|
•
|
The sum of the areas of the trapezoids is
|
|
|
|
|
|
|
•
|
The left base in the leftmost trapezoid, and the right base in the rightmost trapezoid appear only once in the sum. Every other base appears twice, once as the right base in a contiguous pair, and once as the left. This should be clear from Figure 6.7.7(a) where the base with length appears as a base in both the red and green (contiguous) trapezoids.
|
|
|
Maple Solution
|
|
Area of one trapezoid
|
•
|
Enter the area of the generic trapezoid.
|
•
|
Context Panel: Assign to a Name≻A[k]
|
|
|
Area of five trapezoids
|
•
|
Expression palette: summation template
Sum the area of trapezoids for
Press the Enter key.
|
•
|
Context Panel: Simplify≻Simplify
|
|
|
Generalize to the partition
|
|
|
Note the factor of in front of the parentheses. Inside the parentheses the terms and represent the values of at the first and last nodes, namely, and , respectively. The remaining terms in the parentheses are "twice the sum of the function values at the nodes between first and last." Hence, the generalization to
where , and .
|
|
|
<< Previous Example Section 6.7
Next Example >>
© Maplesoft, a division of Waterloo Maple Inc., 2024. All rights reserved. This product is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation.
For more information on Maplesoft products and services, visit www.maplesoft.com
|