Question: using c++ Write a program that reads in values double a and double b, the boundaries of the inter- val [a, b, and the number


using c++
Write a program that reads in values double a and double b, the boundaries of the inter- val [a, b, and the number of subintervals unsigned int n and then computes approzimately the value for the definite integral 325r dr which is equal to (b365) (a3 a5), using the left Riemann sum. The program must print out the numerically computed value and the error of the numetical integration; see the explanation below Explanation: Recall that the integral f(x)dr is the area under the graph of the function f(x) on the interval [a, , whenever the function f(r) is nonnegative. If f(r) takes both positive and negative values, then the integral represents a signed area, comprising of the difference of the areas above and below the graph of f(r). The integral can be computed approximately using a numerical procedure. Given an integer n n>0, define ha band let a be a grid of points on the interval [a, b]. Then the integral can be approximated as follows f(x) dr Ln-(i -ro)f(ro) (2) f().+(n-n-1)-f(rn-1) The sum Ln is called the left Riemann sum, it is the sum of the areas of n rectangles. The error of numerica l integration is then defined by
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
