Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CPP PROGRAM! Estimating definite Integrals, L n = i = 0 n - 1 f ( x i ) x or the right end -

CPP PROGRAM!
Estimating definite Integrals, Ln=i=0n-1f(xi)x
or the right end-point approximation
Rn=i=1nf(xi)x
There are functions which have no anti-derivatives and thus one can't use the Fundamental Theorem of Calculus and instead must be estimated.
Hopefully you're all aware that increasing n which is the number of rectangles in the estimate usually increases the accuracy.
The idea is to increase until the difference between the two approximations is less than some tolerance which we call lon. For example, imagine that
the estimate for n1 and n2 rectangles are respectively Rn1=5.001 and Rn2=5.002 the difference between the two errors is
|Rn2-Rn1|=0.001
if the difference of the errors is less than the tolerance lon then we stop increasing the number of rectangles and use the last estimate as the estimating
value.
Program
You will create a program which estimates the definite integral of f(x) between x=a and x=b using either the left-end point or right-end point
approximation. The program will increase n until the difference of the errors is less than the given tolerance.
Use the header for some of the functions.
f(x)=x2+3x+6 between x=1 and x=5 with lon=0.2. What was the value of n? Compare to the actual value.
f(x)=cos(3x) between x=0 and x=0.5 with lon=0.1. What was the value of n? Compare to the actual value.
f(x)=32x+1 between x=4 and x=5 with lon=0.02. What was the value of n? Compare to the actual value.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions

Question

Define two major standards: U.S. GAAP and IFRS.

Answered: 1 week ago