Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

With a programmable calculator (or a computer), it is possible to evaluate the e

ID: 2860662 • Letter: W

Question

With a programmable calculator (or a computer), it is possible to evaluate the expressions for the sums of areas of approximating rectangles, even for large values of n, using looping. (On a TI use the Is> command or a For-EndFor loop, on a Casio use Isz, on an HP or in BASIC use a FOR-NEXT loop.) Compute the sum of the areas of approximating rectangles using equal subintervals and right end points for n = 10, 30, 50, and 100. (Round your answers to four decimal places.) The region under y = 5 cos x from 0 to Pi/2

when n 10,30,50,100

Find the sum of Areas

Explanation / Answer

This problem can be solved using the right Riemann sum., ,in Matlab, we will have to create a Function for that, ,using the editor window we have to write:

function value=rsum1(f,a,b,n)
value = 0;
dx = (b-a)/n;
for k=1:n
c = a+k*dx;
value = value + f(c);
end
value = dx*value;

this function calculates a Riemann Sum of the function f on the interval given using a partition of n points.

now, in the command window we declare our function and call the program created putting the conditions, as follows

>>f = inline('5*cosx')

for n=10

>> rsum1(f,0,pi/2,10)

ans =

6.7854

for n=30

>> rsum1(f,0,pi/2,30)

ans =

6.3741

for n=50

>> rsum1(f,0,pi/2,50)

ans =

6.2919

for n=100

>> rsum1(f,0,pi/2,100)

ans =

6.2302

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote