by Sam Leung and Michael Largey
Approximating the average value of a function can be done graphically or with a table of values. The value approach illustrates the use of a limit, while the graphical approach suggests why a definite integral leads to the exact average. This Mathematica demonstration displays both methods of finding the average value of a function and illustrates the correlation between the number of partitions taken to the accuracy of the average.

In Mathematica, building a table of approximations is easy to obtain using a FOR loop. Once the function, the interval, and the number of partitions to be assessed are specified, approximations can be taken from the left end, the right end, or the midpoint of each partition. The location of the point in the interval can even be chosen at random. These approximations would then be used to calculate the average of the function. Mathematica can be used to find the exact average using a definite integral as well.
Both the table and graphical approaches are to be displayed on the same screen. Mathematica will graph the sine function from 0 to π with the PLOT command. (We chose a periodic function so that the interval will have meaningful endpoints, rather than one chosen arbitrarily.) The number of partitions n will be chosen by the user through the MANIPULATE command. A sample point in each interval is displayed using POINT, and a vertical line segment from that point to the sine function is drawn using LINE. At the point of intersection, the co-ordinates will be displayed using TEXT. A FOR loop will total the sample y values. That total will then be divided by the number of partitions, and the obtained quotient will be the approximate average for the number of partitions specified. Below the graph will be printed the number of partitions, the approximation, and the exact answer (calculated by Mathematica using an integral). As the user increases n, the generated results will form a table which will suggest that increasing the number of partitions increases that accuracy of the approximation. In an advanced version, the user could choose whether the sample point comes from the left end of the interval, the right end, the midpoint, or even a randomly selected point.
This exercise will introduce Calculus students to concepts such as successive approximations, the technique of partial sums, limits at infinity, the structure of a Riemann Sum, and a visual relation between area and average value. It is designed to be done as early as the second day of a Calculus course. Given a specific function and interval, students can be assigned to approximate the average value of the function by hand using several increasing values for the number of intervals.
References
Indiana State Standards
http://dc.doe.in.gov/Standards/AcademicStandards/StandardSearch.aspx
C.1.1 Understand the concept of limit and estimate limits from graphs and tables of values.
C.1.6 Find limits at infinity.
C.4.2 Calculate the values of Riemann Sums over equal subdivisions using left, right, and midpoint evaluation points.
C.4.3 Interpret a definite integral as a limit of Riemann Sums.
C.5.5 Use definite integrals to find the average value of a function over a closed interval.
Web Resources
http://www.ecourses.ou.edu/cgi-bin/ebook.cgi?doc=&topic=ma&chap_sec=09.4&page=theory
http://prepcalcabb0607.blogspot.com/2007/02/65-average-value-of-function.html
www.sheltonstate.edu/userfiles/File/faculty/…/ch8_2average_val.ppt
http://mathdl.maa.org/mathDL/47/?pa=content&sa=viewDocument&nodeId=2639
http://www.ugrad.math.ubc.ca/coursedoc/math101/notes/integration/averages.html
http://mathcentral.uregina.ca/QQ/database/QQ.09.00/esther2.html
http://archives.math.utk.edu/visual.calculus/5/average.1/index.html
www.math.ucla.edu/~tat/MicroTeach/average.ppt
http://www.lightandmatter.com/calc/calc.pdf
http://www.tutorvista.com/content/math/calculus/definite-integrals/definite-integral-limit-sum.php