CyberSlug Rules!

Beginner Programming CMPS060

Prof. Paulo Franca

Home

Syllabus

Login

Objects

Download

Staff only

Exercises with numerical applications

Computing Integrals

Integral of f(x) from x1 to x2 can be approximated as follows
integral1.jpg (5670 bytes) integral2.jpg (7477 bytes)

In the approximation,

  • each rectangle has base (x2-x1)/n where n is the number of rectangles
  • each rectangle has height f(x) where x is the midpoint in the base
  • the more rectangles you use, the better your approximation is