Computer programming using Matlab or Freemat MTH 174 – Computer Project 2

Computer programming using Matlab or Freemat
MTH 174 – Computer Project 2
Use numerical integration to approximation of the definite integral using the listed below:
1. Methods:
(a) Simpson’s Rule (computer project 1)
(b) Composite Midpoint Rule
Z b
a
f(x)dx = (b
a)h2
24 f00(
a + b
2 ) + h
X
N
i=1
f(
xi+1 + xi
2 )
where h = (b
a)/N.
2. Alternative Extended Simpson’s Rule
Z b
a
f(x)dx = h
48 {17f(x1) + 59f(x2) + 43f(x3) + 49f(x4)
+48 “N
X3
i=5
f(xi)
#
+ 49f(xN2)
+ 43f(xN1)
+ 59f(xN ) + 17f(xN+1)
where h = (b
a)/N.
3. Use Simpson’s Rule, Composite Midpoint Method and Alternative Extended Simpson’s
Rule to approximate the following integral. Find the minimum N to yield a correct 4
decimal places correctly? Note only use N as an even counting number and START with
N = 8 and a = 0.0000000001
(a) Z ?/2
a
x
sin(x)
dx
(b) Z ?/2
a
ex
1
sin(x)
dx
(c) Z 1
a
arcsin(x)
x
dx
4. Use the three-methods above, write codes to compute the arc length of f(x) on [a, b] and
volume of f(x) on interval [a, b] revolve along x-axis. What is the minimum N to yield a
correct 4 decimal places correctly?
(a) f(x) = x
sin(x) from [a, ?/2]
(b) f(x) = ex
1
sin(x) from [a, ?/2]
(c) f(x) = arcsin(x)
x from [a, 1]
RUBRIC:
+ Hard copy of the report is due on March 30, 2017 by 7:45pm NO LATE WORK ACCEPTED.
+ Answers all questions and label it.
+ Must type and print all work follow by all code attached at the back of the report.
+ You may work with one partner
+ You turn in as many draft as possible to receive 100% no later than March 23, 2017

find the cost of your paper