Chapter 6: Techniques of Integration
Section 6.7: Numeric Methods
Example 6.7.7
Use the Trapezoid rule to approximate the area under the curve determined by the following data points.
k
0
1
2
3
4
5
6
7
8
9
10
xk
−1
−0.8
−0.6
−0.4
−0.2
0.2
0.4
0.6
0.8
fk
13
7.523
4.679
3.528
3.436
4.971
6.175
7.440
8.516
Table 6.7.7(a) Data points determining a curve
Solution
Mathematical Solution
Figure 6.7.7(a) shows the eleven data points and the piecewise linear curve connecting them.
The Trapezoid rule, with n=10 and h=1/5 gives the area A as
A
=h2f0+f10+2∑k=19fk
=1/5213+9+250.268
=110122.536
=12.2536
use plots in module() local X,Y,S,q,f,p1,p2,p3,k; q:=-2*x^5+2*x^4-4*x^3+5*x^2+4*x+4; for k from 0 to 10 do f[k] := evalf(eval(q,x=-1+k/5),4); end do; X:=[seq(k/5,k=-5..5)]: Y:=[seq(f[k],k=0..11)]: S:=[seq([X[k],Y[k]],k=1..11)]: p1:=plot(X,Y,view=[-1..1,0..13]): p2:=plot(S,style=point,symbol=solidcircle,symbolsize=15,color=green): p3:=display(p1,p2,labels=[x,y]); print(p3); end module: end use:
Figure 6.7.7(a) Piecewise linear curve
Of course, the most tedious part of the calculation is entering the data!
Maple Solution
Enter the data
Form a list of the eleven function values in Table 6.7.7(a).
Context Panel: Assign to a Name≻f
13,7.523,4.679,3.528,3.436,4,4.971,6.175,7.440,8.516,9→assign to a namef
Apply the Trapezoid rule
Because lists are enumerated from 1, the eleven data points must be referenced as fk,k=1,…,11.
1/52f1+f11+2∑k=210fk = 12.25360000
The use of a list for the function values is a simplification that is counterbalanced by the need to shift the indices of the data points upward by 1.
<< 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
Download Help Document