Question: i) Calculate integrals for funtions analytically. ii) Write computer code finding integrals numerically by following methods. For all methods, obtain a table which contains
i) Calculate integrals for funtions analytically. ii) Write computer code finding integrals numerically by following methods. For all methods, obtain a table which contains number of data N, integration result for current N number, and error between current integration result and exact analytical solution. Use N = 2,5, 10,50, 100 values. a) Directly use function values for each interval, Jf(x)dx fx) x b) Trapezodial rule. c) Simpson's 1/3 rule. iii) Make comments about results and comparisons about methods. fi(x) = 4x3 + 5x2 + x 2; x E [1,5] x2 f2(x) = [2, 20] 2x3 + 3 f3(x) = 2x2e-*; x [0,4]
Step by Step Solution
There are 3 Steps involved in it
deinne the function f1 using function handle f1x 4x35x2x2 a1 b5 dispTable for simpson for the function f1 fprintfN I err fprintf for N251050100 exact value dxbaN step size xadxb exactsumf1xdx call the ... View full answer
Get step-by-step solutions from verified subject matter experts
