WRITE A C++ PROGRAM TO IMPLEMENT THE MID POINT RULE NUMERICAL APPROXIMATION
WRITE A C++ PROGRAM TO IMPLEMENT THE MID POINT RULE NUMERICAL APPROXIMATION
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter13: Structures
Section: Chapter Questions
Problem 4PP
Related questions
Question
WRITE A C++
![Midpoint Rule
If we consider the case where x is chosen to be the midpoint ; of the subinterval [x;-1, x;]. Then we
have
ь — а
| f(x) dx = M,n = Ax[f(F1)+ f (T2) + + · · · + f(Tm)], where Ax
and õi
(Xi-1+ xi)
•.
n
As shown in the figure below
y A
(c) Midpoint approximation
The following algorithm uses the Midpoint Rule on n subintervals to approximate I
dx:
• INPUT endpoints a, b; positive integer n.
• OUTPUT approximate solution XI to I.
- a
• Step 1 Set h
• Step 2 Set XI = 0; Xbar
= a + 5:
- Step 3 For i = 1,2,-
- Step 4 Set XI = XI+ f(Xbar)
Step 5 Set i = i +1
...n do Steps 4 to 6.
Step 6 Set Xbar = Xbar +h
-
• Step 7 XI = XI * h.
• Step 8 OUTPUT(XI) and STOP.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F75d9c7d3-d734-453a-85e0-780b79a7d6f6%2F79621e70-1772-4e06-ab7d-60918f742da4%2Fm654whw_processed.png&w=3840&q=75)
Transcribed Image Text:Midpoint Rule
If we consider the case where x is chosen to be the midpoint ; of the subinterval [x;-1, x;]. Then we
have
ь — а
| f(x) dx = M,n = Ax[f(F1)+ f (T2) + + · · · + f(Tm)], where Ax
and õi
(Xi-1+ xi)
•.
n
As shown in the figure below
y A
(c) Midpoint approximation
The following algorithm uses the Midpoint Rule on n subintervals to approximate I
dx:
• INPUT endpoints a, b; positive integer n.
• OUTPUT approximate solution XI to I.
- a
• Step 1 Set h
• Step 2 Set XI = 0; Xbar
= a + 5:
- Step 3 For i = 1,2,-
- Step 4 Set XI = XI+ f(Xbar)
Step 5 Set i = i +1
...n do Steps 4 to 6.
Step 6 Set Xbar = Xbar +h
-
• Step 7 XI = XI * h.
• Step 8 OUTPUT(XI) and STOP.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr