using c++ programs library
21.The Simpson's rule can be used to calculate the integral value of any function. It calculates the value of the area under any curve over a given interval by dividing the area into equal parts. Typically, the curve is divided into n subintervals (equally spaced intervals) of width h as shown in the figure below Where n: in number of subintervals and it must be an even number a and b: the lower and upper limits of integration, respectively h: is width of each subinterval, and It follows that the area (integral value) of a function fx) is approximated as Write a C++program that uses Simpson's rule to find the area under the function/(x). The function is given by: x)The program should get the limits a and b from the user. In addition, it gets the number of subintervals n, but the program should not proceed unless an even number of subintervals is entered. Enter Integration Linits (a, b): 0 10Enter Integration Limits (a, b): 0 10 Enter Number of Subintervals (n): 20 The area under the curve: 1.40 Enter Number of Subintervals (n): 13 n must be even! Try Again: 17 n must be even! Try Again: 16 The area under the curve: 1.40 21.The Simpson's rule can be used to calculate the integral value of any function. It calculates the value of the area under any curve over a given interval by dividing the area into equal parts. Typically, the curve is divided into n subintervals (equally spaced intervals) of width h as shown in the figure below Where n: in number of subintervals and it must be an even number a and b: the lower and upper limits of integration, respectively h: is width of each subinterval, and It follows that the area (integral value) of a function fx) is approximated as Write a C++program that uses Simpson's rule to find the area under the function/(x). The function is given by: x)The program should get the limits a and b from the user. In addition, it gets the number of subintervals n, but the program should not proceed unless an even number of subintervals is entered. Enter Integration Linits (a, b): 0 10Enter Integration Limits (a, b): 0 10 Enter Number of Subintervals (n): 20 The area under the curve: 1.40 Enter Number of Subintervals (n): 13 n must be even! Try Again: 17 n must be even! Try Again: 16 The area under the curve: 1.40