Chapter 7 - Looping

Exercises

1- Calculate the sum of the square of integers between 1 and N (try N=5 and N=12) via a "for" loop; check your results via the "sum" Maple command.

2- Calculate the sum of the square of odd integers between 1 and N (try N=5 and N=12) via a "for" loop; check your results via the "sum" Maple command.

3- Set a grid, 21 points between x={-1,3}; calculate and plot f(x) = exp(-(x-1)2) on this grid. Check your results via Excel.

4- Calculate the area under the curve for the function and grid above via the "left rule", "right rule", and "trapezoidal rule". Calculate the "exact" integral for this function. Compare the results from the trapezoidal rule to the "exact" answer.


  Section 7.8 Chapter 7 TOC Chapter 8

Any questions or suggestions should be directed to
Michel Vallières at vallieres@physics.drexel.edu