Question: Given a function: f ( x ) = x ^ 4 - 7 . 2 x ^ 3 + 1 5 . 8 x -

Given a function:
f(x)= x^4-7.2x^3+15.8x -1.9
Calculate numerically the integral value of the function within the interval [-3,7]. Your method must have variable number of sub intervals n. Your script must include the following line
n =input("Enter n=");
The exact value of the integral is -469.000000. Use three different methods:
a.) Riemann sum right rule
b.) Trapezoidal rule
c.) Simpsons method 3/8 rule.
d.) calculate relative error for each method
(error = calculated/ exact -1);
Is my MATLAB code right? What is supposed to be the M(1) and M(end) value for Simpsons 3/8 rule? I am getting an incorrect value for Simpsons rule.
The command window gives me:
S1=-483.0743
S2=-467.5743
S3=-445.3910
Error1=0.0300
Error2=-0.0030
Error3=-0.0503
S3 must be closest to -469 and error3 must be the smallest, but it's not. Therefore it's incorrect. What should my M values be changed to?
Given a function: f ( x ) = x ^ 4 - 7 . 2 x ^ 3 +

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!