Page 1 of 1

23. One way to approximate the value of a definite integral 1- [*f(x) dx = is to split the interval [a, b] into n equal

Posted: Wed May 04, 2022 1:32 pm
by answerhappygod
23 One Way To Approximate The Value Of A Definite Integral 1 F X Dx Is To Split The Interval A B Into N Equal 1
23 One Way To Approximate The Value Of A Definite Integral 1 F X Dx Is To Split The Interval A B Into N Equal 1 (48.4 KiB) Viewed 51 times
23. One way to approximate the value of a definite integral 1- [*f(x) dx = is to split the interval [a, b] into n equal subintervals, each of length h, defined by the n+1 points x, = a + ih for i=0,1,2,...,n, computing the corresponding function values f(x), and taking a linear combination of these function values. The composite trapezoidal rule is I= f(xo) +2+) H which has an error that is a multiple of h². The composite Simpson rule is M m-1 1-4 (+4 () +20) +00)) f(x, F where m n/2 and is assumed to be even. This has an error that is a multiple of h¹. Write a program that implements these two techniques. The inputs should be a, b,n and the name of a program that evaluates the relevant function f(x). The latter program should input a vector of values x and output a vector of corresponding values y=f(x). Your program should not include any 'for loops. Use your program to approximate the following integrals and to investigate the above claims concerning the behavior of the errors. Which technique is more accurate for a given cost ? (1) In(x) dx = 2 In (2) - 1 (i) (1+e* sin(4x)) dx - 2)